Brandon,
Thanks for getting back to me.
I'm not quite sure what you mean. I'm using Teststand's sequence editor. Within this there are options for running SQL queries.
For connecting to Postgres, I'm using a .udl file that relies on a Postgres ANSI driver, which I believe came with my install of Postgres.
In any event, I think I've narrowed down my question a bit (now that I understand more how Teststand works).
When one runs an SQL query within Teststand you have the options of "Fetch previous," "Current," etc. This was connected to the default Access schema (UUT_RESULT) and a RUN_ID was generated on every "CREATE NEW RECORD."
I think the problem is that, when you run a "SELECT" query with the parameter set to "Create new record" Access will generate the RUN_ID before returning the results. With Postgres, it won't generate the RUN_ID until one inserts the "default values." Here is the SQL log of what Teststand is sending Postgres:
Mar 26 14:01:37 [postgres] [12-1] <46081865.1bcd>LOG: statement: SELECT uut_result.run_id, uut_result.station_id, uut_result.start_date_time FROM uut_re
sult
Mar 26 14:01:37 [postgres] [13-1] <46081865.1bcd>LOG: statement: INSERT INTO uut_result DEFAULT VALUES
To do this, I just have to run "set" and then "put" without setting or putting any specific values.
So here is my updated question:
If I run a new select query(over a new statement) and choose "Fetch next", each time I call that it will iterate through the select query, starting with the very first record. My question is, how can I tell it to stop when it gets to the last record, since there is no telling what the last record is? Or, in general, how can I get the values in the final record? We've changed the RUN_ID to simply be an incrementing integer, so if a MAX aggregate function can be run, that might work.
Any ideas?
Thanks,
Tim