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 > how to declare global temporary table in UDB8

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-01-04, 15:32
chunbo chunbo is offline
Registered User
 
Join Date: Aug 2003
Posts: 3
how to declare global temporary table in UDB8

I tested the following statement in UDB7.1 successfully, but failed at UDB8.0 at same OS(win2k).

String str_max ="declare global temporary table ttt2 like log_load_delivery_tbyd_tbl on commit preserve rows not logged with replace in tempok1";
Statement stmt_max = con.createStatement();
ResultSet rs_max = stmt_max.executeQuery(str_max);

The exception message is "[IBM][JDBC driver]CLI0637E query cannot be found"

Under UDB8's command prompt, the same SQL statement works well, but it failes when I invoke it from my java code.

Anyone could help me with this problem? Why the same statement works well in my old UDB7.1 but failed at udb8?

Thanks
Reply With Quote
  #2 (permalink)  
Old 03-01-04, 16:20
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Re: how to declare global temporary table in UDB8

Quote:
Originally posted by chunbo
I tested the following statement in UDB7.1 successfully, but failed at UDB8.0 at same OS(win2k).

String str_max ="declare global temporary table ttt2 like log_load_delivery_tbyd_tbl on commit preserve rows not logged with replace in tempok1";
Statement stmt_max = con.createStatement();
ResultSet rs_max = stmt_max.executeQuery(str_max);

The exception message is "[IBM][JDBC driver]CLI0637E query cannot be found"

Try using execute() or executeUpdate() instead of executeQuery(). This isn't a query, after all.
Reply With Quote
  #3 (permalink)  
Old 03-01-04, 17:04
chunbo chunbo is offline
Registered User
 
Join Date: Aug 2003
Posts: 3
Great answer. That resolves my problem. Thanks a bunch.
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