IDS 7.31 : User-defined exceptions in SPL 
Author Message
 IDS 7.31 : User-defined exceptions in SPL

Hi again,

I still have troubles with exceptions in SPL stored procedures. I would
like to send back to caller processes of my procedures 'home-defined'
exceptions but I can't find any tip, neither  in Informix documentation
nor on the IIUG site.

Here is an example of the exception bloc in my procedures :
   ON EXCEPTION SET v_errnum, v_eisam, v_errmsg
      IF v_errnum IN (-xxx) THEN
         LET v_errmsg = 'my_message_xxx';
      ELIF v_errnum IN (-yyy) THEN
         LET v_errmsg = 'my_message_yyy';
      END IF;
      RAISE EXCEPTION v_errnum, v_eisam, v_errmsg;
   END EXCEPTION;

I have tried to do so with unused exception but it dos not work as I
would like to :
- for example, use of exceptions codes -9771 or -5310 : the exception is
raised but my error message is not send with the exception code to the
sender. I get back something like < SQL Error (-9771) : Unknown error
message -9771 >.
- use of exception code -1000 :  the exception is raised and my error
message is also send back to the caller within another message. I get
back something like < SQL Error (-1000) : No help message found for the
message number "My message" >.
- use of exception code -13500 : The execption is raised with a
particular message. This message changes with the range of the exception
code. I get something like < SQL Error (-13500) : Cannot open file
'isqlrf.iem'.

So my questions are :
- which exception code can I use for the SQLCODE ?
- how to associate an error message on these SQLCODE values (define
error messages in particular files, ...) ? Otherwise, is it possible to
set the SQLCODE to a value which has not corresponding error message,
and to set ISAM Code and message to 'home-defined' values ?

Thanks a lot for your answers.

--
- ------------------------------------------------------------------ -
-  Arnaud ANDRIEUX                      tel direct : 02.99.12.52.22  -
-  Alliance Qualite Logiciel             http://www.***.com/            -
-  GROUPE SILICOMP   http://www.***.com/      -
-  Rue de la Chataigneraie - B.P. 127                                -
-  35513 CESSON SEVIGNE    - FRANCE                                  -
-  tel : (33) (0)2.99.12.50.00          fax : (33) (0)2.99.63.70.40  -
- ------------------------------------------------------------------ -



Wed, 18 Jun 1902 08:00:00 GMT
 IDS 7.31 : User-defined exceptions in SPL

You can supply your own error message with sqlcode -746.

Everything else, afaik, will want to look up the message in an .iem file.

Hi again,

I still have troubles with exceptions in SPL stored procedures. I would
like to send back to caller processes of my procedures 'home-defined'
exceptions but I can't find any tip, neither  in Informix documentation
nor on the IIUG site.

Here is an example of the exception bloc in my procedures :
   ON EXCEPTION SET v_errnum, v_eisam, v_errmsg
      IF v_errnum IN (-xxx) THEN
         LET v_errmsg = 'my_message_xxx';
      ELIF v_errnum IN (-yyy) THEN
         LET v_errmsg = 'my_message_yyy';
      END IF;
      RAISE EXCEPTION v_errnum, v_eisam, v_errmsg;
   END EXCEPTION;

I have tried to do so with unused exception but it dos not work as I
would like to :
- for example, use of exceptions codes -9771 or -5310 : the exception is
raised but my error message is not send with the exception code to the
sender. I get back something like < SQL Error (-9771) : Unknown error
message -9771 >.
- use of exception code -1000 :  the exception is raised and my error
message is also send back to the caller within another message. I get
back something like < SQL Error (-1000) : No help message found for the
message number "My message" >.
- use of exception code -13500 : The execption is raised with a
particular message. This message changes with the range of the exception
code. I get something like < SQL Error (-13500) : Cannot open file
'isqlrf.iem'.

So my questions are :
- which exception code can I use for the SQLCODE ?
- how to associate an error message on these SQLCODE values (define
error messages in particular files, ...) ? Otherwise, is it possible to
set the SQLCODE to a value which has not corresponding error message,
and to set ISAM Code and message to 'home-defined' values ?

Thanks a lot for your answers.

--
- ------------------------------------------------------------------ -
-  Arnaud ANDRIEUX                      tel direct : 02.99.12.52.22  -
-  Alliance Qualite Logiciel            http://www.aql.fr            -
-  GROUPE SILICOMP   http://www.silicomp.fr      -
-  Rue de la Chataigneraie - B.P. 127                                -
-  35513 CESSON SEVIGNE    - FRANCE                                  -
-  tel : (33) (0)2.99.12.50.00          fax : (33) (0)2.99.63.70.40  -
- ------------------------------------------------------------------ -



Wed, 18 Jun 1902 08:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. IDS 7.31 : Managing exceptions in stored procedures

2. Restoring IDS 7.31 on IDS 2000

3. IDS 7.31 -> IDS.2000 9.21 upgrade

4. IDS 2000 vrs IDS 7.31

5. IDS.2000 and IDS 7.31 on one unix box

6. SPL - 7.31 NT using SYSTEM

7. Upgrading IDS from 7.31 to 9.xx

8. IDS 7.31 utf/arabic

9. error with IDS 7.31 UD1 dbexport

10. Memory Leak in IDS 7.31 UD4 for HP-UX 11.0

11. Informix IDS 7.30 to 7.31 (Informix has replied please upgrade)

12. Connecting IDS 7.31 with SQL Server 7


 
Powered by phpBB® Forum Software