Object Tables   «Prev 

SQL Query example in Oracle

SELECT product_id, product_name
FROM product_obj_table
WHERE product_id=39;

Reference 1 The SELECT clause
Reference 2 The FROM clause
Reference 3 The WHERE clause

Implicit SQL Cursor Attributes

The Oracle database allows you to access information about the most recently executed implicit cursor by referencing the special implicit cursor attributes. Because the cursors are implicit, they have no name, and therefore the keyword SQL is used to denote the implicit cursor.

Implicit SQL cursor attributes for queries

SQL%FOUND Returns TRUE if one row (or more, in the case of BULK COLLECT INTO) was fetched successfully, and FALSE otherwise (in which case the database will also raise the NO_DATA_FOUND exception).
SQL%NOTFOUND Returns TRUE if a row was not fetched successfully (in which case the database will also raise the NO_DATA_FOUND exception), and FALSE otherwise.
SQL%ROWCOUNT Returns the number of rows fetched from the specified cursor thus far. For a SELECT INTO, this will be 1 if a row was found and 0 if the database raises the NO_DATA_FOUND exception.
SQL%ISOPEN Always returns FALSE for implicit cursors because the database opens and closes implicit cursors automatically.