Discussion

Please Check Anything Wrong in the Query

{SQLPage:SQLErrors} SELECT C.pzInsKey as ".pzInsKey" ,RAND() as RID FROM PC_WRK C LEFT JOIN PC_ASSIGN_WORKBASKET WBKT ON C.pzInsKey=WBKT.pxRefObjectKey where WBKT.PXASSIGNEDOPERATORID='PENDING'
AND C.CASETYPE= {.Type} AND WBKT.PXCREATEOPNAME= {.Name} ORDER BY RID FETCH FIRST ".SampleNos" ROWS ONLY

I tried with ".SampleNos", {.SampleNos}, "+.SampleNos+ "
All are getting below error

The problem here RID is not recognizing it is giving an error saying that
There was a problem getting a list: code: -104 SQLState: 42601 Message: An unexpected token "?" was found following "Y RID FETCH FIRST". Expected tokens may include: "".. SQLCODE=-104, SQLSTATE=42601, DRIVER=3.53.70
---------------------------------------------
Note****

But I used {ASIS:Page:SelectClause} instead of above ORDER BY RID FETCH FIRST ".SampleNos" ROWS ONLY

SelectClause=ORDER BY RID FETCH FIRST "+.SampleNos+" ROWS ONLY
it worked but not giving desired result
--------------------------------------------
Please let me know valuable suggestion/thought.
Advance Thanks for you valuable suggestion
Regards

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

January 6, 2011 - 10:41am

Check the data type of .SampleNos property. It has to be an integer. Try to save .Type, .Name and .SampleNos into a seperate clipboard page and use them in your query as C.CASETYPE ={Page.Type}, WBKT.PXCREATEOPNAME={Page.Name} and FETCH FIRST {Page.SampleNos} ROWS ONLY.

January 6, 2011 - 1:04pm

Thanks for you update
But the problem saving into another page,
I am using this Query in RDB-List which gets called another pagelist looping
Meaning I am using another PageList ForEach Embedded Page looking where am calling RDB-List [Where this query gets called]
so saving into another page makes complicate not only my for each embedded page looping again another page looping has to synchronize. only my believe is there is not number after Fetch is giving problem.

FETCH FIRST "+.SampleNos+" , the SampleNos is giving problem , basically I declare the property as integer, if you tell me the above syntax correct or not in the below selectclause
SelectClause=ORDER BY RID FETCH FIRST "+.SampleNos+" ROWS ONLY this has been used as {ASIS:PAGE:SelectClause}
All the other way written query with out ASIS got an error
Advance Thanks, appreciated

January 6, 2011 - 1:10pm

Could you be more clear on what you are trying to achieve with the query with an example. I am kinda confused.

January 6, 2011 - 3:04pm

I tried and I got the same error. It appears DB2 doesn't like a parameter to be used with FETCH. Instead, why don't you use MaxRecords parameter for your RDB-List method where you can put .SampleNos under value for that parameter? Hope this helps.

Pega
March 24, 2014 - 7:08am

{As:Is :Page.property}

Pega
March 24, 2014 - 7:08am

{AsIs :Page.property}