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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SET CATALOG<br />

Example<br />

Syntax<br />

56<br />

The default behavior is for the transaction to wait until it obtains the required lock or until<br />

it times out waiting for the lock.<br />

The following example demonstrates the WITH clause in the SELECT statement:<br />

FOR UPDATE clause<br />

Specifies update intention on the rows selected by the SELECT statement.<br />

OF [ table.]column_name , ...<br />

NOWAIT<br />

Specifies the table’s column name to be updated.<br />

Causes the SELECT statement to return immediately with an error if a lock cannot be<br />

acquired on a row in the selection set because of the lock held by some other transaction.<br />

The default behavior is for the transaction to wait until it obtains the required lock or until<br />

it times out waiting for the lock.<br />

Note If you specify FOR UPDATE, the database acquires exclusive locks on all the rows satisfying the<br />

SELECT statement. The database does not acquire row level locks if there is an exclusive lock on<br />

the table. See the LOCK TABLE statement for information on table locking.<br />

SET CATALOG<br />

Syntax<br />

SELECT * FROM Customer WHERE “CustNum” < 100 ORDER BY “CustNum” FOR<br />

UPDATE<br />

WITH (READPAST WAIT 1);<br />

FOR UPDATE [ OF [ table.]column_name , ... ] [ NOWAIT ]<br />

Changes the default catalog name to be used for schema, table, and column references. The<br />

default catalog name is initially the name of the primary database.<br />

SET CATALOG catalog_name;<br />

catalog_name<br />

Catalog name to be used as an alias for the database in schema, table and column<br />

references. This must be in the form of an <strong>SQL</strong> identifier of up to 32 bytes in length.<br />

Example In this example, the auxiliary database connection identified by the catalog named mydb1 is<br />

specified as the default catalog:<br />

SET CATALOG mydb1;

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

Saved successfully!

Ooh no, something went wrong!