ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SELECT FROM INSERT with DB2 version 8

Post new topic  Reply to topic
 SELECT FROM INSERT with DB2 version 8 « View previous topic :: View next topic » 
Author Message
EnOne
PostPosted: Thu Apr 10, 2008 12:49 pm    Post subject: SELECT FROM INSERT with DB2 version 8 Reply with quote

Centurion

Joined: 09 Oct 2002
Posts: 100
Location: Kansas City

There is new Functionality within DB2 v8 that allows you to do a select with an insert. I am trying to get it to work using PASSTHRU with no luck.

Code:
SELECT TABLE_ID FROM INSERT INTO Database.GBL.MYTABLE(ROW1, ROW2, ROW3) VALUES ( 456, 56, 6 );


where the table before the insert would be

MYTABLE
TABLE_ID ROW1 ROW2 ROW3
1 123 23 3
2 234 34 4
3 345 45 5


the value returned should be that TABLE_ID is 4 since the first row automatically increments.

i read about this functionality from the "What's New?"
http://publib.boulder.ibm.com/epubs/pdf/dsnwnj11.pdf

I do not get any warning or error from my SQL statement
Back to top
View user's profile Send private message
EddieA
PostPosted: Thu Apr 10, 2008 4:14 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Please post the actual ESQL statement used.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
EnOne
PostPosted: Fri Apr 11, 2008 4:58 am    Post subject: Reply with quote

Centurion

Joined: 09 Oct 2002
Posts: 100
Location: Kansas City

the actual SQL statement has 20 or more columns in it so I simplified for clarity.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Apr 11, 2008 5:00 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

EnOne wrote:
the actual SQL statement has 20 or more columns in it so I simplified for clarity.


Please note that he said ESQL statement.

Also, please explain what you EXPECT to be happening, that isn't, that is causing you to say "it doesn't work".
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
EnOne
PostPosted: Fri Apr 11, 2008 6:03 am    Post subject: Reply with quote

Centurion

Joined: 09 Oct 2002
Posts: 100
Location: Kansas City

the ESQL would look like the following

Code:

DECLARE SQLStmt CHAR;

SET SQLStmt = 'SELECT TABLE_ID FROM INSERT INTO Database.GBL.MYTABLE(ROW1, ROW2, ROW3) VALUES ( 456, 56, 6 )';

SET Environment.XML.MYTABLE[] = PASSTHRU (SQLStmt);



what I would expect as a result would be

Code:
Environment.XML.MYTABLE.TABLE_ID = 4


from
Code:

TABLE_ID ROW1 ROW2 ROW3
1        123  23   3
2        234  34   4
3        345  45   5


the response is

Code:
Environment.XML.MYTABLE =
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Apr 11, 2008 6:05 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

What happens when you run the statement in plain DB2 - I mean outside of Broker?

What does the db2 log show when you execute your flow?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SELECT FROM INSERT with DB2 version 8
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.