Background documentation Programming Notes Locate the document in its SAP Library structure

To optimize your SAP DB application program, remember the following programming notes:

·        In Structure linkSELECT statements, identify the columns that you want to select.

·        Use Structure linkkey specifications to identify the table rows that need to be processed. You can determine key columns from the Structure linksystem tables.

·        SELECT statements with multiple result rows with no Structure linkORDER 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 Structure linkSINGLE SELECT statement to process individual rows in the SQL mode INTERNAL.

·        Note the different way of handling Structure linknamed result tables (CURSOR) in the different Structure linkSQL modes.

Note

For information on the special features of the SQL mode ORACLE in the SAP DB database system, see the documentation Structure linkSQL Mode ORACLE: SAP DB.

·        Inform yourself about the Structure linkuser and role concept of the SAP DB database system.

·        Execute a Structure linkRELEASE 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 Structure linktransaction concept, which means that they can be undone or that they must be completed with a Structure linkCOMMIT statement.

·        Read the information about the Structure linklocks in the database, and define a suitable Structure linkisolation 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).

Note

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