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 » Inserting BLOB DATE value to Oracle Problem

Post new topic  Reply to topic
 Inserting BLOB DATE value to Oracle Problem « View previous topic :: View next topic » 
Author Message
biswagourab
PostPosted: Mon Jun 26, 2006 4:43 pm    Post subject: Inserting BLOB DATE value to Oracle Problem Reply with quote

Apprentice

Joined: 31 May 2005
Posts: 47
Location: London

Hi
I am trying to SUBSTRING the value '20060626' (date) from a BLOB data that I am picking up using FileInput Node and trying to insert it to Oracle DB having a date field

I am using

PASSTHRU('INSERT INTO GE.TBL_CUSTOMER(CUSTOMER_ID,EXTRACTED_DATE,CUSTOMER_FAX_NUMBER) VALUES(?,to_date(?),?)', SUBSTRING(InputRoot.BLOB.BLOB FROM 1 FOR 10),SUBSTRING(InputRoot.BLOB.BLOB FROM 11 FOR 8 ),SUBSTRING(InputRoot.BLOB.BLOB FROM 19 FOR 10) );

But it gives me the error that
"literal does not match format string"

when I try casting this blob to CHAR I get
"year must be between -4713 and +9999, and not be 0 ''

Please help.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
shalabh1976
PostPosted: Mon Jun 26, 2006 9:12 pm    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

Biswagourab,
When you do : SUBSTRING(InputRoot.BLOB.BLOB FROM 11 FOR 8 ) what is the value returned ?
A cast might be required.
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
biswagourab
PostPosted: Tue Jun 27, 2006 5:08 am    Post subject: Reply with quote

Apprentice

Joined: 31 May 2005
Posts: 47
Location: London

Hi Shalabh
I am pretty sure that the value that is returned is a hexadecimal value of the input date that I am sending.

e.g I am sending 20060613 then I get X'3230303630363133

I am trying to cast it to CHAR but Oracle still throws the error saying

"year must be between -4713 and +9999, and not be 0 ''

Regards
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
shalabh1976
PostPosted: Tue Jun 27, 2006 5:48 am    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

Can you post your PASSTHRU code with the CAST code inside ?
Please specify the CCSID parameter as well.
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
biswagourab
PostPosted: Tue Jun 27, 2006 6:01 am    Post subject: Reply with quote

Apprentice

Joined: 31 May 2005
Posts: 47
Location: London

Hi
The code I am using is...

PASSTHRU('INSERT INTO GE.TBL_CUSTOMER(CUSTOMER_ID,EXTRACTED_DATE,CUSTOMER_FAX_NUMBER) VALUES(?,to_date(?),?)', SUBSTRING(InputRoot.BLOB.BLOB FROM 1 FOR 10),CAST(SUBSTRING(InputRoot.BLOB.BLOB FROM 11 FOR 8 )as CHAR CCSID 37),SUBSTRING(InputRoot.BLOB.BLOB FROM 19 FOR 10) );

the input data contains the value 20060613 for the positions 11 for 8

Regards
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
shalabh1976
PostPosted: Wed Jun 28, 2006 11:23 pm    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

Try using the format in the to_date function :
for e.g.:
to_date('20020315', 'yyyymmdd');
If this works then replace the date with your code.
It may be that the Oracle date format wants the date in some different format hence you may need to explicitly specify the format.
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
biswagourab
PostPosted: Wed Jul 05, 2006 5:28 am    Post subject: Reply with quote

Apprentice

Joined: 31 May 2005
Posts: 47
Location: London

Hi Shalabh,
I have got the problem resolved, I used Encoding to resolve it. And the code that you have suggested.... I have tried it before, but the editor does not validate the format and throws an error at the 'YYYYDDMM' location.

dont know why it does so, but eventually I found a way round it by saying to_date('20060607') and not specifing the format.



cheers
Biswa
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Inserting BLOB DATE value to Oracle 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.