Programming Notes 
To optimize your SAP DB application program, remember the following programming notes:
·
In
SELECT statements,
identify the columns that you want to select.
·
Use
key specifications
to identify the table rows that need to be processed. You can
determine key columns from the
system
tables.
·
SELECT
statements with multiple result rows with no
ORDER clause do
not specify the order in which the table rows are read from the database
table. In this case, the logic of your application program
cannot assume that there is a specified order.,
·
You can use
the
SINGLE
SELECT statement to process individual rows in the SQL mode
INTERNAL.
·
Note the
different way of handling
named result
tables (CURSOR) in the different
SQL
modes.

For information on the special features of the SQL
mode ORACLE in the SAP DB database system, see the documentation
SQL Mode ORACLE: SAP
DB.
·
Inform
yourself about the
user and role
concept of the SAP DB database system.
·
Execute a
RELEASE
statement as the final SQL statement in your application
program. This releases the resources needed by the precompiler runtime
environment.
·
In the SAP DB
database system, remember that DDL statements such as CREATE TABLE are also
subject to the
transaction
concept, which means that they can be undone or that they must be
completed with a
COMMIT
statement.
·
Read the
information about the
locks in the
database, and define a suitable
isolation level
for your statements.
· Program reactions to possible TIMEOUT messages. You can do this by, for example, querying the structure component sqlcode after each SQL statement (see Database System Messages).

For more information on the meaning of the optimum
SQL statements and the available options, see
Optimizer: SAP
DB.