新人在此 SELECT 语句中缺少 INTO 子句,该怎么解决麻烦告诉我
发布网友
发布时间:2023-07-09 10:11
我来回答
共1个回答
热心网友
时间:2023-10-08 14:51
CREATE OR REPLACE PROCEDURE PROADMININFO
(ADMINNAME in varchar2,ADMINPWD in varchar2)ISBEGINselect * from userinfo where loginid=ADMINNAME and password=ADMINPWD;
END PROADMININFO;
PROCEDURE ZXDRB.PROADMININFO 编译错误
错误:PLS-00428: 在此 SELECT 语句中缺少 INTO 子句行:5文本:select * from userinfo where loginid=ADMINNAME and password=ADMINPWD;
------解决方案--------------------------------------------------------要么使用游标,要么有几个字段定义几个变量如:SQL code CREATE OR REPLACE PROCEDURE PROADMININFO(ADMINNAME in varchar2, ADMINPWD in varchar2) IS cur_restdata tbl_rest_waiting_queue%rowtype;--定义游标 begin select * into cur_restdata from userinfo where loginid=ADMINNAME and password=ADMINPWD; end; END PROADMININFO;
------解决方案--------------------------------------------------------select 后面缺少赋值into给变量
------解决方案--------------------------------------------------------探讨要么使用游标,要么有几个字段定义几个变量如:SQL code
CREATE OR REPLACE PROCEDURE PROADMININFO(ADMINNAME in varchar2,
ADMINPWD in varchar……
------解决方案--------------------------------------------------------END PROADMININFO 前面来个end;
------解决方案--------------------------------------------------------在pl/sql程序中不允许出现不带into子句的select语句。
参考代码如下:如果查询出来只有一条记录
SQL code CREATE OR REPLACE PROCEDURE PROADMININFO (adminName in varchar2, adminPWD in varchar2) IS rec userinfo%ROWTYPE; BEGIN SELECT * INTO rec FROM UserInfo WHERE loginid = adminName AND password = adminPWD; END PROADMININFO;
------解决方案--------------------------------------------------------procere 不能仅仅只执行一个select语句。------解决方案--------------------------------------------------------查出来的数据应该有个容器来装它