-- 执行的时候报错
create or replace procedure inj(p_date in date)
as 
    l_username all_users.username%type;
    c sys_refcursor;
    l_query varchar2(400);
begin 
    l_query := '
    select username from all_users where create = ''' ||p_date ||'''';

    dbms_output.put_line( l_query );
    open c for l_query;

    for i in 1 .. 5
    loop  
        fetch c into l_username ;
        exit when c%notfound;
        dbms_output.put_line( l_username || '......' );
    end loop;
    close c;
end;
/
