Stored procedures 执行简单存储过程时得到编译警告,但编译错误如何查看

Stored procedures 执行简单存储过程时得到编译警告,但编译错误如何查看,stored-procedures,plsql,Stored Procedures,Plsql,在执行一个简单的存储过程时得到一个编译警告,但编译错误如何看 以下是查询: create procedure spgetdat as begin select empis empname, empadd from tb1employees; end; 执行上述查询时,出现错误。请提出需要纠正的地方 问候 Jitendra过程中的Select语句不正确。PL/SQL块内的select语句中应该有into子句。 它可以像下面这样。您必须为选择一条记录设置where条件,或者为了获得最佳实践,您还

在执行一个简单的存储过程时得到一个编译警告,但编译错误如何看

以下是查询:

create procedure spgetdat
as 
begin
select empis empname, empadd from tb1employees;
end;
执行上述查询时,出现错误。请提出需要纠正的地方

问候
Jitendra过程中的Select语句不正确。PL/SQL块内的select语句中应该有into子句。 它可以像下面这样。您必须为选择一条记录设置where条件,或者为了获得最佳实践,您还可以使用游标获取多条记录

create procedure spgetdat
as 
v_empis tab1employees.empis%type;
v_empadd tab1employees.empadd%type;
begin
select empis empname ,empadd into v_empis,v_empadd from tb1employees where empis = 'given name' ;
end;
show errors;

请在提出问题时显示您的努力程度。如果select语句生成的记录超过1条,则需要使用collection。