NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Teststand/SyBase ASA database problem

We have a SyBase SQL Anywhere Studio 8.0.1 database for Teststand.
We use the default schema with recordset(SELECT) with the ASA ODBC driver (dbodbc8.dll).

When running our Teststand application against the SyBase database, a new row is inserted OK in the parent table UUT_RESULT, but it's not able to retrieve the foreign key value for the next recordset from UUT_RESULT.ID (It tries to create a new row with FK-value 0, wich violates the RI constrict).

We get the following Run-Time Error dialog:

Details:
An exception occurred calling 'LogResults' in 'ITSDBLog' of 'DBLog 1.0 Type Library'
An error occurred executing a statement.
Schema: ASA Recordset.
Statement: STEP_RESULT.
Error in rowIntegrity constraint violation: No prim
ary key value for foreign key 'UUT_RESULT_FK' in table 'STEP_RESULT'

Source: TSDBLog

Error Code:
-2147467259; User-defined error code.

Location:
Step 'Log Results to Database' of sequence 'Log To Database' in 'Database.seq'
-------------------------------------------------------

Any hints on what's wrong, or where to look for help?


Best regards
Ola Fjellheim
________________________________________

Company: Vestfold Engineering as
Work: (+47) 3308 4409
Fax: (+47) 3308 4401
e-mail: ola.fjellheim@ve-as.no
________________________________________
0 Kudos
Message 1 of 2
(3,095 Views)
Hello Ola -

There are only a few things that I can think of to try in your case as I am not familiar with your database. The first thing to check is on the 'Statements' tab for your table, investigate the settings of your 'Cursor Location' to make sure it is pointing to the server. This way you can guarantee that whatever you're seeing will be what the server sees. If you toggle this setting to 'server' and behavior doesn't change, or if your database is already working with a server cursor, then you may want to consider having the client side define the key via a GUI ID. Unfortunately we at National Instruments cannot provide much advice about how to build keys for databases, we recommend you look into the tools provided with your database software to find fun
ctions / procedures that could help. One additional item is, it sounds as though you are using the ODBC driver when talking to your database, it might be worth it to try communicating with your database via the provider's specific driver.

Regards,

Elaine R.
National Instruments
http://www.ni.com/support
0 Kudos
Message 2 of 2
(3,095 Views)