Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Cursor For Explain Plan

Re: Cursor For Explain Plan

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 09 Dec 2005 15:39:40 -0800
Message-ID: <1134171580.161306@jetspin.drizzle.com>


jkstill_at_gmail.com wrote:

> Buck Turgidson wrote:
> 

>>I am trying to generate an explain plan from within SAP using their
>>language called ABAP. The problem is that I can OPEN the cursor with no
>>problem but it is not populated unless I do something other than OPEN
>>it. If I use the FETCH command shown below, I get: "ORA-01009: missing
>>mandatory parameter"
>>
>>
>>Can someone tell me what the proper command to use is in place of the
>>FETCH?
>>
>>
>>EXEC SQL.
>> OPEN c1 FOR
>> EXPLAIN PLAN SET STATEMENT_ID = 'ZZ_ABAP'
>> FOR SELECT * FROM rsaabap where 1 = 2
>>ENDEXEC.
>>
>>
>>
>>DO.
>> EXEC SQL.
>> fetch next c1 into :wa
>> ENDEXEC.
>> IF sy-subrc <> 0.
>> EXIT.
>> ENDIF.
>>ENDDO.
>>
>>
>>
>>EXEC SQL.
>> CLOSE c1
>>ENDEXEC
> 
> 
> I'm no ABAP whiz, but it would seem reasonable that you may need to put
> all the code in a single EXEC SQL block.
> 
> Something like this perhaps:
> 
> EXEC SQL.
>   OPEN c1 FOR
>   EXPLAIN PLAN SET STATEMENT_ID = 'ZZ_ABAP'
>   FOR SELECT * FROM rsaabap where 1 = 2
> 
> DO.
>     fetch next c1 into :wa
>   IF sy-subrc <> 0.
>     EXIT.
>   ENDIF.
> ENDDO.
> 
>   CLOSE c1
> ENDEXEC

What does any of this syntax have to do with Oracle?

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Fri Dec 09 2005 - 17:39:40 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US