微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

用户缺少权限或找不到对象:<TABLE>

如何解决用户缺少权限或找不到对象:<TABLE>

我正在尝试使用如下存储过程在 Spring Boot 嵌入式 HsqlDB 中填充数据。

schema.sql 文件内容

CREATE TABLE COUNTRY
(NAME CHAR(6) NOT NULL,ID INT NOT NULL,PRIMARY KEY (ID));

CREATE PROCEDURE ACC_DETAILS(OUT newid INT,IN firstname VARCHAR(50))
    MODIFIES sql DATA
BEGIN ATOMIC
DECLARE temp_id INTEGER;
INSERT INTO COUNTRY VALUES (firstname,1);
SET newid = temp_id;
END

即使表 COUNTRY 创建语句在那里,我也得到异常说

nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker': Invocation of init method Failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute sql script statement #1 of URL [file:/C:/Dev/code/Portfolio-service/portfolio-service/target/test-classes/schema.sql]: CREATE TABLE COUNTRY (NAME CHAR(6) NOT NULL,PRIMARY KEY (ID)); CREATE PROCEDURE ACC_DETAILS(OUT newid INT,IN firstname VARCHAR(50)) MODIFIES sql DATA BEGIN ATOMIC DECLARE temp_id INTEGER; INSERT INTO COUNTRY VALUES (firstname,1); SET newid = temp_id; END ; nested exception is java.sql.sqlSyntaxErrorException: user lacks privilege or object not found: COUNTRY
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:769)

尝试了this question中提到的步骤,但没有成功

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。