create or replace procedure batchInsertCompanyRole  as
Cursor companyIdCursor is select company_id from(select  count(*) num,company_id from platform_role t group by company_id) where num=1;
companyId varchar2(32);
begin
for companyId in companyIdCursor loop
begin
 dbms_output.put_line(companyId);
end;
end loop;
end batchInsertCompanyRole;报错:wrong number or types of arguments in call to 'put_line'

解决方案 »

  1.   

    dbms_output.put_line(companyId);改成dbms_output.put_line(companyId.company_id);
      

  2.   

    create or replace procedure batchInsertCompanyRole as
    Cursor companyIdCursor is select company_id cid from(select count(*) num,company_id from platform_role t group by company_id) where num=1;
    companyId varchar2(32);
    begin
    for companyId in companyIdCursor loop
    begin
     dbms_output.put_line(companyId.cid);
    end;
    end loop;
    end batchInsertCompanyRole;