最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501
当前位置: 首页 - 科技 - 知识百科 - 正文

Oracle动态SQL注意细节ORA-00911:无效字符

来源:懂视网 责编:小采 时间:2020-11-09 12:02:17
文档

Oracle动态SQL注意细节ORA-00911:无效字符

Oracle动态SQL注意细节ORA-00911:无效字符:group by trunc(INSERTTIME),TO_CHAR(INSERTTIME, lv_sql:=' insert into ETL_SUCESS_AMOUNT select SEQ_OS_ETL_AMOUNTID.NEXTVAL AS AMOUNTID,1,AMOUNT_DATA,AMOUNT_HOUR, serviceid,portalid,mouduleid,actionid,RESERVE1_ID,RESERVE2_ID,RESERVE3_ID, RE
推荐度:
导读Oracle动态SQL注意细节ORA-00911:无效字符:group by trunc(INSERTTIME),TO_CHAR(INSERTTIME, lv_sql:=' insert into ETL_SUCESS_AMOUNT select SEQ_OS_ETL_AMOUNTID.NEXTVAL AS AMOUNTID,1,AMOUNT_DATA,AMOUNT_HOUR, serviceid,portalid,mouduleid,actionid,RESERVE1_ID,RESERVE2_ID,RESERVE3_ID, RE

group by trunc(INSERTTIME),TO_CHAR(INSERTTIME,

lv_sql:='
insert into ETL_SUCESS_AMOUNT
select SEQ_OS_ETL_AMOUNTID.NEXTVAL AS AMOUNTID,1,AMOUNT_DATA,AMOUNT_HOUR,
serviceid,portalid,mouduleid,actionid,RESERVE1_ID,RESERVE2_ID,RESERVE3_ID,
RESERVE4_ID,AMOUNT,AMOUNT_TIME
from
(
select
trunc(INSERTTIME) AS AMOUNT_DATA,
TO_CHAR(INSERTTIME,''HH24'') AS AMOUNT_HOUR,
serviceid,portalid,mouduleid,actionid,
NULL AS RESERVE1_ID,
NULL AS RESERVE2_ID,
NULL AS RESERVE3_ID,
NULL AS RESERVE4_ID,
count(*) AS AMOUNT,
SYSDATE AS AMOUNT_TIME
from '||lv_table_name||'
where inserttime > to_date(:1,''yyyy-mm-dd hh24:mi:ss'')
and inserttime < to_date(:2,''yyyy-mm-dd hh24:mi:ss'')
group by trunc(INSERTTIME),TO_CHAR(INSERTTIME,''HH24''),serviceid,mouduleid,portalid,actionid
)';
execute immediate lv_sql USING p_sdate,p_edate;

-- 细节动态语句里面不需要分号

--细节(''HH24'') 动态语句里面单引号要双写

--细节 from '||lv_table_name||' 语句之间注意空格符号

--细节使用参数:1 USING p_sdate,p_edate;

linux

声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文档

Oracle动态SQL注意细节ORA-00911:无效字符

Oracle动态SQL注意细节ORA-00911:无效字符:group by trunc(INSERTTIME),TO_CHAR(INSERTTIME, lv_sql:=' insert into ETL_SUCESS_AMOUNT select SEQ_OS_ETL_AMOUNTID.NEXTVAL AS AMOUNTID,1,AMOUNT_DATA,AMOUNT_HOUR, serviceid,portalid,mouduleid,actionid,RESERVE1_ID,RESERVE2_ID,RESERVE3_ID, RE
推荐度:
标签: sql oracle 细节
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top