IN/OUT PARAMETERES
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: IN/OUT PARAMETERES

  1. #1
    Join Date
    Mar 2001
    Posts
    52
    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

  2. #2
    Join Date
    May 2001
    Location
    San Francisco, California
    Posts
    510
    Can you post the code snippet that uses p2 in the procedure?

  3. #3
    Join Date
    Apr 2001
    Location
    UK
    Posts
    137
    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.

  4. #4
    Join Date
    May 2001
    Posts
    11

    Post

    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
  •  



Click Here to Expand Forum to Full Width