nested exception is java.sql.SQLSyntaxErrorException: ORA-02289: 序列不存在(详细讲解)

简介: nested exception is java.sql.SQLSyntaxErrorException: ORA-02289: 序列不存在(详细讲解)

nested exception is java.sql.SQLSyntaxErrorException: ORA-02289: 序列不存在(本人详细的讲解本人处理的经过结果)


这是我报错的idea的conslie:


一开始解决的时候就直接看了报错去百度了,自己并没有认真的去看,为什么报错;经过百度一波之后,依然没有解决我的问题;没有办法,自己静下心来看了下自己的报错;其实控制台 很明显可以看出来,只是自己懒得看 不愿意去看;



重点就在这:下面详细解释下这段话

SELECT seq_sys_file_info.NEXTVAL as fileId FROM DUAL 

DUAL :是oracle 数据库中的虚拟表,并不是真实存在的

XX_id_seq:这个是我们创建序列时自定义的一个序列名称 (seq_sys_file_info 我的是这个)

seq_sys_file_info.nextval:这个是取出(seq_sys_file_info )序列的下的一个值


现在大家知道他的意思就可以清楚的理解为什么会报错;

因为他想去seq_sys_file_info 这个序列拿一个东西 ,可seq_sys_file_info他是不存在,所有肯定拿不到;


下面就开始报错了 所有清楚了 为什么会有问题;解决起来就比较舒服了;


下面我们去到数据库;我的是oralce


打开库找到序列:




上面是我新增后的 之前并么有seq_sys_file_info 他的序列;

我们下面说下怎么新增


seq_sys_file_info 是我需要新增的序列名

create sequence seq_sys_file_info
minvalue 2000
maxvalue 9999999999
start with 2020
increment by 1
cache 20;


模板为:

create sequence   “需要新增的序列的名字”
minvalue 2000
maxvalue 9999999999
start with 2020
increment by 1
cache 20;


执行成功了;

运行下看看:

成功了;


希望可以帮助大家;

我这这里详细介绍的不是这个解决问题;

是希望大家有一个好思路,认真去想问题,自己可以一步一步的解决问题,为什么会有这个错误,他的出现代表了什么,我们需要缩小范围,然后具体化,细致化;


谢谢指导我的大哥们,一直教我怎么去解决问题,而不是帮我去解决问题;

相关文章
|
8天前
Exception in thread “main“ java.lang.NoClassDefFoundError: freemarker/template/Configuration
Exception in thread “main“ java.lang.NoClassDefFoundError: freemarker/template/Configuration
29 0
|
6天前
|
搜索推荐 Java 开发者
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 问题处理
【5月更文挑战第14天】org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 问题处理
32 1
|
1天前
|
运维 Java 程序员
【JAVA学习之路 | 提高篇】异常(Exception)
【JAVA学习之路 | 提高篇】异常(Exception)
|
8天前
|
Java
springboot项目出现Exception in thread “main“ java.lang.NoClassDefFoundError: javax/servlet/Filter
springboot项目出现Exception in thread “main“ java.lang.NoClassDefFoundError: javax/servlet/Filter
19 0
|
8天前
|
Java
Java Exception打印及输出到日志
有时候如果打印出异常的错误,并记录下来,这里记录一下
58 5
|
8天前
|
SQL Java 数据库连接
解决bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符
解决bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符
29 0
|
8天前
|
Java Maven Spring
SpringBoot运行出现 Lookup method resolution failed; nested exception is java.lang.IllegalStateException
SpringBoot运行出现 Lookup method resolution failed; nested exception is java.lang.IllegalStateException
210 0
|
8天前
|
Java 应用服务中间件
SprinBoot项目启动报错Exception in thread “main“ java.lang.reflect.InvocationTargetException
SprinBoot项目启动报错Exception in thread “main“ java.lang.reflect.InvocationTargetException
172 0
|
8天前
|
Java Spring
上传文件出现 aximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.
上传文件出现 aximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.
15 0
|
6天前
|
SQL API 流计算
实时计算 Flink版产品使用合集之在Mac M1下的Docker环境中开启SQL Server代理的操作步骤是什么
实时计算Flink版作为一种强大的流处理和批处理统一的计算框架,广泛应用于各种需要实时数据处理和分析的场景。实时计算Flink版通常结合SQL接口、DataStream API、以及与上下游数据源和存储系统的丰富连接器,提供了一套全面的解决方案,以应对各种实时计算需求。其低延迟、高吞吐、容错性强的特点,使其成为众多企业和组织实时数据处理首选的技术平台。以下是实时计算Flink版的一些典型使用合集。
21 1