Author |
Message
|
nickkirk |
Posted: Wed Mar 05, 2014 3:01 am Post subject: Calling Oracle - vaiables not passed through |
|
|
Apprentice
Joined: 26 Sep 2008 Posts: 48
|
I'm calling an Oracle db from WMB v7, running on Solaris.
WMB effective level '7.0.0.1'.
1)
DECLARE productdefid2 CHARACTER 'EMAIL';
DECLARE mqMsgRef2 CHARACTER '140304164501000263';
SET Environment.additionalFields[] =
SELECT T.mq_msg_id
FROM Database.fax_monitor AS T
WHERE T.sys_ref_typ = productdefid2
AND T.mq_msg_id = mqMsgRef2;
Trace File shows:
"SELECT T.mq_msg_id FROM fax_monitor T WHERE ((T.sys_ref_typ)=(?))AND((T.mq_msg_id)=(?))"
and Environment.additionalFields is NOT populated
2)
SET Environment.additionalFieldsTest[] =
SELECT T.mq_msg_id
FROM Database.fax_monitor AS T
WHERE T.sys_ref_typ = 'EMAIL'
AND T.mq_msg_id = '140304164501000263';
Trace File shows:
"SELECT T.mq_msg_id FROM fax_monitor T WHERE ((T.sys_ref_typ)=('EMAIL'))AND((T.mq_msg_id)=('140304164501000263'))"
and Environment.additionalFieldsTest gets populated as expected
Why aren't the variables being passed through ?
Please help. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 05, 2014 5:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looks like in one case you are getting a prepared statement, in the other you are getting a litteral statement... Does this answer your question?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
nickkirk |
Posted: Wed Mar 05, 2014 7:57 am Post subject: |
|
|
Apprentice
Joined: 26 Sep 2008 Posts: 48
|
fjb_saper wrote: |
Looks like in one case you are getting a prepared statement, in the other you are getting a litteral statement... Does this answer your question?  |
No it doesn't.
Do you know why 1) would not work ? |
|
Back to top |
|
 |
Tibor |
Posted: Thu Mar 06, 2014 4:34 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
In this case I would switch the ODBC tracing on. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Mar 06, 2014 6:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you tried writing your select statement like:
Code: |
where field1 = :variable1 and field2 = :variable2 |
The colon before the variable name might be important... I'm looking at the way the prepared statement was done and the trace did not show variables beeing provided .... Although this syntax might be more suited to a passthru query I would still try it and see if it makes a difference...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|