Le forum (ô combien francophone) des utilisateurs de Powerbuilder.
Bonjour,
Je travaille sur une application Powerbuilder (v10.5.1). A un moment donné, j'appelle une procédure stockée de calcul (sur une base Oracle 10g) :
TRY SQLCA.of_calcul(...) CATCH(...) ... END TRY
Lorsque ma procédure de calcul génère une exception Oracle, comment puis je faire pour récupérer l'erreur? J'ai essayé avec TRY-CATCH mais rien n'y fait... des idées?
Merci beaucoup !
Dernière modification par Kyoshiro (03-12-2008 10:16:30)
Hors ligne
Salut,
En fonction du code retour de ta procédure stockée tu peut determiner si elle s'est bien déroulée ou pas : SQLCA.SQLCode
AutoCommit Boolean The automatic commit indicator (SQL Server only). Values are:· True — Commit automatically after every database activity· False — Do not commit automatically after every database activity
Database String The name of the database with which you are connecting.
DBMS String PowerBuilder vendor identifier.
DBParm String DBMS-specific parameters.
DBPass String The password that will be used to connect to the database.
Lock String The isolation level.
LogID String The name or ID of the user who will log on to the server.
LogPass String The password that will be used to log on to the server.
ServerName String The name of the server on which the database resides.
SQLCode Long The success or failure code of the most recent operation. Return codes: 0 — Success100 — Not found -1 — Error (use SQLDBCode or SQLErrText to obtain the details)
SQLDBCode Long The database vendor's error code.
SQLErrText String The database vendor's error message.
SQLNRows Long The number of rows affected (the database vendor supplies this number, so the meaning may not be the same in every DBMS).
SQLReturnData String DBMS-specific information.
UserID String The name or ID of the user who will connect to the database.
C'est un début
Dernière modification par Nephtis (03-12-2008 09:46:16)
Hors ligne
if SQLCA.SQLCODE<>0 then messagebox("Message SQL",SQLCA.SQLErrText, stopsign!) end if
Hors ligne
Effectivement, c'est bien le SQLCode qu'il fallait regarder pour avoir le code erreur... En fait je me suis rendu compte que c'était deja implémenté mais que j'étais pas allé assez loin en mode "DEBUG" pour tomber sur le SQLCode=-1.
Merci a tous !
Hors ligne