NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting a record in an Oracle database in Teststand

I am trying to create a new record into an Oracle database table using the insert command in Teststand 2.0. I have been able to do it using LabView. The problem is that the record does not exist as yet. So I don't what I should do in the OPEN SQL statement which creates a select statement. Also, when I try to do the operations the I can only see the columns with the "set and put" condition. "Put" shows me no columns. Using set and put I recieve an error telling me that the record is not updatable.
I am not rying to update a record. I am trying to enter a new record. I do set the new record indication the data operation step.

Is there a good write-up for using TestStand 2.0 step database operations? Is there any gotch-
yous with 2.0 that were corrected in 3.0?
0 Kudos
Message 1 of 2
(3,055 Views)
I think what you want to use is an INSERT statement rather than a select. See http://www.techonthenet.com/sql/insert.htm for an example. If you create an "Open SQL" step, then edit the SQL statement, you can create a string expression that has includes your parameters.

Example: "INSERT INTO supplier
(supplier_id, supplier_name)
VALUES
(" +Str(MyNumericValue)+ ", '" + MyStringValue+ "');"

Beware of single quotes (SQL string delimiter) versus double quotes (TestStand string delimiter).
0 Kudos
Message 2 of 2
(3,055 Views)