Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2004
    Posts
    61

    Angry Unanswered: Why DB2 Command Center Cannot Execute SQL Statement?

    Why DB2 Command Center can not execute the following SQL statement? The error is:

    DBA2191E SQL execution error.

    com.ibm.db.DataException: A database manager error occurred. : [IBM][CLI Driver][DB2/6000] SQL0104N An unexpected token "END-OF-STATEMENT" was found following "entory) AS inventory". Expected tokens may include: "<table_expr>". SQLSTATE=42601


    But other tools, such as Embarcardero Rapid SQL, can. What's the problem with the DB2 Command Center?

    SQL Statement:

    WITH SARS AS (SELECT DISTINCT c.contact_id, CONCAT ...;
    Last edited by hiolgc; 11-10-04 at 10:23.

  2. #2
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513
    When you're in the Command Center, at the bottom it should have a "Statement termination character". Can you double-check that it's set to ';'? Just a guess.
    --
    Jonathan Petruk
    DB2 Database Consultant

  3. #3
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513
    Oh, also the tool works on what's selected in the pane, make sure you haven't selected some of the statement and not the whole thing...
    --
    Jonathan Petruk
    DB2 Database Consultant

  4. #4
    Join Date
    Mar 2004
    Posts
    61
    Hi Jonathan,

    I guess that's the problem. But where can I set "Statement termination character"? My DB2 is 7.2.9. I don't see any message about "Statement termination character" at the bottom of the Command Center.

    When it is executed, nothing or the entire statement is selected.

    Thanks,

  5. #5
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513
    Quote Originally Posted by hiolgc
    Hi Jonathan,

    I guess that's the problem. But where can I set "Statement termination character"? My DB2 is 7.2.9. I don't see any message about "Statement termination character" at the bottom of the Command Center.

    When it is executed, nothing or the entire statement is selected.

    Thanks,
    Unfortunately I don't have v7 on my machine, and in v8 it's right on the Command Center screen at the bottom. Maybe someone else here with v7 can point you in the right direction.
    --
    Jonathan Petruk
    DB2 Database Consultant

  6. #6
    Join Date
    Nov 2004
    Posts
    374

    command center

    tools options : will by default indicate no terminator
    in V8 the default is ;
    this can be done from any gui tool (tools - options)
    Best Regards, Guy Przytula

  7. #7
    Join Date
    Nov 2004
    Posts
    374

    command terminator

    or put all in a regular file with your editor and from command window
    db2 -tvf filename --> if terminator ;
    otherwise
    db2 -td@ -vf filename --> if terminator @ or any character at choice
    Best Regards, Guy Przytula

  8. #8
    Join Date
    Mar 2004
    Posts
    61
    Hi guys,

    From Command window, can you get "Access Plan"?
    So I need to know how to set the terminator of SQL with V7.2.9 with Command Center. Could anybody tell?

    Thanks,

  9. #9
    Join Date
    Sep 2004
    Posts
    3
    Hi,

    you can set the "Statement termination character" when you go to the menu of the command center. Under "Tools" / "Tools Preferences" you can find the "Statement termination character" on the first page.

    Best Regards, Toni

  10. #10
    Join Date
    Mar 2004
    Posts
    61
    Yes,it is.

    Thanks all!
    Last edited by hiolgc; 11-10-04 at 10:29.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •