Author |
Message
|
veera_clr |
Posted: Tue Oct 27, 2009 4:40 am Post subject: Insert original BLOB into db2 |
|
|
Novice
Joined: 12 Oct 2009 Posts: 17
|
Hi,
I am trying to insert the blob message into data base(DB2). That is storing as
COM.ibm.db2.jdbc.app.DB2Blob@6676736e.
Could any one of you please suggest? How can i store the incoming original BLOB message into database.
Thanks,
Veera |
|
Back to top |
|
 |
MQEnthu |
Posted: Tue Oct 27, 2009 4:46 am Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
How you are doing it in your flow? Post the code.. _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
flahunter |
Posted: Tue Oct 27, 2009 6:58 pm Post subject: Re: Insert original BLOB into db2 |
|
|
 Acolyte
Joined: 30 Oct 2008 Posts: 62
|
veera_clr wrote: |
Hi,
I am trying to insert the blob message into data base(DB2). That is storing as
COM.ibm.db2.jdbc.app.DB2Blob@6676736e.
Could any one of you please suggest? How can i store the incoming original BLOB message into database.
Thanks,
Veera |
As I know, DB2 also has BLOB datatype, you can insert your BLOB message directly. |
|
Back to top |
|
 |
veera_clr |
Posted: Tue Oct 27, 2009 8:31 pm Post subject: |
|
|
Novice
Joined: 12 Oct 2009 Posts: 17
|
Hi Thanks for your valueble reply,
I am using BLOB datata type only in table.
This is the code:
DECLARE Source CHARACTER 'VEERADB';
DECLARE Schem CHARACTER 'DB2ADMIN';
DECLARE Table CHARACTER 'CWS_STORE';
INSERT INTO Database.{Table} (MESSAGE,STATUS,TIMESTAMP) VALUES (InputRoot.BLOB.BLOB,'new',CURRENT_TIMESTAMP);
Please reply back with valueble suggestions,
Thanks,
Veera |
|
Back to top |
|
 |
flahunter |
Posted: Tue Oct 27, 2009 9:35 pm Post subject: |
|
|
 Acolyte
Joined: 30 Oct 2008 Posts: 62
|
veera_clr wrote: |
Hi Thanks for your valueble reply,
I am using BLOB datata type only in table.
This is the code:
DECLARE Source CHARACTER 'VEERADB';
DECLARE Schem CHARACTER 'DB2ADMIN';
DECLARE Table CHARACTER 'CWS_STORE';
INSERT INTO Database.{Table} (MESSAGE,STATUS,TIMESTAMP) VALUES (InputRoot.BLOB.BLOB,'new',CURRENT_TIMESTAMP);
Please reply back with valueble suggestions,
Thanks,
Veera |
Have you tried this? What happened? |
|
Back to top |
|
 |
veera_clr |
Posted: Tue Oct 27, 2009 9:43 pm Post subject: |
|
|
Novice
Joined: 12 Oct 2009 Posts: 17
|
Hi,
INSERT INTO Database.{Table} (MESSAGE,STATUS,TIMESTAMP) VALUES (InputRoot.BLOB.BLOB,'new',CURRENT_TIMESTAMP);
MESSAGE is storing in database like this instead of storing BLOB:
COM.ibm.db2.jdbc.app.DB2Blob@176ef36b
thanks,
Veera |
|
Back to top |
|
 |
flahunter |
Posted: Tue Oct 27, 2009 9:56 pm Post subject: |
|
|
 Acolyte
Joined: 30 Oct 2008 Posts: 62
|
veera_clr wrote: |
Hi,
INSERT INTO Database.{Table} (MESSAGE,STATUS,TIMESTAMP) VALUES (InputRoot.BLOB.BLOB,'new',CURRENT_TIMESTAMP);
MESSAGE is storing in database like this instead of storing BLOB:
COM.ibm.db2.jdbc.app.DB2Blob@176ef36b
thanks,
Veera |
Look for the infocenter
If the database column into which you want to insert data is set to a binary data type such as BLOB, the input message must be represented in bitstream form. If the input message is in the BLOB domain, use the following ESQL code:
DECLARE msgBitStream BLOB InputRoot.BLOB.BLOB;
INSERT INTO Database.TABLE1(MSGDATA) VALUES (msgBitStream);
I think you can use msgBitStream function to transform |
|
Back to top |
|
 |
veera_clr |
Posted: Tue Oct 27, 2009 10:11 pm Post subject: |
|
|
Novice
Joined: 12 Oct 2009 Posts: 17
|
Hi,
I tried with that as well as with bitstream. But its not worked out. same result.
DECLARE msgBitStream BLOB InputRoot.BLOB.BLOB;
INSERT INTO Database.{Table} (MESSAGE,STATUS,TIMESTAMP) VALUES (msgBitStream,'new',CURRENT_TIMESTAMP);
And also used ASBITSTREAM function. That field is giving.
COM.ibm.db2.jdbc.app.DB2Blob@1130b375
Thanks,
Veera |
|
Back to top |
|
 |
MQEnthu |
Posted: Tue Oct 27, 2009 10:23 pm Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
Try using the PASSTHRU for inserting into the table.. _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
veera_clr |
Posted: Tue Oct 27, 2009 10:56 pm Post subject: |
|
|
Novice
Joined: 12 Oct 2009 Posts: 17
|
Hi,
yes i got it. I tried to read that message COM.ibm.db2.jdbc.app.DB2Blob@1130b375 from data base with compute node. Its getting BLOB message.
Thanks alot
Veera |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Oct 27, 2009 10:58 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Where I have done this using DB2 I had to
1) Create a LONG Tablespace. This is designed for BLOB data
2) Create a table with fields capable of storing BLOBS
WMS_MESSAGE BLOB(160000), WMQ_MQMD BLOB(1024) etc
3) Insert the data appropriately _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
abhyyy |
Posted: Sun Nov 27, 2011 4:59 am Post subject: |
|
|
Voyager
Joined: 29 Sep 2011 Posts: 83
|
Hi Friends,
I am facing the same problem so after reading the topic I tried to read the inserted recored from the database using below in esql. Am I doing something silly here?
SET SHAREDTEST = SELECT T.SUBMITMESSAGE FROM Database.INTERNALSUBMITTABLE AS T ;
Info:
SHAREDTEST is of type BLOB
SUBMITMESSAGE column in table is of type BLOB (1M)
This table holds only one record at a time and only one column .
Problem : While deploying the code i am getting error as below due to this line:
BIP4001E: Syntax error in SQL statements in node 'MAIN_FLOW_SUBMIT_SMS_TO_SMSGW.PREPARE_SMS'.
The configuration failed due to errors in the SQL statement text. See the following messages for details of the error
The following error messages will give specific details of the location and nature of the error. Check and correct the syntax of the SQL statements and redeploy. _________________ ----------------------
NeVeR StOp LeaRnInG. |
|
Back to top |
|
 |
cvag |
Posted: Tue Nov 29, 2011 2:19 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Hi Veera,
You cannot view the content by looking at the database column. It looks like Com.ibm. .. like that..
Can you please import the db column into a file and see the content. Is it Com.ibm... or Your BLOB content. |
|
Back to top |
|
 |
|