aiaiDBA

加微信获取免费职业规划+学习资料,了解年薪50万的DBA是如何练成的

13718043309

010-86462881

PCC-02445: USING clause valid only on a PREPAREd dynamic statement

PCC-02445: USING clause valid only on a PREPAREd dynamic statement
Cause: The USING clause was used with an OPEN cursor statement where the cursor declaration was not for a PREPAREd statement. The correct sequence of statements should be as follows EXEC SQL PREPARE s FROM :stmt; EXEC SQL DECLARE c CURSOR FOR s; EXEC SQL OPEN c USING ...;
Action: Use the PREPARE statement for the SQL statement and use that in the DECLARE CURSOR statement.

请先 登录 后评论

1 个回答

小智
PCC-02445:USING子句只对PREPAREd动态语句有效,
.原因: USING子句与OPEN游标语句一起使用,其中游标声明不是用于PREPAREd语句。正确的语句序列应该如下EXEC SQL PREPARE s FROM:stm??t; EXEC SQL DECLARE c CURSOR FOR s; EXEC SQL OPEN c使用...;,
.操作:对于SQL语句使用PREPARE语句,并在DECLARE CURSOR语句中使用该语句。,
.
请先 登录 后评论