ORA-06550:第1行第7列:PLS-00306:调用'USP_LOGIN'ORA-06550时参数的数量或类型错误:第1行第7行:PL / SQL:语句被忽略 [英] ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'USP_LOGIN' ORA-06550: line 1, column 7: PL/SQL: Statement ignored

查看:1110
本文介绍了ORA-06550:第1行第7列:PLS-00306:调用'USP_LOGIN'ORA-06550时参数的数量或类型错误:第1行第7行:PL / SQL:语句被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在oracle中创建了sp。



I have created sp in oracle .

CREATE OR REPLACE PROCEDURE Usp_Login2(
          user_id IN INT,
          user_name  IN VARCHAR2,
          password IN VARCHAR2
)
AS
    --D_USERID INT;
    D_USERNAME VARCHAR2(50);
    D_PASSWORD VARCHAR2(50);
BEGIN
    SELECT UserName, PASSWORD 
        INTO  D_USERNAME, D_PASSWORD
        FROM   MST_USERS 
        WHERE  USERNAME = user_name
        AND   PASSWORD  = password;

END;





asp.net代码如下





asp.net code is below

public UserBO ValidateLogin(string userName, string password)
        {
            UserBO tmpObjUserBO = null;

            try
            {
                tmpObjUserBO = new UserBO();
                Initialize(StoredProcedure.validateLogin);
                //kimsCmd.Parameters.Clear();
                //KimsDB.AddInParameter(kimsCmd, Parameter.UserId, DbType.Int32, userId);
                KimsDB.AddInParameter(kimsCmd, Parameter.UserName, DbType.String, userName);
                KimsDB.AddInParameter(kimsCmd, Parameter.Password, DbType.String, password);
                
                using (IDataReader reader = KimsDB.ExecuteReader(kimsCmd))
                {
                    if (reader.Read())
                    {
                        if (reader["logininfo"] != null)
                        {
                            tmpObjUserBO.LoginSuccess = Convert.ToString(reader["logininfo"]);
                        }
                        if (tmpObjUserBO.LoginSuccess == "Login success")
                        {
                            tmpObjUserBO.ValidationRequired = false;
                            tmpObjUserBO.UserId = ParseIntValue(reader["userid"]);

                            tmpObjUserBO.RoleId = ParseIntValue(reader["RoleId"]);
                        }
                    }
                }
            }
            catch (OracleException)
            {
                throw;
            }
            catch (Exception)
            {
                throw;
            }
            return tmpObjUserBO;
        }
    }

推荐答案

错误是说当你调用存储过程时你没有传入正确的参数数量。你的SP需要3个参数而你只传了2个,因为你注释掉了传递给user_id的行。



The error is saying that when you called the stored procedure you did not pass in the right number of parameters. Your SP expects 3 parameters and you only passed 2 because you commented out the line which passes in the user_id.

//KimsDB.AddInParameter(kimsCmd, Parameter.UserId, DbType.Int32, userId);





您需要从存储过程中删除user_id作为参数或将其传入。



You need to remove user_id as a parameter from your stored procedure or pass it in.


这篇关于ORA-06550:第1行第7列:PLS-00306:调用'USP_LOGIN'ORA-06550时参数的数量或类型错误:第1行第7行:PL / SQL:语句被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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