Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

: STORED PROGRAM PARAMETER DEFAULT VALUE

64636Apr 30 2007 — edited Apr 30 2007
Hello Everyone,

I wrote a store program with input parameters and I made them to have default values. However, when I tried to test the stored program the default values seemed not to be working. What did I do wrong here? I have pasted the below code snippet:

CREATE OR REPLACE PROCEDURE proc_name (
p_Parameter IN table_name.field1%TYPE DEFAULT 'text',
p_Parameter IN table_name.field2%TYPE DEFAULT 'text',
p_Parameter IN table_name.field3%TYPE,
p_Parameter IN table_name.field4%TYPE,
p_Parameter IN table_name.field5%TYPE DEFAULT 't',
p_Parameter IN table_name.field6%TYPE DEFAULT 'text',
p_Parameter IN table_name.field7%TYPE DEFAULT '1111111111',
p_Parameter IN table_name.field8%TYPE DEFAULT 't',
p_Parameter IN table_name.field9%TYPE := NULL,
p_Parameter IN table_name.field0%TYPE DEFAULT USER
)
IS

The idea behind here is that if the user does not type in any value, the assigned default value will be taken as the parameter of the stored program.

The call usually happens like this:

(
null,null,null,null,null,null,null,null,
null,null
)

Sincerely,

Randy
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2007
Added on Apr 30 2007
16 comments
981 views