동적 SQL에서 테이블을 업데이트하고 싶습니다. 동적 SQL - 테이블 변수를 사용하는 테이블 업데이트
declare
x varchar2(10) := 'table_n';
begin
execute immediate 'update :1 set column_n = 12345' using x;
end;
나는 ORA-00903를 얻을 : 유효하지 않은 테이블 이름
그러나
declare
x varchar2(10) := 'table_n';
begin
execute immediate 'update ' || x || ' set column_n = 12345';
end;
작품.
첫 번째 해결 방법은 무엇입니까? 더 클릭 여기 들어
1.It generally uses the SQL statements at run time. (for the time which we don't have data at the compilation time).
2. The bind variable , in your query, `x`, uses it on runtime and execute the dynamic on run time.
3. the bind variable refered by colon is used after USING clause.
: