Author |
Message
|
ishaq |
Posted: Mon Mar 03, 2008 4:29 am Post subject: Unexpected output while using PASSTHRU |
|
|
Novice
Joined: 18 Feb 2008 Posts: 11
|
Hi,
Iam using WMB 6.0 on Windows XP.Below is my issue:
Iam having the flow consisting of input,output and Javacompute node.
I am trying to retrieve the data from database corresponding to the input.
database table name is vicnum2text and it has 2 columns named as number_integer and number_text
My input is as follows
<numbers><num>one</num></numbers>
The code which Iam using to retrieve the data from database is:
MbSQLStatement state = createSQLStatement( "Test", "SET OutputRoot.XML.numbers.res = PASSTHRU ('SELECT number_integer FROM " + table + " WHERE number_text = ?',OutputRoot.XML.numbers.num);") ;
Iam getting the output along with column name as shown below:
<numbers><num>one</num><res><NUMBER_INTEGER>1</NUMBER_INTEGER></res></numbers>
Iam expecting the output without the column name.
Please help me out in this regard |
|
Back to top |
|
 |
gregop |
Posted: Mon Mar 03, 2008 5:23 am Post subject: |
|
|
Voyager
Joined: 24 Nov 2006 Posts: 81
|
That is the expected behaviour on a PASTHRU select.
If you want to lose the column name you'll need to use the selectclause ITEM and not use PASSTHRU.
Something like: SELECT ITEM number_integer from Database.vicnum2text |
|
Back to top |
|
 |
ishaq |
Posted: Mon Mar 03, 2008 10:22 pm Post subject: |
|
|
Novice
Joined: 18 Feb 2008 Posts: 11
|
Thanks a lot..Its working fine
I do have a doubt regarding setting Environment variables.
My requirement is that after retrieving the data from the database I need to set that value in Evironment variables and lateron use that variable and manipulate it and add it to the output message.
While setting the value I can directly use SET Environment.variables.... in the createSQLStatement.
How do I retrieve the value lateron to manipulate it in the java code
Please help me out in this regard |
|
Back to top |
|
 |
AkankshA |
Posted: Mon Mar 03, 2008 10:28 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
you can access the environment tree (referred as global environment) inside a java comute node _________________ Cheers |
|
Back to top |
|
 |
ishaq |
Posted: Tue Mar 04, 2008 12:54 am Post subject: |
|
|
Novice
Joined: 18 Feb 2008 Posts: 11
|
can you please explain it? |
|
Back to top |
|
 |
AkankshA |
Posted: Tue Mar 04, 2008 12:58 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
|
Back to top |
|
 |
ishaq |
Posted: Tue Mar 04, 2008 1:43 am Post subject: |
|
|
Novice
Joined: 18 Feb 2008 Posts: 11
|
Thanks a lot....Its working fine now |
|
Back to top |
|
 |
|