Re: Embedded SQL

From: Reid Lai <reidlai_at_hk.super.net>
Date: 1996/05/19
Message-ID: <4nm4kr$1kt_at_tst.hk.super.net>#1/1


wyu_at_cs.cs.uregina.ca (Dr. Weidong Yu) wrote:

>Hi,
 

>I have two questions about oracle, if anyone knows how to solve them,
>please email me. Thank you very much in advance!
 

>First, I hopes to write a embedded SQL as follows:
 

> EXEC SQL WHENEVER SQLERROR DO sql_error(), return(0);
 

>That is to say, if there is a SQL error, the function 'sql_error' is
>executed first, and return 0 to the called function. I don't how to
>write it.
 

> I tried the following approaches and failed.
 

> EXEC SQL WHENEVER SQLERROR DO sql_error(), return(0);
> EXEC SQL WHENEVER SQLERROR DO { sql_error(); return(0); }
> EXEC SQL WHENEVER SQLERROR DO begin sql_error(); return(0); end;
 

>Second, how to read the procedures, functions, packages, sequences,
>which are stored in databases.
 

>Weidong
>----
>*****************************************************************
>* Weidong Yu Office: CW308.19 *
>* Dept. of Computer Science Tel: 306-585-5230(O) *
>* Univ. of Regina 306-584-7502(H) *
>* Regina, Saskatchewan Fax: 306-585-4745 *
>* Canada S4S OA2 Email: wyu_at_cs.uregina.ca *
>*****************************************************************

Since I am not familiar with Pro*C, I can't help you for the first question.

For your second question, you can select the rows from SYS.ALL_OBJECTS table as follow

SELECT
  *
FROM
  SYS.ALL_OBJECTS
WHERE
  OBJECT_TYPE IN ('PROCEDURE','FUNCTION','PACKAGE','PACKAGE BODY','SEQUENCE') ; Received on Sun May 19 1996 - 00:00:00 CEST

Original text of this message