PL / SQL如何在delete partition命令中插入变量?

时间:2014-02-07 11:05:14

标签: sql database plsqldeveloper

如何在pl / sql中的命令delete partition中传递变量名?例如:

DECLARE
   x varchar2 := 'hello';
BEGIN
ALTER TABLE t1 delete PARTITION(X);
END

可能吗?

1 个答案:

答案 0 :(得分:1)

DECLARE
   x varchar2 := 'hello';
BEGIN
   execute immediate 'alter table t1 delete partition('||x||')';
END;