sql - Oracle 动态 SQL 中的缺失值错误。对于以下查询,其抛出缺失值关键字
问题描述
create or replace procedure temp_test_tb(A varchar2 ) is
lsql varchar(4000);
new_table_name varchar2(100);
fz_date timestamp(50);
begin
select timestamp(max(completion_dt)) into freeze_date from status where run_status=1;
new_table_name := 'common_' ||A|| '_' ||to_char(add_months(fz_date, -1), 'MON');
lsql:='insert into os_temp_tab_2'||
'select * from'||new_table_name||' WHERE ROWNUM<10';
execute immediate lsql;
commit;
end;
此查询引发错误
缺失值关键字
在甲骨文。我的插入表与插入表具有相同的列。
解决方案
from 之后缺少空格
' select * from '||new_table_name|| ' WHERE ROWNUM<10 ';
推荐阅读
- python - Link attribute not getting printed in BeautifulSoup object
- reactjs - How to pass data from GraphQL when in a React Component
- android - 如何使原生 Android WebRTC 语音聊天应用程序与 BT 耳机上的背景音乐一起工作
- c# - 更改 ListView SelectionMode 模板
- vue.js - Decimal Formatting in Vue Framework
- python-3.x - 不显示编码结果
- reporting-services - Is there an expression that will eliminate decimal places and display if value is null? SSRS 2012 Report Builder 3.0
- mysql - 在 MySql 中创建一个或多个视图的 UNION
- javascript - 如何使用跨域会话跟踪正确添加 url 参数?
- javascript - 如何根据 html 文件要求不同的 js 文件?