testproc是表名,id是字段名
我想用id字段的类型,定义oid变量
可我这么写“oid testproc%id”,提示错误:
Compilation errors for PROCEDURE SCOTT.PROC_TESTError: PLS-00208: 标识符 'ID' 不是合法的游标属性
Line: 3
Text: oid testproc%idError: PL/SQL: Compilation unit analysis terminated
Line: 1
Text: CREATE OR REPLACE PROCEDURE proc_testError: Hint: Parameter 'oid' is declared but never used in 'proc_test'
Line: 3
Text: oid testproc%id
我想用id字段的类型,定义oid变量
可我这么写“oid testproc%id”,提示错误:
Compilation errors for PROCEDURE SCOTT.PROC_TESTError: PLS-00208: 标识符 'ID' 不是合法的游标属性
Line: 3
Text: oid testproc%idError: PL/SQL: Compilation unit analysis terminated
Line: 1
Text: CREATE OR REPLACE PROCEDURE proc_testError: Hint: Parameter 'oid' is declared but never used in 'proc_test'
Line: 3
Text: oid testproc%id
NAME
------------------------------
中国111111
中国2111111
已选择2行。SQL> set serverout on;SQL> declare
2 v_name t1.name%type;
3 begin
4 select name into v_name from t1 where rownum =1;
5 dbms_output.put_line(v_name);
6 end;
7 /
中国111111PL/SQL 过程已成功完成。