Oacle SQL error codes.

本文深入分析了SQL程序中遇到的两个常见错误:对象引用无效导致的Statement is ignored...和语法错误PLS-00103。通过详细解释错误原因并提供解决方案,帮助开发者解决SQL编程中遇到的问题。

1) The table/sequence in the procedure does not exist which cause "Statement is ignored ..."

SQL>@Logging.sql

LINE/COL ERROR

-------- -----------------------------------------------------------------
14/2     PL/SQL: Statement ignored

14/2     PLS-00905: object ECRPUSER.OS_DEBUG is invalid

2) PLS-00103, execute DDL in PS/SQL procedure which is not allowed directly. Should use 'EXECUTE IMMEDIATE'.

LINE/COL ERROR
-------- -----------------------------------------------------------------
4/1      PLS-00103: Encountered the symbol "DROP" when expecting one of
         the following:
         ( begin case declare exit for goto if loop mod null pragma
         raise return select update while with <an identifier>
         <a double-quoted delimited-identifier> <a bind variable> <<
         continue close current delete fetch lock insert open rollback
         savepoint set sql execute commit forall merge pipe purge

3) PLS-00103:  The code is written with ''BEGIN' but without 'END'.

PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

   ( begin case declare end exit for goto if loop mod null
   pragma raise return select update when while with
   <an identifier> <a double-quoted delimited-identifier>
   <a bind variable> << continue close current delete fetch lock
   insert open rollback savepoint set sql execute commit forall
   merge pipe purge


: Connection released: [id: 0][route: {}->http://192.168.12.59:6041][total kept alive: 1; route allocated: 1 of 20; total allocated: 1 of 200] 2025-08-29 09:54:39.783 DEBUG 21556 --- [ main] org.mybatis.spring.SqlSessionUtils : Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@68212585] 2025-08-29 09:54:39.925 DEBUG 21556 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loaded 11 bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml] 2025-08-29 09:54:39.933 DEBUG 21556 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'DB2' 2025-08-29 09:54:39.965 DEBUG 21556 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'Derby' 2025-08-29 09:54:39.968 DEBUG 21556 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'H2' 2025-08-29 09:54:39.970 DEBUG 21556 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'HDB' 2025-08-29 09:54:39.977 DEBUG 21556 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'HSQL' 2025-08-29 09:54:39.979 DEBUG 21556 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'Informix' 2025-08-29 09:54:39.980 DEBUG 21556 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'MS-SQL' 2025-08-29 09:54:39.983 DEBUG 21556 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'MySQL' 2025-08-29 09:54:39.985 DEBUG 21556 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'Oracle' 2025-08-29 09:54:39.988 DEBUG 21556 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'PostgreSQL' 2025-08-29 09:54:39.991 DEBUG 21556 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'Sybase' 2025-08-29 09:54:39.994 DEBUG 21556 --- [ main] o.s.jdbc.support.SQLErrorCodesFactory : Looking up default SQLErrorCodes for DataSource [com.depower.datasource.config.DynamicDataSource@3596a9d5] 2025-08-29 09:54:39.994 DEBUG 21556 --- [ main] o.s.jdbc.datasource.DataSourceUtils : Fetching JDBC Connection from DataSource 2025-08-29 09:54:39.997 DEBUG 21556 --- [ main] o.s.jdbc.support.SQLErrorCodesFactory : SQL error codes for 'TDengine' not found 2025-08-29 09:54:39.998 DEBUG 21556 --- [ main] o.s.jdbc.support.SQLErrorCodesFactory : Caching SQL error codes for DataSource [com.depower.datasource.config.DynamicDataSource@3596a9d5]: database product name is 'TDengine' 2025-08-29 09:54:40.007 DEBUG 21556 --- [ main] s.j.s.SQLErrorCodeSQLExceptionTranslator : Unable to translate SQLException with Error code '537', will now try the fallback translator 2025-08-29 09:54:40.020 DEBUG 21556 --- [ main] c.d.datasource.aspect.DataSourceAspect : clean datasource
最新发布
08-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值