|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Selecting TIMESTAMP Column from Oracle |
« View previous topic :: View next topic » |
Author |
Message
|
mquser1 |
Posted: Tue Feb 01, 2005 5:31 pm Post subject: Selecting TIMESTAMP Column from Oracle |
|
|
Novice
Joined: 03 Jun 2004 Posts: 23
|
Hi all,
We have a requirement where we are supposed to insert each message, along with the current timestamp into an Oracle table. Our first message flow essentially does the insertion. We have a second message flow that is supposed to select all the messages that are younger than a particular timestamp, for further processing.
All this was working fine if we used a db2 table.
Msgflow1 does:
=============================
INSERT INTO Database.table1(orderNum, insertTime, rec010, rec050) VALUES
-- (OutputRef.DefaultToSTONumber, current_timestamp, Record10, Record50);
=============================
and Msgflow2 does
=============================
SET Environment.Variables.TMP.OrderNumArray[] = PASSTHRU('SELECT DISTINCT ordernum FROM table1 WHERE inserttime < ?', ctime);
=============================
However this does not work if we create the same table in Oracle.
Essentially it looks like Oracle timestamp object is different from that of the Broker. I started trying several things like converting the broker timestamp to orracle timestamp using the to_date function in oracle. With this I was able to do the insertion ok. However it bombs out when i try to select the rows from the table. It appears like Broker is unable to understand the oracle timestamp column. I keep getting an exception that says:
----------------------------------
Database exception: Expected %s got %s
-----------------------------------
Has anyone run into this situation before? Any ideas on how to proceed further on this?
Thank you very much and warm regards. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Feb 02, 2005 4:42 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There's probably a more descriptive error message in your Oracle logs.
You might need to manually construct a string that has an Oracle friendly date / timestamp from the timestamp. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
mquser1 |
Posted: Wed Feb 02, 2005 9:24 am Post subject: |
|
|
Novice
Joined: 03 Jun 2004 Posts: 23
|
We did construct an oracle friendly string using its to_date function and thus were able to insert okay. However the problem comes when we try to select that timestamp column in the second flow. I keep getting the error that says
------------
DatabaseException: Expected %s got %s
------------
My feeling is that the broker is unable to understand oracle's timestamp object. How do I read the date from Oracle in a way that is broker friendly. |
|
Back to top |
|
 |
kirani |
Posted: Fri Feb 04, 2005 12:17 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Can you post your complete ExceptionList
Also, one of the ESQL manual explains datatype mapping between ESQL and Databases. _________________ 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 |
|
 |
chenulu |
Posted: Fri Feb 04, 2005 10:34 am Post subject: |
|
|
Voyager
Joined: 27 Mar 2002 Posts: 87 Location: Research Triangle Park, NC
|
Please post your WBI-MB/WMQI version / CSD level and Oracle versions. Also, can you please run the same from SQLPlus and see if you get the desired result. The reason I ask this is because with a PASSTHRU statement, the entire work is performed by the Database. |
|
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
|
|
|
|