Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, This is 1st time i am working with Oracle using Asp.net. I am currently passing 6 values into my stored procedure for it to run.

However my stored procedure contain 6 parameters.

Just wondering do I need to pass all 6 values in order for it to work ? As i am trying to do the same with 3 but it is showing error saying wrong parameter list.

I am don't want to hit the procedure with the DBNull,

I only want to hit with the minimum value. My procedure is also sets default Null value for the no so important fields.

please help

What I have tried:

C#
public string Update_MS_Group(Int64 GROUP_ID, string GROUP_NAME, string EMAIL_ID, Int64 ACTIVE, string CREATE_BY)
{
    var param_array = new TupleList<string, string, OracleDbType>
    {
        { "2", "p_flag", OracleDbType.Int64 },
        {Convert.ToString(GROUP_ID),"p_group_id", OracleDbType.Int64},
        {Convert.ToString(GROUP_NAME), "p_group_name", OracleDbType.NVarchar2 },
        { Convert.ToString(EMAIL_ID), "p_email_id",OracleDbType.NVarchar2 },
        { Convert.ToString(ACTIVE), "p_active",OracleDbType.Int64 },
        { Convert.ToString(CREATE_BY), "p_create_by",OracleDbType.NVarchar2 }
    };

string returnval = DL.ExecuteSP("pkg_user_mgmt.prc_group_dml", param_array);
return returnval;
}
Posted
Updated 19-Dec-17 10:13am
v2
Comments
Sinisa Hajnal 18-Dec-17 8:02am    
If you want to pass less parameters, you need to specify default values for "missing" parameters.
Jörgen Andersson 18-Dec-17 15:18pm    
That's an answer, not a comment.
But add the fact that the default value should be specified in the stored procedure
Member 11102584 20-Dec-17 1:26am    
Default values are defined ,but I am not able to pass lesser number of parameter defined in the Package.

1 solution

As mentioned in comments you need to provide default values for your parameters if you do not want to pass them all. Google for oracle optional parameters if you do not know how to do them.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900