Author |
Message
|
scravr |
Posted: Tue Nov 04, 2008 8:55 am Post subject: broker 6.1: select from oracle 8.1 |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
WMB 6.1:
I have (in compute node) this select into oracle 8.1:
SET Environment.Variables.IntegData[] =
SELECT A.KEY, A.TYPE, A.ID, .......
FROM Database.WMB.DATA AS A
WHERE A.KEY = key
it works fine.
But when adding this order by:
ORDER BY A.UPDATE_TS DESC
I get this RED X (on the left): Syntax error. Valid options include: = <= >= || ......
Any ideas?
Does 6.1 support "ORDER BY" ?
It works OK when I run it directly on oracl.
It also works OK when creating SQL statement on toolkit.
How can I take the SQL statement and put it in the compute node?
Thanks,
Moshe |
|
Back to top |
|
 |
Gaya3 |
Posted: Tue Nov 04, 2008 8:27 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
use PASSTHRU for executing this type of complex SQL queries _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
scravr |
Posted: Wed Nov 05, 2008 5:17 am Post subject: |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
I did try it. Same error RED X.
Manual says: ORDER BY is not supported !!! |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Nov 05, 2008 6:10 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There's a difference between ESQL Select statement and SQL Select statement.
There's also a difference between ESQL Select statement and ESQL Passthru statement. If you coded the ESQL Passthru statement correctly, it would not show a red X for "ORDER BY".
Unless you didn't rebuild the project after changing the ESQL. |
|
Back to top |
|
 |
Gaya3 |
Posted: Wed Nov 05, 2008 7:36 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
post the query over here...let us see how you did it by using PASSTHRU _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
scravr |
Posted: Mon Nov 10, 2008 5:35 am Post subject: broker 6.1: select from oracle 8.1 |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
SET Environment.Variables.IntegData[] =
PASSTHRU (’SELECT T.GET_TS FROM WMB.WMBDATA AS T
WHERE T.WMB_MSG = ?
ORDER BY T.GET_TS DESC'
TO Database.WMB VALUES (’ ’));
must be some syntax error. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Nov 10, 2008 5:51 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There is a difference between ESQL Select and SQL Select.
Passthru does not support ESQL Select. |
|
Back to top |
|
 |
scravr |
Posted: Mon Nov 10, 2008 6:08 am Post subject: broker 6.1: select from oracle 8.1 |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
Are you sure?
see the "PASSTHRU function" in books ! |
|
Back to top |
|
 |
sridhsri |
Posted: Mon Nov 10, 2008 6:29 am Post subject: |
|
|
Master
Joined: 19 Jun 2008 Posts: 297
|
The reason you are seeing the error is because of:
TO Database.WMB VALUES (’ ’)
You closed the single quote before. That caused a syntax error. You must have a single string.) |
|
Back to top |
|
 |
scravr |
Posted: Mon Nov 10, 2008 6:49 am Post subject: broker 6.1: select from oracle 8.1 |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
nonsence !!
please do not reply unless you have experience and/or try it before and can provide samples. |
|
Back to top |
|
 |
Gaya3 |
Posted: Mon Nov 10, 2008 8:15 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
Try out this ( I haven't tested)
SET Environment.Variables.IntegData[] = PASSTHRU('SELECT GET_TS FROM WMBDATA WHERE WMB_MSG = ? ORDER BY GET_TS DESC', '10' )
I presume the values, and i hope this will work for you
Find time to go through this too.
http://www.mqseries.net/phpBB2/viewtopic.php?t=12593&highlight=passthru+order _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
scravr |
Posted: Wed Nov 12, 2008 9:18 am Post subject: broker 6.1: select from oracle 8.1 |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
Thanks; your like was very helpfull.
How do I check SQL return code/status/state.... after PASSTHRU ?
Does PASSTHRU return/updates these values? |
|
Back to top |
|
 |
Gaya3 |
Posted: Wed Nov 12, 2008 7:29 pm Post subject: Re: broker 6.1: select from oracle 8.1 |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
scravr wrote: |
How do I check SQL return code/status/state.... after PASSTHRU ?
Does PASSTHRU return/updates these values? |
I don't think so, and i am not sure. Lets see experts advice on this _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
scravr |
Posted: Thu Nov 13, 2008 5:34 am Post subject: broker 6.1: select from oracle 8.1 |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
PASSTHRU updates the SQL code/status.... |
|
Back to top |
|
 |
|