cancel
Showing results for 
Search instead for 
Did you mean: 

Open Sql and Native Sql

Former Member
0 Kudos

Hi all,

Can anyone explain me the diference between open sql and native sql ? The select statements we use belongs to which category ?

Regards,

Varun.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

From the help on "open SQL"

Open SQL

Open SQL is a set of ABAP/4 commands which perform operations on database tables. The results of these operations and associated error messages are independent of the database system used. Open SQL thus offers you unified SQL syntax and semantics for different database systems (see Portability). An ABAP/4 program which uses these commands can be run on database systems supported by SAP without modification.

From the help on Native SQL

Native SQL

Native SQL allows you to perform operations on databases over and above those in the Open SQL command set. In contrast to Open SQL, Native SQL supports not only operations on the local database active in the R/3 System, but also on any external databases.

We normally use open SQL, but in some case when you want to say look at the upper case value of an upper/lower case field in a database, you can use native SQL.

Native SQL seems somewhat slower and you have to know which databse you will be using it on before coding.

For more information type EXEC in the editor and press F1.

Rob

Answers (4)

Answers (4)

Former Member
0 Kudos

HI VARUN,

OPEN SQL STMTS ARE THE ONE WHICH ARE DATABASE INDEPENDENT QUERIES. YOU CAN USE THESE STMTS IN YOUR ABAP PROG. REGARDLESS OF THE DATABASE.

NATIVE SQL ARE THE QUERIES FOR THAT PARTICULAR DBASE USED, WHICH WE RARELY USE IN ABAP.

BUT MAJORITY OF THE TIMES ABAP PRG.USES THE OPEN SQL AND WE DONOT NEED TO BOTHERED BY THE NATIVE SQL AND ABOUT THE DATABASE TOO, WHEN YOU ARE USING OPEN SQL.

YOU WANT TO KNOW MORE.LET ME KNOW.

REGARDS,

RAVI.

ferry_lianto
Active Contributor
0 Kudos

Hi Varun,

Open SQL allows you to access all database tables known to the SAP system, regardless of the database manufacturer. Sometimes, however, we may want to use database-specific SQL statements called Native SQL in your ABAP/4 program. To avoid incompatibilities between different database tables and also to make ABAP/4 programs independent of the database system in use, SAP has created a set of separate SQL statements called Open SQL. Open SQL contains a subset of standard SQL statements as well as some enhancements which are specific to SAP. A database interface translates SAP's Open SQL statements into SQL commands specific to the database in use. Native SQL statements access the database directly.

Hope this will help.

Regards,

Ferry Lianto

Former Member
0 Kudos

Open SQL is a set of ABAP/4 commands which perform operations on

database tables. The results of these operations and associated error

messages are independent of the database system used. Open SQL thus

offers you unified SQL syntax and semantics for different database

systems (see Portability). An ABAP/4 program which uses these commands

can be run on database systems supported by SAP without modification.

***************************

Native SQL allows you to perform operations on databases over and above

those in the Open SQL command set. In contrast to Open SQL, Native SQL

supports not only operations on the local database active in the R/3

System, but also on any external databases.

Former Member
0 Kudos