‎2006 Aug 17 8:38 AM
I want to reduce the database hit for the external database so i'm trying to use cursor. I'm following the F1 help syntax. But problem is it is giving Dump in the FETCH NEXT statement. Please help.
EXEC SQL.
OPEN C1 FOR SELECT SAP_MASTNR, ANK_MASTNR FROM
NOVARTIS.TABLE_ADRESS@ANKD WHERE ANK_MASTNR IN :wa_datlt ;
ENDEXEC.
DO.
EXEC SQL.
FETCH NEXT C1 INTO :wa ;
ENDEXEC.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
ENDDO.
EXEC SQL.
CLOSE C1
ENDEXEC.
‎2006 Aug 17 8:43 AM
Hi Phani,
if you are using Oracle, the correct syntax should be "fetch cursor_name into variable".
I hope it helps. BR,
Alvaro
‎2006 Aug 17 9:16 AM
Hi Even then it is giving dump. And one more thing the value in the wa_datlt contains this ( '005236' , '36587' , '36587' ).
If i skip that where clause or if the variable wa_datlt contains single value it is working fine. What could be the reason?