encountering this error while calling the insert stored procedure from plsql.

STORED PROCEDURE:

create or replace procedure WLLINSERT
(p_WLLPACKAGEID NUMBER,
p_WLLPACKAGECODE varchar2,
p_WLLPACKAGENAME varchar2,
p_WLLPACKAGEDESC varchar2,
p_SDATE DATE default null,
p_EDATE DATE default null,
p_STATUS varchar2,
p_BRANDID Number
) is
begin
insert into WLLPACKAGE
(WLLPACKAGEID,
WLLPACKAGECODE,
WLLPACKAGENAME,
WLLPACKAGEDESC,
SDATE,
EDATE,
STATUS,
BRANDID)
values
(p_WLLPACKAGEID,
p_WLLPACKAGECODE,
p_WLLPACKAGENAME,
p_WLLPACKAGEDESC,
p_SDATE,
p_EDATE,
p_STATUS,
p_BRANDID);
commit;
exception
when dup_val_on_index then
raise_application_error(-20001, 'PACKAGE ID already
exists');
when others then
raise_application_error(-20011, sqlerrm);
end WLLINSERT;

public void InsertPackage()
    {
        OracleConnection cn = new OracleConnection(ConfigurationManager.ConnectionStrings["ConnectionStringOracle"].ConnectionString);
        try 
        {
          
            OracleCommand cmd = new OracleCommand("wllinsert", cn);
            cmd.CommandType = CommandType.StoredProcedure;

            OracleParameter ip1=new OracleParameter(" p_WLLPACKAGECODE",this.txtPkgCode.Text);
            ip1.Direction = ParameterDirection.Input;
            cmd.Parameters.Add(ip1);

            OracleParameter ip2 = new OracleParameter("p_WLLPACKAGENAME", this.txtPkgName.Text);
            ip2.Direction = ParameterDirection.Input;
            cmd.Parameters.Add(ip2);

            OracleParameter ip3= new OracleParameter("p_WLLPACKAGEDESCRIPTION", this.txtPkgDesc.Text);
            ip3.Direction = ParameterDirection.Input;
            cmd.Parameters.Add(ip3);
            
            OracleParameter ip4 = new OracleParameter("p_SDATE", this.txtStartDate.Text);
            ip4.Direction = ParameterDirection.Input;
            cmd.Parameters.Add(ip4);

            OracleParameter ip5 = new OracleParameter("p_EDATE", this.txtEndDate.Text);
            ip5.Direction = ParameterDirection.Input;
            cmd.Parameters.Add(ip5);

            OracleParameter ip6 = new OracleParameter("p_STATUS", this.txtStatus.Text);
            ip6.Direction = ParameterDirection.Input;
            cmd.Parameters.Add(ip6);

            OracleParameter ip7=new OracleParameter("p_BRANDID", this.ddlBrandID.SelectedValue);
            ip7.Direction = ParameterDirection.Input;
            cmd.Parameters.Add(ip7);

            cn.Open();
            cmd.ExecuteNonQuery();
        }
        catch(OracleException ex) // here it is giving error ORA-01036: illegal variable name/number
        {
            string msg = ex.Message;

            Response.Write(msg);

            Response.End();

        }
        finally
        {
            cn.Close();
        }
    }

    protected void btnSavePkg_Click(object sender, EventArgs e)
    {
        InsertPackage();
    }

i think you might be having primary key in your table..

and while inserting a record you are providing the same ID

which exist in your table.

try to execute store procedure manually with different id

it should work.

hope that helps

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.