DB2 iSeries - 无法从存储过程访问 table
DB2 iSeries - not able to access table from stored proc
我正在使用 JDBC 驱动程序访问 DB2 iSeries 版本 6.3。调用存储过程失败,出现以下错误:
[SQL0204] GENHST in TSTUSR type *FILE not found.
连接字符串是:
jdbc:as400://db2.abc.com/DBName;naming=system;libraries=*LIBL;block size=512;lob threshold=0;package library=QGPL;prompt=false;translate binary=true;remarks=system;cursor hold=false;
当我使用与用于 JDBC 连接的相同用户和相同连接字符串的 Squirrel 客户端连接时,我能够在 GENHST table 中查看数据。存储过程引用 GENHST table,但未指定架构名称。
请提供任何想法。可能出了什么问题?
编辑:
如果我从连接字符串中删除数据库名称并将包含存储过程的模式添加到连接字符串中,问题就解决了。
jdbc:as400://db2.abc.com/;naming=system;libraries=*LIBL,PROC_SHEMA;block size=512;lob threshold=0;package library=QGPL;prompt=false;translate binary=true;remarks=system;cursor hold=false;
我不太明白这是怎么回事。
这在 documentation 行 4 中进行了描述。在 URL 上指定的默认 SQL 模式和指定的“库”属性
Default SQL schema is what is specified in the URL. Library list is not searched to resolve unqualified name in SQL statements.
我正在使用 JDBC 驱动程序访问 DB2 iSeries 版本 6.3。调用存储过程失败,出现以下错误:
[SQL0204] GENHST in TSTUSR type *FILE not found.
连接字符串是:
jdbc:as400://db2.abc.com/DBName;naming=system;libraries=*LIBL;block size=512;lob threshold=0;package library=QGPL;prompt=false;translate binary=true;remarks=system;cursor hold=false;
当我使用与用于 JDBC 连接的相同用户和相同连接字符串的 Squirrel 客户端连接时,我能够在 GENHST table 中查看数据。存储过程引用 GENHST table,但未指定架构名称。
请提供任何想法。可能出了什么问题?
编辑:
如果我从连接字符串中删除数据库名称并将包含存储过程的模式添加到连接字符串中,问题就解决了。
jdbc:as400://db2.abc.com/;naming=system;libraries=*LIBL,PROC_SHEMA;block size=512;lob threshold=0;package library=QGPL;prompt=false;translate binary=true;remarks=system;cursor hold=false;
我不太明白这是怎么回事。
这在 documentation 行 4 中进行了描述。在 URL 上指定的默认 SQL 模式和指定的“库”属性
Default SQL schema is what is specified in the URL. Library list is not searched to resolve unqualified name in SQL statements.