oracle中的pl/sql中使用select 要用into变量的形式:create or replace procedure testselect(p_out out number) is v_count number; begin select count(*) into v_count from g_language; <--要加分号 p_out:=v_count; <--返回值 ,当然你还可以进行其他操作 end ;--看pl/sql基础类的书,入门会快些.
create or replace procedure testselect(p_out out number) is v_count number; begin select count(*) into v_count from g_language; p_out:=v_count; end ; /
create or replace procedure aa is a varchar2(10); begin select id into a from tablename end ;
v_count number;
begin
select count(*) into v_count from g_language; <--要加分号
p_out:=v_count; <--返回值 ,当然你还可以进行其他操作
end ;--看pl/sql基础类的书,入门会快些.
v_count number;
begin
select count(*) into v_count from g_language;
p_out:=v_count;
end ;
/
a varchar2(10);
begin
select id into a from tablename
end ;