|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Sample problem |
« View previous topic :: View next topic » |
Author |
Message
|
rameshmetta |
Posted: Wed Oct 03, 2012 5:12 am Post subject: Sample problem |
|
|
Newbie
Joined: 03 Oct 2012 Posts: 2
|
Hi Experts,
I'm a newbie and practicing myself by trying the samples.
I'm able to connect and retrieve the data from DB in this sample.
But looks like there is some issue with below statement :
If XMLFLIGHTTB has columns A, B, C respectively - then if i want my Environment variable should contain as below :
Environment.Variables.A
Environment.Variables.B
Environment.Variables.C
then will the below statement works ?
or do i need to use like this : "SET Environment.Variables.TableInfo[] =" !!
if i have to change the below statement, i need to change complete code which i'm ready to do but want to confirm if i'm missing anything here..!!!
-- populate the environment with flight info from the database
SET Environment.Variables =
THE (SELECT T.* FROM Database.XMLFLIGHTTB AS T
WHERE T.FLIGHTDATE = Root.XMLNSC.Reservation.FlightDetails.FlightDate
AND T.FLIGHTNO = Root.XMLNSC.Reservation.FlightDetails.FlightNumber);
Request to help.
Thank YOu.
Ramesh
Last edited by rameshmetta on Wed Oct 03, 2012 5:20 am; edited 1 time in total |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Oct 03, 2012 5:17 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
Vitor |
Posted: Wed Oct 03, 2012 5:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rameshmetta wrote: |
then will the below statement works ?
"SET Environment.Variables.TableInfo[] =" !! |
a) Try it - that's the point of the sample
b) No - because that statement references something called TableInfo & doesn't reference A, B or C
rameshmetta wrote: |
or do i need to use like this :
-- populate the environment with flight info from the database
SET Environment.Variables =
THE (SELECT T.* FROM Database.XMLFLIGHTTB AS T
WHERE T.FLIGHTDATE = Root.XMLNSC.Reservation.FlightDetails.FlightDate
AND T.FLIGHTNO = Root.XMLNSC.Reservation.FlightDetails.FlightNumber); |
See a) above.
It's better, but still doesn't reference A,B or C. Also * in a select is as bad here as it is in any SQL against a database. Sooner or later someone will add or remove a column. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rameshmetta |
Posted: Wed Oct 03, 2012 5:29 am Post subject: |
|
|
Newbie
Joined: 03 Oct 2012 Posts: 2
|
@lancelotlinc - noted with thanks. will not be repeated again.
@Vitor - thank you for the reply sir.That was helpful. |
|
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
|
|
|
|