我有一个PL / SQL块,我试图获取表格每列的填充值和未填充值,即" demo_table"。
select count(*) into v_count from demo_table
where owner='OWNER_1' and(rec.COLUMN_NAME is null OR
REGEXP_LIKE(rec.COLUMN_NAME,'^-$') OR REGEXP_LIKE (rec.COLUMN_NAME,'^-$'));
我正在通过dbms_output显示v_count
。但我无法得到统计数据。
这就是我在做的事情:
declare
CURSOR C1 IS
SELECT COLUMN_NAME FROM ALL_TAB_COLUMNS
WHERE TABLE_NAME ='demo_table';
v_count number(10);
begin
for rec in c1 loop
dbms_output.put_line(rec.COLUMN_NAME);
select count(*) into v_count from demo_table
where owner='OWNER_1'
and(rec.COLUMN_NAME is null
OR REGEXP_LIKE(rec.COLUMN_NAME,'^-$')
OR REGEXP_LIKE (rec.COLUMN_NAME,'^-$'));
dbms_output.put_line(v_count);
end loop;
dbms_output.put_line(v_count);
end;