defineコマンドを使用しようとしているときにエラーが発生しています。そうでなければ、コードは正常に動作します。defineコマンドを使用して、 。定義するb_table = '&テーブル名を入力してください';カラムの名前と共にテーブルから空のカラムを見つけることができないようにする
declare
v_count number;
cursor c2 is select Column_name
from all_tab_columns
where table_name= '&b_table';
begin
for r1 in c2 loop
dbms_output.put_line(r1.column_name);
select count(r1.column_name) into v_count
from HR.'&b_table';
if v_count =0 then
dbms_output.put_line(v_count);
end if;
end loop;
end;
old 5: where table_name= '&b_table';
new 5: where table_name= ' enter the table name';
old 11: from HR.'&b_table';
new 11: from HR.' enter the table name';
from HR.' enter the table name';
*
ERROR at line 11:
ORA-06550: line 11, column 9:
PL/SQL: ORA-00903: invalid table name
ORA-06550: line 10, column 1:
PL/SQL: SQL Statement ignored
最初の行を試してみてください。 定義するb_table = '&テーブル名を入力してください'; –
編集を使って上記の行を入力し、コード – dube
の書式を少し書いてください。 – NoobEditor