从 table1 我想从某些列收集值。首先,我尝试将一张表复制到另一张表,但在尝试时卡住了:
for row in row_count
for column in column_count
insert into table2 at (x,y) value from (row,column)
column++
end
row++
end
Run Code Online (Sandbox Code Playgroud)
我计算行数的第一个函数是:
create or replace FUNCTION func_count_rows(table_name IN varchar2,
debug boolean default false)
RETURN number IS
total number(2) := 0;
BEGIN
IF debug = true THEN
DBMS_OUTPUT.put('Function count rows: ');
DBMS_OUTPUT.PUT_LINE('select count(*) from ' || table_name || ';');
DBMS_OUTPUT.put('Returns: ');
DBMS_OUTPUT.PUT_LINE('');
END IF;
execute immediate 'select count(*) from ' || table_name into total;
RETURN total;
END;
Run Code Online (Sandbox Code Playgroud)
然后我的程序首先打印值,但我卡在这里:
create …Run Code Online (Sandbox Code Playgroud)