Technical FAQs

Ask a Question

In Vijeo Citect 7.3, a new function called SQLCreate is available for connecting to a database. I would like to know the difference between SQLConnect and SQLCreate functions.

The differences is that SQLcreate (unlike SQLconnect) doesn't actually connect to a database. You have to use it with conjunction with SQLOpen reference.
But the main difference is that SQLconnect is a blocking function and SQLcreate is not. A blocking function can not be excecuted as a foreground
task (foreground tasks used to display items on runtime page means having highest priority) so, for example you can't execute SQLconnect as a cicode
object on a page, but SQLcreate will work. 

If you are going to call the data logging through events, this means it is a periodic event & is a background task, so either function can be used. In term of
performance,also as per the document it looks that SQLCreate+SQLOpen is a better option. Although, it may NOT be a good idea to do connect/disconnect
to a DB or open/close a DB every minute. I would write cicode in such way that you can connect (or create + open) to a DB at the beginning of your runtime session,
then just do logging every minute, then close the connection at the end of the runtime session (so you don't do connect/disconnect or create/dispose every minute). 

Was this helpful?
What can we do to improve the information ?