-
using cursor with "WITH CLAUSE" in pro*c program
When i declare a cursor as follows along with 'with clause' ---
EXEC SQL DECLARE PUBS CURSOR FOR
WITH tmp AS (SELECT distinct pub.PUB_IDT IDT,edt.pub_mth
FROM PRMSELINCPUBT pub,prmeditiot edt
WHERE pub.PRM_IDT = 1306 and
pub.CHP_NUM = 1 and pub.pub_idt=edt.pub_idt
and edt.pub_mth is not null
order by edt.pub_mth asc)
SELECT distinct tmp.idt FROM tmp;
it results in error like
PCC-S-02201, Encountered the symbol "tmp" when expecting one of the following:
;
The same query when i run from DB side,it fetches the result.Please tell me how to resolve this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|