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 />

/*<br />

** 1. CONNECT TO 'connect_string'<br />

*/<br />

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

CONNECT TO 'progress:T:localhost:6745:salesdb' AS 'conn_1' ;<br />

/*<br />

** 2. CONNECT TO DEFAULT. This suspends the conn_1 connection<br />

** and sets the DEFAULT connection current<br />

*/<br />

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

CONNECT TO DEFAULT ;<br />

/*<br />

** Application processing against the DEFAULT database<br />

*/<br />

.<br />

.<br />

.<br />

/*<br />

** 3. DISCONNECT DEFAULT<br />

*/<br />

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

DISCONNECT DEFAULT ;<br />

/*<br />

** 4. Set the first connection, conn_1, current<br />

*/<br />

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

SET CONNECTION conn_1 ;<br />

/*<br />

** Application processing against the database in the connect_string<br />

*/<br />

.<br />

.<br />

.<br />

/*<br />

** 5. DISCONNECT the conn_1 connection, which is the current connection.<br />

*/<br />

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

DISCONNECT CURRENT ;<br />

Notes • When you specify DISCONNECT connection_name or DISCONNECT CURRENT and there is<br />

also an established connection to the DEFAULT database, the connection to the DEFAULT<br />

database becomes the current connection. If there is no DEFAULT database, there is no<br />

current connection after the <strong>SQL</strong> engine processes the DISCONNECT.<br />

• The DISCONNECT DEFAULT statement terminates the connection to the DEFAULT database. If<br />

this connection is the current connection, there is no current connection after this<br />

DISCONNECT statement is executed.<br />

Authorization<br />

None<br />

Related statements<br />

CONNECT, SET CONNECTION<br />

329

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

Saved successfully!

Ooh no, something went wrong!