ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » DB2 ODBC Error SQL0514 "Cursor not in Prepared State&qu

Post new topic  Reply to topic
 DB2 ODBC Error SQL0514 "Cursor not in Prepared State&qu « View previous topic :: View next topic » 
Author Message
wcrausch
PostPosted: Wed May 22, 2002 12:31 pm    Post subject: DB2 ODBC Error SQL0514 "Cursor not in Prepared State&qu Reply with quote

Novice

Joined: 28 Aug 2001
Posts: 17
Location: Denver, CO

Has anyone seen the following error (Application Log):

Database error: SQL State '26501'; Native Error Code '-514'; Error Text '[IBM][CLI Driver][DB2/NT] SQL0514N The cursor "SQLCUR4" is not in a prepared state. SQLSTATE=26501

Error executing SQL statement 'SELECT COUNT(*) FROM MQSIUID.PRODUCT T WHERE (T.PRNBR)=(?)' against datasource 'MAPPING' with parameters ''95001050', '.


I am running MQSi 2.0.2 (DB2 v7.1) on Windows NT 4 and am trying to read a local database.

Thanks for any help you can provide.

Bill
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
TorpedoSTu
PostPosted: Thu May 23, 2002 6:13 am    Post subject: Reply with quote

Acolyte

Joined: 14 Nov 2001
Posts: 73

Wotcher,

2 things


Generally the syntax is (I know it's daft but ....)

Select col,col from Database.Schema.DbName as X where X.col = condition)

So your ESQL should read ....

Set CounVar = THE (Select Count(*) from Database.Product as T where T.PRNBR = Var);

If you've got the syntax correct then I apologise.

second thing, make sure that ..

a: you've defined the Db to ODBC as a system datasource and
b: you've bound the Db to the DB2CLI ...

db2 bind c:\sqllib\bnd\@db2cli.lst blocking all grant public clipkg 5
Back to top
View user's profile Send private message Send e-mail
wcrausch
PostPosted: Thu May 23, 2002 6:17 am    Post subject: Reply with quote

Novice

Joined: 28 Aug 2001
Posts: 17
Location: Denver, CO

What does the bind statement do?
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
TorpedoSTu
PostPosted: Thu May 23, 2002 6:37 am    Post subject: Reply with quote

Acolyte

Joined: 14 Nov 2001
Posts: 73

It binds DB2 to the DB2CLI (Call Level. Interface).
You should do this for all db2 databases that u use with WMQI
Back to top
View user's profile Send private message Send e-mail
wcrausch
PostPosted: Thu May 23, 2002 6:56 am    Post subject: Reply with quote

Novice

Joined: 28 Aug 2001
Posts: 17
Location: Denver, CO

Should I do the bind or must I? I ask because most of the time, everything works okay. It is only once in a while I have problems.

Also, does it matter if it MQSi and not WMQI?
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
TorpedoSTu
PostPosted: Thu May 23, 2002 7:13 am    Post subject: Reply with quote

Acolyte

Joined: 14 Nov 2001
Posts: 73

I would alway bing the Db to the CLI and no, it makes no difference for MQSI or WMQI as it's the same thing really.
Back to top
View user's profile Send private message Send e-mail
Outdesign
PostPosted: Fri May 24, 2002 12:21 am    Post subject: Reply with quote

Apprentice

Joined: 16 Sep 2001
Posts: 38
Location: Hampshire, UK

To clarify the bind point ...

-> If you use the DB Control Center "Create Database Wizard" to create your
database then do *NOT* need to explicity perform the database bind.

-> If you use the DB2 Command Line Processor to issue the create database command
then you *DO* need to perform the database bind.

-> Refer to page 44 of the Websphere MQ Integrator for Windows NT and Windows 2000
Installation Guide under the heading "Binding the CLI package to the database".
Note, this is applicable to MQSIv2.0.* versions as well.


Quote:

Should I do the bind or must I? I ask because most of the time, everything works
okay. It is only once in a while I have problems.


-> Is your user database different to your broker database ?

-> The only once in a while when you have problems, is then when you access this
user database ? Or can you access this database elsewhere in your flows sucessfully ?

-> Your actual ESQL statement would be useful


FYI :

SQL0514N The cursor "<name>" is not in a prepared state.

Explanation: The application program tried to use a cursor "<name>" that is not
in a prepared state. The cursor is associated with a statement that either (1)
was never prepared, (2) was made not valid by a ROLLBACK, or (3) was made not valid
by either an explicit or implicit rebind of the package.

The statement cannot be processed.

User Response: For case (1), prepare the statement named in the DECLARE CURSOR statement
for "<name>" before you try to open the cursor. For case (2), do not issue a ROLLBACK
until after you finish using the cursor. For case (3), the prepare for the cursor must
be reissued.
Quote:
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » DB2 ODBC Error SQL0514 "Cursor not in Prepared State&qu
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.