informix
INFORMIX-ESQL/C Programmer's Manual
ESQL/C Function Library

sqlstart()

The sqlstart() function starts an implicit default connection. An implicit default connection can support one connection to the default database server (that the INFORMIXSERVER environment variable specifies).

Tip: Restrict use of sqlstart() to pre-Version 6.0 applications that only use one connection. ESQL/C continues to support this function for backward compatibility with these applications. For applications of Version 6.0 and later, use the CONNECT statement to establish explicit connections to a default database server.

Syntax

Usage

ESQL/C provides the sqlstart() function for pre-Version 6.0 applications that can only support single connections. In this context, possible uses of sqlstart() are as follows:

If you have a pre-Version 6.0 application that needs an implicit default connection for any other reason, use the DATABASE statement instead of sqlstart(). For applications of Version 6.0 and later, use the CONNECT statement to establish database server connections.

When you call the sqlstart() function, make sure that the application has not yet established any connections, implicit or explicit. When the application has established an explicit connection, sqlstart() returns error -1811. If an implicit connection was established, sqlstart() returns error -1802.

You can call this function several times before you establish an explicit connection, as long as each implicit connection is disconnected before the next call to sqlstart(). For information on disconnecting, see Terminating a Connection. For more information on explicit and implicit connections, see Establishing a Connection.

Return Codes

0 The call to sqlstart() was successful.
<0 The call to sqlstart() was not successful.


INFORMIX-ESQL/C Programmer's Manual, Version 9.21
Copyright © 1999, Informix Software, Inc. All rights reserved