更新oracle数据库的问题 [英] problem with update oracle database

查看:80
本文介绍了更新oracle数据库的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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 have this error when I'm trying to edit a row from datagrid. I'm using packet procedure from oracle. this is te code from the procedure:
<pre lang="sql">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_TYPE_CS_PK
where CSYSTEM_PK=p_CSYSTEM_PK;
 end updateCSystem;</pre>
and this is the code where i'm sendinr the parameters:
<pre lang="sql">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 = &quot;GTCSYSTEM.UPDATECSYSTEM&quot;;
            objUpdateCmd.CommandType = CommandType.StoredProcedure;
            objUpdateCmd.Parameters.Clear();
            objUpdateCmd.Parameters.Add(&quot;p_CSYSTEM_PK&quot;, OracleType.Float, 10,&quot;CSYSTEM_PK&quot;);
            objUpdateCmd.Parameters.Add(&quot;p_LOGIN_PK&quot;, OracleType.Float, 10, &quot;LOGIN_PK&quot;);
            objUpdateCmd.Parameters.Add(&quot;p_name&quot;, OracleType.VarChar, 9, &quot;NAME&quot;);
            objUpdateCmd.Parameters.Add(&quot;p_REF_ELIPSOID&quot;, OracleType.VarChar, 9, &quot;REF_ELIPSOID&quot;);
            objUpdateCmd.Parameters.Add(&quot;p_PROJECTION&quot;, OracleType.VarChar, 9, &quot;PROJECTION&quot;);
            objUpdateCmd.Parameters.Add(&quot;p_TYPE_CS_PK&quot;, OracleType.Float, 7, &quot;TYPE_CS_PK&quot;);
            try
            {
                objConn.Open();
                objUpdateCmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(&quot;Exception: {0}&quot;, ex.ToString());
            }
            objConn.Close();
        }
    }</pre>
and this is the .NET code for the objectDataSource:
<pre lang="xml">&lt;asp:ObjectDataSource ID=&quot;ObjectDataSource1&quot; runat=&quot;server&quot;
                        SelectMethod=&quot;GetAllCSystem&quot; UpdateMethod=&quot;UpdateCSystem&quot; TypeName=&quot;Store&quot;&gt;
                        &lt;UpdateParameters&gt;
                            &lt;asp:Parameter Name=&quot;CSYSTEM_PK&quot; Type=&quot;Single&quot; /&gt;
                            &lt;asp:Parameter Name=&quot;LOGIN_PK&quot; Type=&quot;Single&quot; /&gt;
                            &lt;asp:Parameter Name=&quot;NAME&quot; Type=&quot;String&quot; /&gt;
                            &lt;asp:Parameter Name=&quot;REF_ELIPSOID&quot; Type=&quot;String&quot; /&gt;
                            &lt;asp:Parameter Name=&quot;PROJECTION&quot; Type=&quot;String&quot; /&gt;
                            &lt;asp:Parameter Name=&quot;TYPE_CS_PK&quot; Type=&quot;Single&quot; /&gt;
                        &lt;/UpdateParameters&gt;
                    &lt;/asp:ObjectDataSource&gt;</pre>
Thanks in advance<b></b>

推荐答案

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



当我尝试从datagrid编辑行时出现此错误.我正在使用来自oracle的数据包过程.这是过程中的代码:



I have this error when I''m trying to edit a row from datagrid. 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_TYPE_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();
        }
    }



这是objectDataSource的.NET代码:



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>



我认为这是更好的观点:thumbsup:
请帮助我解决这个问题!!!!



I think this is better view :thumbsup:
Please help me with this problem !!!


问题是当我尝试编辑gridview时收到以下错误消息:

The problem is when I''m trying to edit 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



此消息在以下情况中被捕获为异常:



This message is catched as exception in:

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




UPDATECSYSTEM是我的PL/SQL过程.我认为我的问题在于我从objectDataSource发送的参数,但我不知道到底是什么.




UPDATECSYSTEM is my PL/SQL procedure. I think that my problem is with parameters that I''m sending from the objectDataSource but I don''t know what exactly is.


这篇关于更新oracle数据库的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆