Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    18

    Unanswered: PL/SQL procedure.. IN parameter..

    Hi,
    I have a PL/SQL procedure of following structure
    CREATE OR REPLACE PROCEDURE proc1(param1 IN VARCHAR2,param2 IN VARCHAR2)
    IS
    BEGIN
    -----Statements goes here
    END;
    /

    Can I call the procedure like this
    execute proc1('ssk',)
    ie without passing any value to the second pramater?

    becos my requirement is that the param2 is optional
    if I call the procedure like "execute proc1('ssk',)"
    I get the error message..............

    So can any one please tell me how to handle this situation.
    Thanks in advance.
    Regards,
    Senthil

  2. #2
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    118

    Default

    Yes you can:

    You'll have to declare a defualt value for the in parameter though:

    [REMI@ORA-0000.COM] CREATE OR REPLACE PROCEDURE proc1
    2 ( param1 IN VARCHAR2,
    3 param2 IN VARCHAR2 DEFAULT NULL)
    4 IS
    5 BEGIN
    6 NULL;
    7 END;
    8 /

    Procedure created.

    [REMI@ORA-0000.COM] EXEC proc1('Hello')

    PL/SQL procedure successfully completed.

    Good luck!!
    Remi Visser

    Oracle Database Administrator
    (OCP certified 8i)

    Homepage: http://home.remidian.com/

  3. #3
    Join Date
    Jan 2003
    Posts
    18

    Re: Default

    Thanks a Lot
    Regards,
    Senthil

    Originally posted by remivisser
    Yes you can:

    You'll have to declare a defualt value for the in parameter though:

    [REMI@ORA-0000.COM] CREATE OR REPLACE PROCEDURE proc1
    2 ( param1 IN VARCHAR2,
    3 param2 IN VARCHAR2 DEFAULT NULL)
    4 IS
    5 BEGIN
    6 NULL;
    7 END;
    8 /

    Procedure created.

    [REMI@ORA-0000.COM] EXEC proc1('Hello')

    PL/SQL procedure successfully completed.

    Good luck!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •