ORA-01036: illegal variable name/number.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rameshonweb
    New Member
    • Oct 2007
    • 17

    ORA-01036: illegal variable name/number.

    Iam executing the following C# code and it is giving an error at da.Fill(ds); in the code.Please some one help.
    Thanks in advance



    OracleConnectio n conn = new OracleConnectio n(GetConnection String());

    OracleCommand cmd = new OracleCommand(" exec GET_DATA", conn);
    cmd.Parameters. Add("NO", OracleType.Char , 7).Value = "111" cmd.Parameters. Add("DAT_CURSOR ", OracleType.Curs or).Direction = ParameterDirect ion.Output;


    OracleDataAdapt er da = new OracleDataAdapt er(cmd);
    DataSet ds = new DataSet();
    DataView objDV = new DataView();
    DataTable objDT = new DataTable();

    da.Fill(ds);
    objDT = ds.Tables[0];
    objDV = ds.Tables[0].DefaultView;
    objDV.Sort = strSort;
    Repeater1.DataS ource = objDV;
    Repeater1.DataB ind();


    conn.Close();
    }
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    does the procedure GET_DATA take parameters as an input?

    could you also specify the error that you get?
    copying and pasting the error is the best thing to do

    Comment

    • rameshonweb
      New Member
      • Oct 2007
      • 17

      #3
      Originally posted by Shashi Sadasivan
      does the procedure GET_DATA take parameters as an input?

      could you also specify the error that you get?
      copying and pasting the error is the best thing to do
      Yes the procedure takes one input parameter based on which it will run a select statement that will fetch results.

      The exact error when compiling is "ORA-01036: illegal variable name/number" and the location of the error is da.Fill(ds)

      Comment

      • Shashi Sadasivan
        Recognized Expert Top Contributor
        • Aug 2007
        • 1435

        #4
        have you tried setting the command property "CommandTyp e" to StoredProcedure ?

        cmd.CommandType = CommandType.Sto redProcedure;

        you shud do this before da.fill. preferrably after you set all the parameters

        Comment

        • rameshonweb
          New Member
          • Oct 2007
          • 17

          #5
          Originally posted by Shashi Sadasivan
          have you tried setting the command property "CommandTyp e" to StoredProcedure ?

          cmd.CommandType = CommandType.Sto redProcedure;

          you shud do this before da.fill. preferrably after you set all the parameters
          Shashi, It worked.Thanks a bunch.

          Comment

          Working...