23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

E<strong>SQL</strong> elements and statements<br />

328<br />

EXEC <strong>SQL</strong><br />

CONNECT TO DEFAULT ;<br />

/*<br />

** C Language and embedded <strong>SQL</strong> application processing against the<br />

** database in the connect_string<br />

*/<br />

.<br />

.<br />

.<br />

EXEC <strong>SQL</strong><br />

DISCONNECT DEFAULT ;<br />

After you issue DISCONNECT ALL there is no current connection. The following example<br />

disconnects all database connections:<br />

EXEC <strong>SQL</strong><br />

DISCONNECT ALL;<br />

The following example illustrates the CONNECT, SET CONNECTION, and DISCONNECT statements<br />

in combination using these steps:<br />

1. CONNECT TO connect_string AS connection_name, which establishes a connect_string<br />

connection to the database in the connect_string; the connection has the name 'conn_1'.<br />

2. CONNECT TO DEFAULT, which establishes a connection to the DEFAULT database and sets this<br />

connection current.<br />

3. DISCONNECT DEFAULT, which disconnects the connection to the DEFAULT database.<br />

4. SET CONNECTION connection_name, which sets the 'conn_1' connection current.<br />

5. DISCONNECT CURRENT, which disconnects the 'conn_1' connection.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!