使用%ROWTYPE居然报错?? CREATE OR REPLACE PACKAGE ss_syn_statdata AS PROCEDURE tb_ss_base_show ; END ss_syn_statdata; /
CREATE OR REPLACE PACKAGE BODY ss_syn_statdata AS
PROCEDURE tb_ss_base_show IS nCount NUMBER;
rec_tb tb_ss_base_show%ROWTYPE;
BEGIN SELECT count(*) INTO nCount from dual;
END tb_ss_base_show;
end ss_syn_statdata; /
以上语句保存为ss.sql,然后执行
SQL> start ss.sql
Package created.
Warning: Package Body created with compilation errors.
SQL> show err Errors for PACKAGE BODY SS_SYN_STATDATA:
LINE/COL ERROR -------- ----------------------------- 8/17 PLS-00310: with %ROWTYPE attribute, 'TB_SS_BASE_SHOW' must name a table, cursor or cursor-variable
8/17 PL/SQL: Item ignored SQL>
上面这个PLSQL居然报错,表是存在的。
------解决方案-------------------- 是同一个用户下的么? 执行下面语句有结果么: select * from TB_SS_BASE_SHOW;
------解决方案--------------------
PROCEDURE tb_ss_base_show IS 貌似表名和过程名字重复了~~
------解决方案-------------------- 正解