#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    2
    Rep Power
    0

    PL/SQL stored procedure


    Here is a procedure that I created. The table has 2 fields name and age. I would like to know how it run it and when I compile it, it gives me errors.

    create procedure tst(va in out number,n out varchar2)
    as
    begin
    dbms_output.put_line('Testing...');
    dbms_output.put_line('Enter age ');
    va:=28;
    select name into n from test where age = va;
    end;
    .
    run;
    set serveroutput on;
    begin
    tst;
    end;
    .



    ERROR:

    Procedure created.

    1 begin
    2 tst;
    3* end;
    tst;
    *
    ERROR at line 2:
    ORA-06550: line 2, column 1:
    PLS-00306: wrong number or types of arguments in call to 'TST'
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored


    Thanks.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    68
    Rep Power
    12
    The following worked for me in SQL*Plus:

    SQL> create procedure tst(va in out number,n out varchar2)
    as
    begin
    dbms_output.put_line('Testing...');
    dbms_output.put_line('Enter age ');
    va:=28;

    end;

    SQL> set serveroutput on

    No semi-colon at the end, since it's an SQL*Plus command


    SQL> var x number
    SQL> var y varchar2
    SQL> exec tst(:x,:y);

    Testing...
    Enter age

    PL/SQL procedure successfully completed.

    regards,
    Dan

IMN logo majestic logo threadwatch logo seochat tools logo