^connect[connect string]{code}
Operator connect establishes connection to DB server. The code of the operator is processed by Parser within current connection.
When used as a module to Apacheor IIS) Parser caches connections to SQL-servers. In case a script attempts a connection with the same connect string twice, Parser doesn't connect to SQL-server but takes result of SQL-connection from cache, if connection is still valid.
CGI-version also caches connections, but for a single http request only. That is why you can certainly use such constructions as:
^connect[connect string]{…first SQL query…}
^connect[connect string]{…second SQL query…}
There will not be two SQL connections. It is especially useful when a connection is needed only sometimes and you cannot be sure you will always need it. In this case you may avoid doing it beforehand by doing it visually multiple times and be sure that the connection will not be broken.
We use the following methods and constructors to perform SQL-query: