n_opentsql() performs the initialization required to perform a
Texis SQL query. It returns a pointer to a structure that will be
required by the
n_settsql(), n_exectsql(), n_gettsql() and
n_closetsql() functions. It takes one argument that is an opened
SERVER pointer (from
pointer must remain open as long as the
TSQL is open.
TSQLPN on failure.
...tsql() family calls will take the
pointer as their first argument.
n_closetsql() cleans up all data used used by
It takes the
TSQL pointer to close as its only argument.
This must be called before shutting the
SERVER connection given
n_closetsql() always returns TSQLPN.
/* connect to the local host on the default port */
n_setdatabase(se,database); /* set the database to use */
if((ts=n_opentsql(se))!=TSQLPN) /* initialize the Texis SQL API */
/* ... perform SQL processing ... */
n_closetsql(ts); /* shutdown the Texis SQL API */
closeserver(se); /* disconnect from the server */
openserver(), n_settsql(), n_gettsql()