We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,645 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

ORA-01036: illegal variable name/number

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();
    }
2
Contributors
1
Reply
1 Hour
Discussion Span
2 Years Ago
Last Updated
2
Views
ayeshakhan
Newbie Poster
6 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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

dnanetwork
Practically a Master Poster
Banned
633 posts since May 2008
Reputation Points: 28
Solved Threads: 106
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0570 seconds using 2.69MB