Hi,
one of our customers randomly gets an invalid cursor error in our software (oracle 11 database): Is it possible to get the name of the invalid cursor programmatically? What is the simplest solution to trace such errors?
Invalid Cursor - Methods to trace the error?
Re: Invalid Cursor - Methods to trace the error?
Well, assuming the error is coming from within your application, then you can trap and process the error details with SAM_SqlError in Appl. Actions, or locally in When SqlError.
Once your code is there, then use the TD SqlErrorXXX and SqlExtractArgs functions to get details about the cursor, and so on. Sounds like perhaps the cursor/handle wasn't connected before being used in a Sql command.
Once your code is there, then use the TD SqlErrorXXX and SqlExtractArgs functions to get details about the cursor, and so on. Sounds like perhaps the cursor/handle wasn't connected before being used in a Sql command.
Jeff Luther @ PC Design
Palm Springs, California
Palm Springs, California
Re: Invalid Cursor - Methods to trace the error?
I also had this idea. But unfortunately the SAM_SqlError message is not fired.
You may take a look at my code sample.
You may take a look at my code sample.
You do not have the required permissions to view the files attached to this post.
Re: Invalid Cursor - Methods to trace the error?
I see this too. I back-converted to v5.2 & v4.2 (I first ran your test in v6.3) and see the same issue. It seems that TD is treating that SqlExecute() call in a special way and ignoring the local When SqlError and immediately calling its default error processing. Just a guess, but calling SqlExecute() by itself isn't correct coding, either.unfortunately the SAM_SqlError message is not fired.
If you run my attached mod. to your test, where I first would call SqlConnect() instead, then the code works as you've written it. The local When SqlError code is first called. Then because you do not have a Return TRUE/FALSE in that code, TD next runs your global SAM_SqlError code. And with no Return T/F in that code last TD's own default internal processing is called.
You do not have the required permissions to view the files attached to this post.
Jeff Luther @ PC Design
Palm Springs, California
Palm Springs, California
Re: Invalid Cursor - Methods to trace the error?
Thanks for your explanations. I'll have a look into it.
(BTW: I know, that I should connect to database before calling SQLExecute()
(BTW: I know, that I should connect to database before calling SQLExecute()

Re: Invalid Cursor - Methods to trace the error?
Invalid Cursor means the cursor is not connected - has a null value. So no chance of SAM_SqlError. Virtually no way of finding it.
Also happens when the server is down or not pinging - the cursor has a value - but no server.
Also happens when the server is down or not pinging - the cursor has a value - but no server.
Who is online
Users browsing this forum: [Ccbot] and 1 guest