-
Hi All,
I have a porc that has IN and OUT parameters to be passed.
procedure total_proc(p1 IN varchar2,p2 OUT char);
When execute the procedure I get
PLS-00363 expression p2 cannot be used as an assignment target
ORA-06550
Can you advise ?
Thanks a lot
-
Can you post the code snippet that uses p2 in the procedure?
-
You're trying to assign a variable to the P2 OUT parameter. This is not allowed. OUT variables can only be assigned: the contents can't be viewed or assigned to other variables.
Either use an IN OUT parameter or assign the value to another variable before assigning it to P2.
-
hi donna,
ur's problem is very simple.
ur procedure is like this
procedure total_proc(p1 IN varchar2,p2 OUT char);
when executing this at sql prompt
sql> variable v1 varchar2(10) :='abc';
sql> variable v2 char(10);
sql> exec total_proc(:v1,:v2);
after successful execution
sql>print v2
then the out value will be printed
OR
when u are calling it in a plsql block
declare
v1 varchar2(10):='abc';
v2 varchar2(10);
begin
total_proc(v1,v2);
--the out value will be fetched into the out parameter
dbms_output.put_line(v2);
end;
try the above two scripts
bye
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|