DB2_Connect Error

QuestionsDB2_Connect Error
Don Mangold asked 10 years ago

I am getting the following error. Looks like the SQL is not correct.

Couldn't execute query. Token RNUM was not valid. Valid tokens: FOR USE SKIP WAIT WITH FETCH ORDER UNION EXCEPT OPTIMIZE. SQLCODE=-104 – SELECT * FROM ( SELECT a.*,rownum rnum FROM (select * from CARDATAT.CSISPACEP WHERE 1=1) a ) WHERE rnum > 0 AND rnum <= 1

5 Answers
Abu Ghufran answered 10 years ago

I emailed you an updated build.
Kindly update.

Don Mangold answered 10 years ago

Looks like the LIMIT or OFFSET does not work on the version of DB2 we are using. Looking for an alternative now.

Thanks

Don Mangold answered 10 years ago

Modified the original jqgrid_dist.php to make the resulting query to get the fields to the following:
$sql = "SELECT b.* FROM (SELECT a.*,row_number() over() as rnum FROM ($query) a) b WHERE b.rnum > $offset_min AND b.rnum <= $offset_max";

– Now I am getting the grid with the correct fields as column headers but no data and an error dialog with no message. Any thoughts?

Abu Ghufran answered 10 years ago

Hello,

I'll be emailing you an update after rechecking.
Which version of db2 are you using?

I am trying to add this behavior using this article.
http://www.channeldb2.com/profiles/blogs/porting-limit-and-offset

Don Mangold answered 10 years ago

Found out why no data was showing. It was a Cross Domain AJX access attempt by the client. Once I aligned the web address – everything worked as expected….. Thanks 🙂

Your Answer

4 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?