これを確認して、エラーが発生した理由を教えていただけますか? どのように見えるべきですか?ここで何が問題なのかわかりません。関数でテーブルを作成する必要があり、同じ関数でこのテーブルにデータを挿入します。
create or replace
function new_tab ( pyt IN varchar2) return number
IS
a number;
b varchar2(20);
begin
a:= ROUND(dbms_random.value(1, 3));
b:='example';
-- This works perfect
execute immediate 'CREATE TABLE create_tmp_table'|| a ||'(i VARCHAR2(50))';
-- Here`s the problem
execute immediate 'insert into create_tmp_table'||a|| 'values ('|| b ||')';
exception
when others then
dbms_output.put_line('ERROR-'||SQLERRM);
return 0;
end;
私の結果は次のとおりです。
ERROR-ORA-00926: missing VALUES keyword. Process exited.
間違いはどこですか?