Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2010
    Posts
    2

    Unanswered: problem with update oracle database

    The problem is when I'm trying to edit row in gridview I got this error message:

    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'UPDATECSYSTEM'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    I'm using packet procedure from oracle. this is the code from the procedure:

    procedure updateCSystem(p_CSYSTEM_PK float, p_LOGIN_PK float,p_name varchar2,p_REF_ELIPSOID varchar2,p_PROJECTION varchar2, p_TYPE_CS_PK float)
    is
    begin
    update GT_CSYSTEM
    set LOGIN_PK=p_LOGIN_PK,NAME=p_name,REF_ELIPSOID=p_REF _ELIPSOID,PROJECTION=p_PROJECTION,TYPE_CS_PK=p_TYP E_CS_PK
    where CSYSTEM_PK=p_CSYSTEM_PK;
    end updateCSystem;


    and this is the code where i'm sending the parameters:

    public void UpdateCSystem(float CSYSTEM_PK, float LOGIN_PK, string NAME, string REF_ELIPSOID, string PROJECTION, float TYPE_CS_PK)
    {
    using (OracleConnection objConn = new OracleConnection(konekcija))
    {
    OracleCommand objUpdateCmd = new OracleCommand();
    objUpdateCmd.Connection = objConn;
    objUpdateCmd.CommandText = "GTCSYSTEM.UPDATECSYSTEM";
    objUpdateCmd.CommandType = CommandType.StoredProcedure;
    objUpdateCmd.Parameters.Clear();
    objUpdateCmd.Parameters.Add("p_CSYSTEM_PK", OracleType.Float, 10,"CSYSTEM_PK");
    objUpdateCmd.Parameters.Add("p_LOGIN_PK", OracleType.Float, 10, "LOGIN_PK");
    objUpdateCmd.Parameters.Add("p_name", OracleType.VarChar, 9, "NAME");
    objUpdateCmd.Parameters.Add("p_REF_ELIPSOID", OracleType.VarChar, 9, "REF_ELIPSOID");
    objUpdateCmd.Parameters.Add("p_PROJECTION", OracleType.VarChar, 9, "PROJECTION");
    objUpdateCmd.Parameters.Add("p_TYPE_CS_PK", OracleType.Float, 7, "TYPE_CS_PK");

    try
    {
    objConn.Open();
    objUpdateCmd.ExecuteNonQuery();
    }
    catch (Exception ex)
    {
    System.Console.WriteLine("Exception: {0}", ex.ToString());
    }
    objConn.Close();
    }
    }


    and this is the .NET code for the objectDataSource:

    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
    SelectMethod="GetAllCSystem" UpdateMethod="UpdateCSystem" TypeName="Store">
    <UpdateParameters>
    <asp:Parameter Name="CSYSTEM_PK" Type="Single" />
    <asp:Parameter Name="LOGIN_PK" Type="Single" />
    <asp:Parameter Name="NAME" Type="String" />
    <asp:Parameter Name="REF_ELIPSOID" Type="String" />
    <asp:Parameter Name="PROJECTION" Type="String" />
    <asp:Parameter Name="TYPE_CS_PK" Type="Single" />
    </UpdateParameters>
    </asp:ObjectDataSource>

    Thanks in advance for helping me.

  2. #2
    Join Date
    Jun 2010
    Posts
    2
    I solve the problem. If somebody else have the same problem must change updateCsystem class like this:

    public void UpdateCSystem(float CSYSTEM_PK, float LOGIN_PK, string NAME, string REF_ELIPSOID, string PROJECTION, float TYPE_CS_PK)
    {
    using (OracleConnection objConn = new OracleConnection(konekcija))
    {
    OracleCommand objUpdateCmd = new OracleCommand();

    objUpdateCmd.Connection = objConn;
    objUpdateCmd.CommandText = "GTCSYSTEM.UPDATECSYSTEM";
    objUpdateCmd.CommandType = CommandType.StoredProcedure;
    objUpdateCmd.Parameters.Clear();




    objUpdateCmd.Parameters.Add("p_CSYSTEM_PK", OracleType.Float);//, 10,"CSYSTEM_PK");
    objUpdateCmd.Parameters.Add("p_LOGIN_PK", OracleType.Float);//, 10, "LOGIN_PK");
    objUpdateCmd.Parameters.Add("p_name", OracleType.VarChar);//, 8000, "NAME");
    objUpdateCmd.Parameters.Add("p_REF_ELIPSOID", OracleType.VarChar);//, 8000, "REF_ELIPSOID");
    objUpdateCmd.Parameters.Add("p_PROJECTION", OracleType.VarChar);//, 8000, "PROJECTION");
    objUpdateCmd.Parameters.Add("p_TYPE_CS_PK", OracleType.VarChar);//, 7, "TYPE_CS_PK");

    objUpdateCmd.Parameters["p_CSYSTEM_PK"].Value = CSYSTEM_PK;
    objUpdateCmd.Parameters["p_LOGIN_PK"].Value = LOGIN_PK;
    objUpdateCmd.Parameters["p_name"].Value = NAME;
    objUpdateCmd.Parameters["p_REF_ELIPSOID"].Value = REF_ELIPSOID;
    objUpdateCmd.Parameters["p_PROJECTION"].Value = PROJECTION;
    objUpdateCmd.Parameters["p_TYPE_CS_PK"].Value = TYPE_CS_PK;

    try
    {
    objConn.Open();
    objUpdateCmd.ExecuteNonQuery();
    }
    catch (Exception ex)
    {
    System.Console.WriteLine("Exception: {0}", ex.ToString());
    }
    objConn.Close();
    }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •