Sql prepare and unprepare with SilkPerformer ODBC
Currently working on ODBC and I'm using the OdbcPrepare functions etc.
I've found that when you use your OdbcExecute call, then immediately after the sp_execute you get sp_unprepare (as seen in SQL Server profiler - trace).
Surely, the point of using a prepare is so you can use the same sql statement many times throughout your session, with the ability to change the parameters each time you execute. But this doesn't seem the case, given that OdbcExecute is automatically unpreparing the statement.
If you want to pass different parameters then when you execute the SQL all parameters and iterations are done in one go and then the statement is unprepared as this would be how the example works in the online help.
Suppose I want to bound values to the statement for three different iterations, is it possible to call each iteration when I like during the session? It appears not, unless I have it wrong.
Thanks in advance.
Re: Sql prepare and unprepare with SilkPerformer ODBC
Are you closing the database connection after the ODBCExecute? If so this will probably unprepare the SQL statement.
Prepared SQL statements have to be reused on the same database connection.