on 09-14-2007 8:55 AM
Hi all, I am accessing to a external system in order to get some information.
TRY.
EXEC SQL.
OPEN C1 for
SELECT
GU010210,
GU010250
from GU01TB01
where GU010030 = :pi_pernr
ENDEXEC.
DO.
EXEC SQL.
FETCH NEXT C1 into :lw_contacto
ENDEXEC.
IF sy-subrc EQ 0.
po_extension = lw_contacto-extension.
po_email = lw_contacto-email.
CLEAR lw_contacto.
ENDIF.
EXIT.
ENDDO.
Treat errors
CATCH cx_root INTO exc_ref.
CLEAR: po_extension,
po_email.
ENDTRY.
Close connection
TRY.
EXEC SQL.
CLOSE C1
ENDEXEC.
CATCH cx_root INTO exc_ref.
CLEAR: po_extension,
po_email.
ENDTRY.
If I try to get information of a employee that does not exist in the external system, I am getting the exception:
EXSQL_DSQL_CURSOR_NOT_FOUND
The cursor "C1" is unknown.
Can someone know how can I resolve this please? I was thinking that cx_root was the exceptions root.
Thanks in advance!
Hi Jorge ,
have u declared the cursor in ur program ..
data : c1 type cursor .
Regards ,
Yashpal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I fixed the problem changing the position of close C1 after fetch data.
Regards!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, the cursos is declared, but still not working.
Thanks for reply!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
You are trying to catch an exception called EXSQL_DSQL_CURSOR_NOT_FOUND. This is not part of the class-based exceptions under cx_root ...
I'm not sure, but I think you cannot catch this exception (there are several exceptions which cannot be caught and which lead to a runtime error).
You may try it with CATCH SYSTEM-EXCEPTIONS exc1 = rc1 ... excn = rcn instead of cx_root. These are the "old-fashioned" exceptions.
Regards,
Volker
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.