我在以下程序中收到此错误'PLS-00306:错误数量或类型的参数': -
CREATE OR REPLACE procedure TEST1(p_cursor in out sys_refcursor)
as
sql_query varchar2(1000) := 'select UTL_ID,';
begin
for x in (select distinct tyt_id from GTEMP_TPOAR order by 1)
loop
sql_query := sql_query ||
'sum(case when tyt_id = '||x|| ' then cnt end)'|| x ||',';
dbms_output.put_line(sql_query);
end loop;
sql_query := RTRIM(sql_query, ',');
sql_query := sql_query || ' from GTEMP_TPOAR';
open p_cursor for sql_query;
end;
我正在使用oracle 10g
答案 0 :(得分:0)
我收到了错误。我必须使用x.tytid