gpt4 book ai didi

Pro-C 中的 SQL 查询失败,错误为 :02115

转载 作者:太空狗 更新时间:2023-10-29 16:56:48 25 4
gpt4 key购买 nike

我得到一些 Pro-C 程序的奇怪行为,如下所示:

#define BGHCPY_TO_ORA(dest, source) \
{ \
(void)strcpy((void*)(dest).arr, (void*)(source)); \
(dest).len = strlen((const char *)(dest).arr); \
}
#define BGHCPY_FROM_ORA(dest, source) \
{ \
(void)memcpy((void*)(dest), (void*)(source).arr, (size_t)(source).len); \
(dest)[(source).len] = '\0'; \
}

long fnSQLMarkProcessed (char *pszRowId, char *pszMarker)
{
BGHCPY_TO_ORA (O_rowid_stack, pszRowId);
BGHCPY_TO_ORA (O_cust_processed, pszMarker);

EXEC SQL
UPDATE document_all
SET processed_by_bgh = :O_cust_processed
WHERE rowid = :O_rowid_stack;

return (sqlca.sqlcode);
}

传递给上述函数的输入参数值是

pszRowId = [AAAF1lAAIAABOoRAAB], pszMarker=X

查询返回错误代码:02115 以及以下消息:

SQL Error:02115 Code interpretation problem -- check COMMON_NAME usage

我使用 Oracle 作为后端数据库。

任何人都可以向我提供有关此查询失败的可能原因的信息吗?

非常感谢任何帮助。

PRO-C 编译期间使用的标志定义如下:

------/u01/app/oracle/product/8.1.6/ORACLE_HOME/bin/proc `echo  -Dbscs5 -Dsun5 -I/export/home/bscsobw/bscs6/src/CoreDumpIssue/final_Code_Fix_004641  -DNDEBUG -DSunOS53 -D_POSIX_4SOURCES -I/usr/generic++/generic++2.5.3.64_bit/include  -DFEATURE_212298 -DBSCS_CONFIG -I/export/home/bscsobw/bscs6//src/bat/include -DFEATURE_00203808_GMD -DFEATURE_00241737  -DORACLE_DB_BRAND -I/u01/app/oracle/product/8.1.6/ORACLE_HOME/rdbms/demo -I/u01/app/oracle/product/8.1.6/ORACLE_HOME/precomp/public -I/export/home/bscsobw/bscs6/src/CoreDumpIssue/final_Code_Fix_004641/include -I../bat/include -DFEATURE61717 -DFEATURE52824 -DFEATURE56178 -DD236312_d -DSDP -g | sed -e 's/-I/INCLUDE=/g' -e 's/-D[^ ]=[^ ]*//g' -e 's/-D\([^ ]*\)/DEFINE=\1/g'` select_error=no   DEFINE=FEATURE61717 DEFINE=FEATURE52824 DEFINE=FEATURE56178 \
lines=yes iname=bgh_esql.pc oname=bgh_esql.c lname=bgh_esql.lis

最佳答案

我想,你看看这条消息:

[oracle@sb-rac02 ~]$ oerr sql 2115
02115, 00000, "Code interpretation problem -- check COMMON_NAME usage"
// *Cause: With PRO*FORTRAN, this error occurs if the precompiler option
// COMMON_NAME is specified incorrectly. **With other Oracle
// Precompilers, this error occurs when the precompiler cannot
// generate a section of code.**
// *Action: With Pro*FORTRAN, when using COMMON_NAME to precompile two or
// more source modules, make sure to specify a different common name
// for each module. With other Oracle Precompilers, if the error
// persists, call customer support for assistance.

因此您可以确定,该问题不在您的变量中。

请尝试像这样使用您的代码:

long fnSQLMarkProcessed (char *pszRowId, char *pszMarker)
{
BGHCPY_TO_ORA (O_rowid_stack, pszRowId);
BGHCPY_TO_ORA (O_cust_processed, pszMarker);

EXEC SQL UPDATE document_all
SET processed_by_bgh = :O_cust_processed
WHERE rowid = :O_rowid_stack;

return (sqlca.sqlcode);
}

关于Pro-C 中的 SQL 查询失败,错误为 :02115,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30251050/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com