最新文章专题视频专题问答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
当前位置: 首页 - 科技 - 知识百科 - 正文

关于ORA-00907:missingrightparenthesis问题整理

来源:动视网 责编:小采 时间:2020-11-09 11:18:42
文档

关于ORA-00907:missingrightparenthesis问题整理

关于ORA-00907:missingrightparenthesis问题整理:在写存储过程的时候,在把系统时间格式转换用于与数据库字段做比较,当我test时抛出ORA-00907: missing right parenthesis,缺省右括 在写存储过程的时候,在把系统时间格式转换用于与数据库字段做比较,当我test时抛出ORA-00907: missing
推荐度:
导读关于ORA-00907:missingrightparenthesis问题整理:在写存储过程的时候,在把系统时间格式转换用于与数据库字段做比较,当我test时抛出ORA-00907: missing right parenthesis,缺省右括 在写存储过程的时候,在把系统时间格式转换用于与数据库字段做比较,当我test时抛出ORA-00907: missing


在写存储过程的时候,在把系统时间格式转换用于与数据库字段做比较,当我test时抛出ORA-00907: missing right parenthesis,缺省右括

在写存储过程的时候,在把系统时间格式转换用于与数据库字段做比较,当我test时抛出ORA-00907: missing right parenthesis,缺省右括号;

下面是我的出错代码:

dynamic_sql := 'select t3.departmentcode, t3.total from (select departmentcode,count(*) total from ' || str_tablename || ' where (LASTUPDATEDTIME between to_date(to_char(sysdate-1,"yyyy-mm-dd") ,''yyyy-mm-dd'') and to_date(to_char(sysdate,"yyyy-mm-dd") ,''yyyy-mm-dd'')) and departmentcode is not NULL group by departmentcode) t3,v_s_data_input_dept_usernum t4 where t3.departmentcode = ' || str_departmentcode || '';

更正后,执行成功的代码:

dynamic_sql := 'select t3.departmentcode, t3.total from (select departmentcode,count(*) total from ' || str_tablename || ' where (LASTUPDATEDTIME between to_date(''' || to_char(sysdate-1,'yyyy-mm-dd') || ''',''yyyy-mm-dd'') and to_date(''' || to_char(sysdate,'yyyy-mm-dd') || ''',''yyyy-mm-dd'')) and departmentcode is not NULL group by departmentcode) t3,v_s_data_input_dept_usernum t4 where t3.departmentcode = ' || str_departmentcode || '';

红色的部分对比

希望对出现类似错误的有所帮助

还有第二种情况

(Oracle测试)使用SQL语句的select语句是经常会用到字段和表的的别名,使用要注意,字段的别名前面可以加as关键字,或是省略不写,但是表名的别名前面不可以加as,否则会报如下错误:

命令出错, 行: 11 列: 20
错误报告:
SQL 错误: ORA-00907: 缺失右括号
00907. 00000 - "missing right parenthesis"
*Cause:
*Action:

文档

关于ORA-00907:missingrightparenthesis问题整理

关于ORA-00907:missingrightparenthesis问题整理:在写存储过程的时候,在把系统时间格式转换用于与数据库字段做比较,当我test时抛出ORA-00907: missing right parenthesis,缺省右括 在写存储过程的时候,在把系统时间格式转换用于与数据库字段做比较,当我test时抛出ORA-00907: missing
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top