0

我正在使用以下代码根据作为参数传入的天数从表中删除数据。Tablename, DateColumnName and Numberofdays是参数。

  EXECUTE IMMEDIATE 'DELETE FROM' || UPPER (TRIM (TabName)) || ' WHERE' || TRUNC(DATECOLUMN)  || '<= TRUNC(SYSDATE) - ' || NUMBEROFDAYS ;

但它给我一个错误PLS-00357: TABLE VIEW or Sequence reference 'TABLE_NAME' not allowed in this context.

我希望plsql能够像这样处理查询 DELETE FROM TABLE_NAME WHERE DUE_DATE <= TRUNC(SYSDATE) - 5 我错过了什么吗?

4

0 回答 0