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 » CAST ( Root.MQMD.MsgId AS CHARACTER )

Post new topic  Reply to topic
 CAST ( Root.MQMD.MsgId AS CHARACTER ) « View previous topic :: View next topic » 
Author Message
newguy
PostPosted: Tue Nov 14, 2006 5:21 am    Post subject: CAST ( Root.MQMD.MsgId AS CHARACTER ) Reply with quote

Novice

Joined: 22 Mar 2006
Posts: 13
Location: Bangalore

Hi All,

Im facing a problem while casting MsgId to Character and inserting into table..

The problem is while inserting to table in my database node...

it is inserting as below

'X'414d51206d7962726b5f716d312020201a1a58452000205d''

Which is invalid DB2 operation...

any suggestions are appreciated

Thanks in advance...[/code][/quote]
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Nov 14, 2006 5:26 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

MsgId is NOT a string - it's a 24 byte array. You can't treat it as a string without pain & misery.

Do a search on the forum - you are by no means the first to fall foul of this!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 14, 2006 5:41 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I don't see why that would be an invalid DB2 operation, unless your field is too small to hold the data.

Otherwise, your "problem" is that you didn't specify a CCSID on the CAST statement.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
newguy
PostPosted: Tue Nov 14, 2006 5:48 am    Post subject: Reply with quote

Novice

Joined: 22 Mar 2006
Posts: 13
Location: Bangalore

db2 => insert into TBEAM_RLS_POST(REF_NO) values ('n'1232'')
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "1232" was found following "(REF_NO) values
('n'". Expected tokens may include: ",". SQLSTATE=42601


this is something similar to db2 error which I have posted previously...
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 14, 2006 5:51 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

That's a quoting problem.

What you are getting back, the form X'aaaaa', is the proper string representation of a BLOB field.

If you want 48 characters, you can do simple string manipulation to extract the data from the proper string representation.

If you want 24 bytes, you can pass a CCSID to the CAST.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
newguy
PostPosted: Tue Nov 14, 2006 6:05 am    Post subject: Reply with quote

Novice

Joined: 22 Mar 2006
Posts: 13
Location: Bangalore

Yes that I can do it with substring or something else and insert into a table...

But Is there any way I can have the whole string like

X'aaa' entry in the MSGID Column in a table.
Back to top
View user's profile Send private message
newguy
PostPosted: Tue Nov 14, 2006 6:32 am    Post subject: Reply with quote

Novice

Joined: 22 Mar 2006
Posts: 13
Location: Bangalore

Iam so sorry people... I had a problem with my table schema...


Sorry once again...
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 » CAST ( Root.MQMD.MsgId AS CHARACTER )
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.