|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
datetime insert into Oracle |
« View previous topic :: View next topic » |
Author |
Message
|
contactop |
Posted: Mon Aug 30, 2004 2:17 pm Post subject: datetime insert into Oracle |
|
|
Acolyte
Joined: 26 Jun 2003 Posts: 50
|
I am inserting date into oracle inclusive of time through ESQL, i have written the insert stmt as -
T1- table name
c1 - column 1 datatype Varchar2(4)
c2 - column 2 of datatype Date
Insert into t1 (c1,c2) values ('A1','20-Aug-2004 11:23:21') in the compute node.
But this gives an error, as i haven't used the To_date function, and esql doesnot accept the to_date function of oracle. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Aug 30, 2004 2:52 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You might want to CAST your CHARACTER string AS a TIMESTAMP. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
paustin_ours |
Posted: Mon Aug 30, 2004 3:39 pm Post subject: |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
Try this,
PASSTHRU('INSERT into T1(c1,c2) VALUES (?,to_date(?,''format''))',
A1,corresponding format value);
DO NOT FORGET TWO SINGLE QUOTES for the format, This worked for me, just make sure you give the correct format whatever be it and the value following it. Format can be anything MMDDYYYY HH:mm:ss anything...the to_date converts it to the Oracle format. |
|
Back to top |
|
 |
contactop |
Posted: Tue Aug 31, 2004 5:57 am Post subject: Thanks |
|
|
Acolyte
Joined: 26 Jun 2003 Posts: 50
|
Chaning it to TIMESTAMP worked.
does PASSTHRU effect performance? |
|
Back to top |
|
 |
kirani |
Posted: Tue Aug 31, 2004 10:34 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
I guess the performance overhead is minimum. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
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
|
|
|
|