If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Why DB2 Command Center Cannot Execute SQL Statement?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-08-04, 10:44
hiolgc hiolgc is offline
Registered User
 
Join Date: Mar 2004
Posts: 61
Angry 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 09:23.
Reply With Quote
  #2 (permalink)  
Old 11-08-04, 12:19
J Petruk J Petruk is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 11-08-04, 12:21
J Petruk J Petruk is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 11-08-04, 17:33
hiolgc hiolgc is offline
Registered User
 
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,
Reply With Quote
  #5 (permalink)  
Old 11-09-04, 08:07
J Petruk J Petruk is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 11-09-04, 08:43
przytula przytula is offline
Registered User
 
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
Reply With Quote
  #7 (permalink)  
Old 11-09-04, 08:49
przytula przytula is offline
Registered User
 
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
Reply With Quote
  #8 (permalink)  
Old 11-09-04, 10:47
hiolgc hiolgc is offline
Registered User
 
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,
Reply With Quote
  #9 (permalink)  
Old 11-10-04, 07:07
NetToni99 NetToni99 is offline
Registered User
 
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
Reply With Quote
  #10 (permalink)  
Old 11-10-04, 09:22
hiolgc hiolgc is offline
Registered User
 
Join Date: Mar 2004
Posts: 61
Yes,it is.

Thanks all!

Last edited by hiolgc; 11-10-04 at 09:29.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On