LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

LabWindows CVI and SQL Toolkit cursor/schema error

We are using CVI 8.5 and SQL Toolkit 2.0.6 to write data to a SQL Server 2008 database.  We are utilizing the Microsoft ODBC SQL Server (non-native) driver.  We build a transaction that calls stored procedures on the database to write the data.  Occasionally we get the following error:

 

"Could not complete cursor operation because the table schema changed after the cursor was declared"

 

The error is unusual since we only use one cursor and it is in a stored procedure that gets called by other software hundreds of times a day and never fails.  Our database is also designed to only append records, not change existing ones.  We're trying to pinpoint the error and I'm wondering if anyone knows if the SQL Toolkit uses cursors to build transactions or if this error has been seen by others.  Since upgrading the toolkit or drivers takes a lot of effort, I want to make sure that I understand the problem before I start throwing darts at it.  Thanks in advance for any insight.

0 Kudos
Message 1 of 5
(3,388 Views)

Hi CareFish,

 

Have you been able to track down what line is producing the error?

 

Regards,

KyleP
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,371 Views)

I've attached the function that's failing.  Unfortunately, the code isn't designed with much resolution as to what SQL toolkit call failed, since these calls haven't failed once validated and put into the production environment.  Can you tell if any of these functions use a cursor.  I could certainly try adding more resolution to the error handling, but since we've only seen errors occasionally in the production environment, I'd need to release a temp version and monitor it.  Let me know what you think.  Thanks.

0 Kudos
Message 3 of 5
(3,368 Views)

If you could try increasing the precision to which we can error check, that would really help us out. I haven't seen anything in NI's documentation yet that alludes to the behavior you're seeing. If you track down where it's coming from, let us know.

 

Cheers,

KyleP
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,354 Views)

The problem has cured itself.  It's almost like the database or server is caching information and it takes some number of transactions to clear it.  If I see it again, I'll increase the error resolution and re-post.  Thanks.

Message 5 of 5
(3,347 Views)