|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
lillo thanks - more questions |
« View previous topic :: View next topic » |
Author |
Message
|
amr |
Posted: Tue Oct 15, 2002 8:59 am Post subject: lillo thanks - more questions |
|
|
Newbie
Joined: 12 Oct 2002 Posts: 4
|
Hi Guys!!! thanks for ur help. i'm able to insert mutlipe records now but in hexadeciamal form. lillo your first code worked very well for me , but i have question . as i'm new working on BLOB msg. i'm trying to insert
INSERT INTO DETAIL_TB(DDATE, SEQ, SUBDCN, DETAIL1) VALUES(?, ?, ?, ?)' against datasource 'test' with parameters ''X'3230303231303039'', 'X'323232'', 'X'6161616161'', 'X'6262626262'',
getting following error:
DatabaseException BIP2322E: Database error: SQL State '22005'; Native Error Code '-99999'; Error Text '[IBM][CLI Driver] CLI0112E Error in assignment. SQLSTATE=22005'.
i guess because in my database by table is DDATE - Date; SEQ - INTEGER; SUBDCN - CHARACTER(5); DETAIL1 - CHARACTER(5); and so the table is unable to accept the hexadeciamal values. so i changed my table and defined all datatypes as character for now.
my question is can't we change hexadeciamal values to table specific datatypes before i do insert ie. ''X'3230303231303039'' to 20021009
'X'323232'' to 111
'X'6161616161'' to aaaaa
'X'6262626262'' to bbbbb
I need your help, please. |
|
Back to top |
|
 |
lillo |
Posted: Tue Oct 15, 2002 11:45 am Post subject: |
|
|
Master
Joined: 11 Sep 2001 Posts: 224
|
Hi amr,
Your problem is very easy to solve. You just have to convert from BLOB to CHAR, or whatever. To do this you have an ESQL function called CAST.
Now your code should look something similar to:
Code: |
SET DATE=CAST(SUBSTRING(....) AS CHAR);
|
You need to do the cast in all the variable we defined the other day.
You may need to add other parameter such as CCSID and ENCODING. You can see the function syntax on chapter 6 in the ESQL Reference.
Cheers, _________________ Lillo
IBM Certified Specialist - WebSphere MQ |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|