Re: What's wrong with this sp?

From: Marc <langkamp_at_mailcity.com>
Date: Tue, 13 Nov 2001 13:48:37 +0100
Message-ID: <3bf11699$1_at_gaspra.oss.akzonobel.nl>


Better check on how to build procedures too. You'll need a declaration section in which you declare the variables to put the result of your query in

Your procedure should look like this

create or replace procedure xxx () as
var1 type;
...
cursor AAA () is ....;
procedure() is...;
function() is ....;

BEGIN
open cursor Aaa;
fetch aaa into ...
close aaa;

/* Do something */
....
....
end;

"DL" <donlcs_at_yahoo.com> wrote in message news:604bb90c.0111120929.5612d6f8_at_posting.google.com...
> Create procedure first_Oracle_sp(v_owner IN varchar2, v_tn IN varchar2)
> AS
> Begin
> select distinct cols.table_name as tblname,c.nullable, cols.column_name
> from dba_constraints cons, dba_cons_columns cols, dba_tab_columns c
> where cons.table_name = cols.table_name
> and cons.owner = v_owner
> and c.table_name = v_tn
> and cols.column_name = c.column_name
> and cons.constraint_name = cols.constraint_name
> and cons.constraint_type = 'R'
> and cons.table_name = v_tn
> End;
>
> Thanks.
Received on Tue Nov 13 2001 - 13:48:37 CET

Original text of this message