locked
ERROR [42000] [Oracle][ODBC][Ora]ORA-00900: invalid SQL statement RRS feed

  • Question

  • User-2037497074 posted

    Hi

    i am trying to call a plsql function from asp.net

    but i jus keep getting the error

    ERROR [42000] [Oracle][ODBC][Ora]ORA-00900: invalid SQL statement

    following is my code

    int baseyear=2010;
        int uidfcent=1;
        int uidsubstn=41;
        int accountuid=21;
        int uidaccountsub = 21;
        protected void Page_Load(object sender, EventArgs e)
        {
            OdbcConnection odbcconn = new OdbcConnection("Dsn=LDEV2;uid=PWRUSER;dbq=LDEV2;pwd=pwruser123");
            using (OdbcCommand odbccomm = new OdbcCommand("XX_FC_DATA_UPDATE_SUBTYPETEST", odbcconn))
            {
                odbccomm.CommandType = CommandType.StoredProcedure;
    
                OdbcParameter P_UIDFCENTITY = new OdbcParameter("P_UIDFCENTITY", OdbcType.BigInt);
                P_UIDFCENTITY.Value = uidfcent;
                P_UIDFCENTITY.Direction = ParameterDirection.Input;
                odbccomm.Parameters.Add(P_UIDFCENTITY);
    
                OdbcParameter P_UIDFCSUBSTATION = new OdbcParameter("P_UIDFCSUBSTATION", OdbcType.BigInt);
                P_UIDFCSUBSTATION.Value = uidsubstn;
                P_UIDFCSUBSTATION.Direction = ParameterDirection.Input;
                odbccomm.Parameters.Add(P_UIDFCSUBSTATION);
               
    
                OdbcParameter P_UIDACCOUNT = new OdbcParameter("P_UIDACCOUNT", OdbcType.BigInt);
                P_UIDACCOUNT.Direction = ParameterDirection.Input;
                P_UIDACCOUNT.Value = uidaccountsub;
                odbccomm.Parameters.Add(P_UIDACCOUNT);
    
                OdbcParameter P_UIDACCSUBTYPE = new OdbcParameter("P_UIDACCSUBTYPE", OdbcType.BigInt);
                P_UIDACCSUBTYPE.Direction = ParameterDirection.Input;
                P_UIDACCSUBTYPE.Value = accountuid;
                odbccomm.Parameters.Add(P_UIDACCSUBTYPE);
    
                OdbcParameter P_BASEYEAR = new OdbcParameter("P_BASEYEAR", OdbcType.BigInt);
                P_BASEYEAR.Direction = ParameterDirection.Input;
                P_BASEYEAR.Value = baseyear;
                odbccomm.Parameters.Add(P_BASEYEAR);
    
                OdbcParameter p1 = new OdbcParameter("", OdbcType.VarChar,1000);
                p1.Direction = ParameterDirection.ReturnValue;
                odbccomm.Parameters.Add(p1);
    
                odbcconn.Open();
    
                odbccomm.ExecuteNonQuery();
    
                string msg = p1.Value.ToString();
                
                Response.Write(msg);
            }
          
            odbcconn.Close();


    Wednesday, May 22, 2013 2:00 AM

Answers

  • User-1469158370 posted

    It looks like your stored proc is not written correctly.

    Go back and try to execute the sp manually and see if it works. 

    YOu have to fix your query to let your code work propertly

    XX_FC_DATA_UPDATE_SUBTYPETEST
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 25, 2013 10:42 AM