|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
To select first N number of records?? |
« View previous topic :: View next topic » |
Author |
Message
|
anoobrocks |
Posted: Sun Oct 03, 2010 2:46 am Post subject: To select first N number of records?? |
|
|
Newbie
Joined: 28 Sep 2010 Posts: 8
|
Hi,
I am using MB6.0 and wanted to select first N number of records from the table based on the value in the UDP (GroupCount).
SET Environment.Variables.output[] = SELECT R.* FROM Database.GROUP AS R WHERE rownum <= GroupCount;
But i'm getting an error -
BIP2432E: The correlation name 'rownum' is not valid.
 |
|
Back to top |
|
 |
mqjeff |
Posted: Sun Oct 03, 2010 3:42 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
ESQL select doesn't know about any database specific functions for managing rows.
So if 'rownum' is not a column in your table, then you need to use PASSTHROUGH.
ESQL select is NOT the same thing as SQL Select. Every field in an ESQL select *MUST* start with the correlation ID you create with the AS clause. So if rownum *is* a column in your table, you must *always* identify it as "R.rownum" in an ESQL select if you have said "AS R". |
|
Back to top |
|
 |
mqjeff |
Posted: Sun Oct 03, 2010 3:42 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
And message broker 6 goes out of support in less than a year. You should not be learning on it nor using it to develop new message flow applications. |
|
Back to top |
|
 |
anoobrocks |
Posted: Sun Oct 03, 2010 3:56 am Post subject: |
|
|
Newbie
Joined: 28 Sep 2010 Posts: 8
|
Thank jeff,
And in my case Rownum is not a column here.. since i need first N records from the table, i tried giving ROWNUM.. guess it doesnt support in ESQL..
As i mentioned before, all i need is to select the no of records from table based on the UDP value. I cant use any column name here as the values in it are same sometime/repeating values..  |
|
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
|
|
|
|