Home » Other » Client Tools » What does it mean ?
What does it mean ? [message #37592] Thu, 14 February 2002 23:27 Go to next message
diaz
Messages: 58
Registered: October 2001
Member
Have this code :

declare
a number;
procedure drop_table (tab in varchar2,flag out number) is
does_not_exist exception;
pragma exception_init(does_not_exist,-00942);
flag number;
begin
execute immediate 'drop table '|| tab ||' cascade constraints';
dbms_output.put_line(tab||' table dropped');
flag := 0;
exception
when does_not_exist then
flag := 1;
dbms_output.put_line ('Table Does Not Exist');
when others then
flag := 2;
dbms_output.put_line (sqlerrm);
end drop_table;
begin
drop_table ('mytab',a);
dbms_output.put_line (a);
end;
/

i developed the code that mr.suresh gave on the previous thread..
and ... it resulted this :

ERROR at line 1:
ORA-06550: line 3, column 1:
PLS-00410: duplicate fields in RECORD,TABLE or argument list are not permitted
ORA-06550: line 3, column 1:
PL/SQL: Item ignored
Re: What does it mean ? [message #37600 is a reply to message #37592] Fri, 15 February 2002 03:56 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
you dont need to declare out parameter.

declare
a number;
procedure drop_table (tab in varchar2,flag out number) is
does_not_exist exception;
pragma exception_init(does_not_exist,-00942);
begin
execute immediate 'drop table '|| tab ||' cascade constraints';
dbms_output.put_line(tab||' table dropped');
flag := 0;
exception
when does_not_exist then
flag := 1;
dbms_output.put_line ('Table Does Not Exist');
when others then
flag := 2;
dbms_output.put_line (sqlerrm);
end drop_table;
begin
drop_table ('mytab',a);
dbms_output.put_line (a);
end;
Re: What does it mean ? [message #38619 is a reply to message #37592] Tue, 30 April 2002 17:43 Go to previous message
Anonymouse
Messages: 1
Registered: April 2002
Junior Member
It means that you have a procedural parameter coming in with the same name as a variable within the procedure.

If you look at your procedure DROP_TABLE, there is a parameter named flag. Now, within the procedure DROP_TABLE's source code, there is also a variable named flag.

I'm guessing that pl/sql gets confused when you do flag := 1; it does not know which one to use. Of course, that is only a theory. Whatever the reason, if you rename one of the variables, it will solve your problem of
PLS-00410: duplicate fields in RECORD,TABLE or argument list are not permitted
Previous Topic: Spool command
Next Topic: Need help Urgent.....
Goto Forum:
  


Current Time: Fri Apr 19 04:25:46 CDT 2024