|
|
|
|
|
Written by Anon.
|
|
Friday, 09 March 2007 |
Native SQL is to be avoided! Read on to see why....
Open SQL is SAPs version of SQL. Open SQL is written to isolate the code from a specific RDBMS; thereby, creating database independence. The Native SQL interface passes all SQL statements to the database without modifying them. In some cases, Open SQL does not allow you to take advantage of database specific features. Disadvantages of Native SQL Native SQL bypasses SAP's internal database interface, thereby, creating the following problems: - No table logging on SAP level during Native SQL operations
- Synchronous match codes are not updated by Native SQL operations
- No synchronization of the SAP table buffer
- SQL statements become database dependent. This may cause numerous porting problems between database versions
Advantages of Native SQL With the new SQL capabilities of SAP Release 4.0 Native SQL is only of interest in the following cases: - Use of set operations (UNION, INTERSECT, MINUS)
- Use of database specific features
If Native SQL must be used and has been approved, adhere to the following guidelines: - Don't use Native SQL for operations that make database structure modifications
- Isolate EXEC SQL statements in their own INCLUDE files
- Document the reason for using Native SQL with detailed comments inside the INCLUDE file
- Be careful when reading long fields and raw fields! Length information is additionally stored within the field, invisible for Open SQL.
- Never use SELECT * when selecting from SAP tables since the Data Dictionary can create fields on the DB in a different order than displayed in SAP
Related Items:
|
|
|
|