1,105,633 Community Members

ORA-01036: illegal variable name/number

Member Avatar
ayeshakhan
Newbie Poster
6 posts since Jul 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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();
    }
dnanetwork
Practically a Master Poster
633 posts since May 2008
Reputation Points: 18 [?]
Q&As Helped to Solve: 106 [?]
Skill Endorsements: 1 [?]
Banned
 
0
 

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

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: