Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Thank you everyone - problem solved

Thank you everyone - problem solved

From: Guy <ni4ni_at_hotmail.com>
Date: 23 Dec 2002 08:11:32 -0800
Message-ID: <d2eb532b.0212230811.22301c8@posting.google.com>


I dont know how could this be, but it seems like one of my constraint had a space character in its name, so whenever the loop reached this constraint it failed to alter it. Adding quotes arround the constraint name solved the problem.

Thanks everyne for your help.

Guy

ni4ni_at_hotmail.com (Guy) wrote in message news:<d2eb532b.0212220316.6b4bae0b_at_posting.google.com>...
> Thanks everyone
>
> After looking at the postings here I changed i to be
> user_constraints%rowtype
> but it doesnt seem to help. Im using Oracle 8.1.7 and Im invoking the
> procedure by running "exec alter_sequences ('disable');".
> I didnt check the init.ora parameter yet.
>
>
> Guy
>
>
> ni4ni_at_hotmail.com (Guy) wrote in message news:<d2eb532b.0212190158.1858d489_at_posting.google.com>...
> > Hello
> >
> >
> > I wrote a small PL/SQL procedure that should switch all referential
> > constraints enabled/disabled.
> > It seems very simple and it compiles just fine. But when I try to run
> > it it says "Invalid Character" in line 15 (I marked the line in the
> > code - the one with the execute immediate).
> > I cant see anything wrong in this line.
> > Can anyone see whats the problem here ?
> >
> > Thanks
> >
> > Guy
> >
> >
> >
> > CREATE OR REPLACE procedure alter_constraints (action varchar2)
> > is
> > cursor cons is select constraint_name,table_name from
> > user_constraints where constraint_type='R';
> > str varchar2(150);
> > i number;
> > inner_action varchar2(50);
> > begin
> > inner_action:=action;
> > for i in cons loop
> > str:='alter table '||i.table_name||' '||inner_action||' constraint
> > '||i.constraint_name;
> > dbms_output.put_line(str);
> > -- this is the problematic line
> > -- | |
> > -- v v
> > EXECUTE IMMEDIATE str;
> > end loop;
> > end;
> > /
Received on Mon Dec 23 2002 - 10:11:32 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US