Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Stored procedure not returning values

Former Member
0 Likes
545

Hello gurus!

I have a problem executing stored procedures from oracle. I'm executing a test procedure and doing the connection to the DB and everything seem to be ok, but it's not returning any result. Here is my code:

REPORT  Z_WIACTIVOWF.
DATA: c TYPE cursor, p_entrada TYPE C, p_salida TYPE C.

EXEC SQL.
  CONNECT TO 'CREA20'
ENDEXEC.

EXEC SQL.
  OPEN c FOR
  EXECUTE PROCEDURE stp_prueba_proc ( IN :p_entrada, OUT :p_salida )
ENDEXEC.

EXEC SQL.
  CLOSE c
ENDEXEC.

EXEC SQL.
  DISCONNECT :'CREA20'
ENDEXEC.

WRITE: / p_salida.

I am new in this ABAP stuff, so any help would be appreciated.

Regards IA

Hello gurus!

I have a problem executing stored procedures from oracle. I'm executing a test procedure and doing the connection to the DB and everything seem to be ok, but it's not returning any result. Here is my code:

REPORT  Z_WIACTIVOWF.
DATA: c TYPE cursor, p_entrada TYPE C, p_salida TYPE C.

EXEC SQL.
  CONNECT TO 'CREA20'
ENDEXEC.

EXEC SQL.
  OPEN c FOR
  EXECUTE PROCEDURE stp_prueba_proc ( IN :p_entrada, OUT :p_salida )
ENDEXEC.

EXEC SQL.
  CLOSE c
ENDEXEC.

EXEC SQL.
  DISCONNECT :'CREA20'
ENDEXEC.

WRITE: / p_salida.

I am new in this ABAP stuff, so any help would be appreciated.

Regards IA

2 REPLIES 2
Read only

Former Member
0 Likes
473

This message was moderated.

Read only

0 Likes
473

Hello

I tried with the help you kindly provided me, and now appears this error: "The error 900 occurred in the current databse connection "X"", and the system says the error is triggered in the line: "FETCH NEXT c INTO :p_salida". Here is the code:

REPORT  Z_WIACTIVOWF.
DATA: c TYPE CURSOR, p_entrada TYPE C, p_salida TYPE C.
p_entrada = ' 4 '.

EXEC SQL.
  CONNECT TO 'CREA20'
ENDEXEC.

EXEC SQL.
  OPEN c FOR
  EXECUTE PROCEDURE stp_prueba_proc ( IN :p_entrada, OUT :p_salida )
ENDEXEC.
DO.
  EXEC SQL.
    FETCH NEXT c INTO :p_salida
  ENDEXEC.
  IF SY-SUBRC = 0.
    EXIT.
  ENDIF.
  WRITE: / p_salida.
ENDDO.

EXEC SQL.
  CLOSE c
ENDEXEC.

EXEC SQL.
  DISCONNECT :'CREA20'
ENDEXEC.

Regards