09-19-2007 05:19 AM
09-20-2007 11:37 AM
09-20-2007 11:48 AM
09-20-2007 12:11 PM
Bill -
When we added the MySQL support, I could not get MySQL to return the value of an auto incremented field reliably, so using the Insert method is suggested. Also, you stated "(although in 4.0 it's got some bugs)" in your posting. Could you be more specific on the issues that you found and what you changed?
09-20-2007 12:48 PM
10-03-2007 08:09 PM
Having similar problem, but using the Database "Data Operation" step type configured for a "set and put" data operation instead of schemas. Is there a way to have teststand use an "INSERT" my SQL command whenever attempting to do a "put"? It just seems redundent to have to build the complete INSERT SQL command when the Data Operation step type encapsulates the function we need so nicely.
BTW, I'm a bit surprised that executing a teststand database operation results in syntax errors, or as you mentioned odd behaviour for supported databases. Spent better part of the day trying to figure out what I was doing wrong :-).
10-04-2007 03:01 PM
Heather -
The Database Operation step type does not know how to execute an SQL statement directly. Its purpose is to map values to columns for a SELECT statement or parameters for an INSERT statement or stored procedure. The Database Operation step can be executed multiple times for a single parameterized INSERT or stored procedure statement using the Set and Put operation. You may already know this, but if you want to execute a single SQL command once, you can use the Open Statement step by building the string SQL command as an expression, for example:
"INSERT INTO TABLE_NAME (COLNAME1, COLNAME2) VALUES(" + Str(Locals.Var1) ", " Locals.Str1 ")"
Hope this helps...
10-05-2007 01:00 PM
Thanks Bill, Very Helpful, but can you confirm the following:
a) When i select "Edit Data Operation" for a database Data operation, I should specify the Statement Handle associated with an INSERT SQL command.
b) The SQL Command specified in the Column/Parameters Values TAB is a SELECT command allowing Testand to load the column Names from the database.
What would the syntax be for the INSERT command, since the Column/Parameter Values specified must somehow get mapped into the COLUMN and VALUES string appended to the INSERT command?
I am currently building the insert string manually, as you suggested, and it works great. The benefit to using the Data Operation step type is that if It's easier to manage changes in the database table if I decide not to log certain measurements, or If I change a column name in my database. To do a proper job building the INSERT string, I would need to do what the Data Operation is doing already ... i.e. read the Schema from the table, and verify that the ColumnNames used in the insert command exist in the database, omitting those entries where no Column exists,
10-11-2007 09:14 AM
Heather -
a) When you use an INSERT statement like the one I posted, the SQL command connects to the table, inserts the values specified in the no recordset or parameters are returned. so the Data Operation step cannot be used. The INSERT statement like this stands by itself.
b) If you use an INSERT statement like this:
"INSERT INTO TABLE_NAME (COLNAME1, COLNAME2) VALUES(?, ?)"
the statement handle contains a parameterized statement that you execute multiple times in a Data Operation step. The Data Operation step must use the "Execute" operation and it will define 2 columns, one for COLNAME1 and another for COLNAME2. I think my previous posted incorrectly mentioned a Set and Put operation. The data types must match the cooresponding fields.
10-30-2007 02:55 AM