declare
str varchar2(500); //定动态SQL
c_1 varchar2(10);
r_1 test%rowtype;
begin
c_1:='测试人员';
//定义动态SQLstr 用 := 赋值 ;入参用 :
str:='select * from test where name=:c WHERE ROWNUM=1'; //
execute immediate str into r_1 using c_1; //入参c对应c_1,查询结果赋给r_1
DBMS_OUTPUT.PUT_LINE(R_1.NAME||R_1.ADDRESS);
end ;