I used 4 Sql Handlers for many years, one for select, the second for update, the third for delete and fourth for insert.
Now I only use one for all operations. I see no difference whether I use one Sql Handle or whether I use 4 Sql Handles.
What is good practice for usage of Sql Handles?
this denpends on the application, but I would say, an average application will have 2 - 4 sql handles. You should check if you use x different connetions or 1 connection with x cursors. This is set in sql.ini (enablemultibleconnections). The difference is, if you use different connections, they will block each other if you have an uncommited update. With multible cursors, you can fetch a result in cursor b after cursor a has updated the value without a commit. If you update a value in a fetch loop, you will need at least two cursors, and you should prepare the statment with SqlPrepare before starting to fetch, and use only SqlExecute within the loop (the prepare of an SqlPrepareAndExecute takes aprox. 90% of the time, but high end databases have a statement cache).
Who is online
Users browsing this forum: No registered users and 0 guests