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 » DB2 insert problem

Post new topic  Reply to topic
 DB2 insert problem « View previous topic :: View next topic » 
Author Message
Bravo
PostPosted: Tue Nov 14, 2006 9:16 am    Post subject: DB2 insert problem Reply with quote

Centurion

Joined: 03 Oct 2005
Posts: 146

Hi All,

I'm trying to insert OutputRoot.XML in a table which is coming from flat file. I'm reading the flat file using Fileinput node.

Here is my code..

Code:
SET charGENRC_DATA_CHAR  = CAST(ASBITSTREAM(OutputRoot.XML,437) as CHAR CCSID 437);

and even tried

Code:
SET blobMsgData = BITSTREAM(OutputRoot.XML);
SET charGENRC_DATA_CHAR = CAST(blobMsgData AS CHARACTER CCSID 437);


SQL query

Code:
PASSTHRU('INSERT INTO Table(GENRC_DATA_CHAR)VALUES?)',charGENRC_DATA_CHAR);


DB2 insert was successful but GENRC_DATA_CHAR column is empty.

Any suggestion.
_________________
Bravo
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 14, 2006 9:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Your passthru is either typed wrong or actually wrong.

"INSERT INTO Table(GENR_DATA_CHAR) VALUES(?)".

Also, BITSTREAM is deprecated, so please don't use it.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Edde
PostPosted: Tue Nov 14, 2006 9:53 am    Post subject: Re: DB2 insert problem Reply with quote

Acolyte

Joined: 01 Oct 2006
Posts: 67
Location: Moscow, Russia

Try to see in debugger what you have in charGENRC_DATA_CHAR after SET statement.

My assumption is that your code doesn't work as you think
Code:
SET charGENRC_DATA_CHAR  = CAST(ASBITSTREAM(OutputRoot.XML,437) as CHAR CCSID 437);


ASBITSTREAM(OutputRoot.XML,437)
is equal to
ASBITSTREAM(OutputRoot.XML Encoding 437)

You should use ASBITSTREAM(OutputRoot.XML,,437) or explicit form
ASBITSTREAM(OutputRoot.XML CCSID 437).
Back to top
View user's profile Send private message
Bravo
PostPosted: Tue Nov 14, 2006 12:06 pm    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2005
Posts: 146

Thanks Jeff and Edde for quick response

PASSTHRU is correct.

Code:
PASSTHRU('INSERT INTO Table(GENRC_DATA_CHAR)VALUES(?)',charGENRC_DATA_CHAR);


just missed one bracket..

I am not getting the problem when I tried to insert as a string to the GENRC_DATA_CHAR column

12346ABCDE11.21

but I tried to insert OutputRoot.XML..the column is empty

FYI : GENRC_DATA_CHAR is define as VARCHAR(3000)

Edde,

I tried no luck..
_________________
Bravo
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 14, 2006 12:09 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Do you see data populated in charGENRC_DATA_CHAR in the debugger or a trace of some kind?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Bravo
PostPosted: Tue Nov 14, 2006 1:47 pm    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2005
Posts: 146

Yes Jeff..I can see the data in charGENRC_DATA_CHAR.
_________________
Bravo
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 » DB2 insert problem
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.