Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

difference between open sql and native sql statements

Former Member
0 Likes
1,419

HI,

I want to know the difference between open sql and native sql statements.

actually i donot know about sql statements.

thanks,

Gangi Reddy

7 REPLIES 7
Read only

Former Member
0 Likes
995

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.

Read only

Former Member
0 Likes
995

Hi,

<b>Native SQL Commands:</b>

The Commandss that are specific to the Database(i.e. some SQL commands of 'Oracle' wont work with 'My SQL'.). Should be written in EXEC statement in ABAP.

<b>Open SQL Commands:</b>

The commands that are not specific for a particular Database( i.e. no matter whether Oracle or My SQL is the database the commands work directly in ABAP)

Award points if useful

Read only

Former Member
0 Likes
995

<b>Open SQL</b>

Goes through a SQL parser in ABAP before going on to database, ABAP automatically converts it depending on databse type.

<b>native SQL</b>

this is independent of parser and directly operates on database, not advisable to use since when u do some changes to database system, u will have to change code also

hope that helped

Read only

Former Member
0 Likes
995

Hi,

Native SQL is the Query language which is relavant to database query.

Open SQL is the query language which is adopted by SAP,as SAP can use any RDBMS like Oracle, MS SQl Server etc, in order to have common query language which is accessbale to use any above RDBMS. Once you write any query in ABAP it is convert into native SQL and retive the data from the database.

Thanks,

Sriram Ponna.

Read only

0 Likes
995

HI

is there any difference between native sql and standard sql statements.

Read only

Former Member
0 Likes
995

SAP as you know uses different database systems. And each database system has its own way of accessing and modifying the database. This is done through its own SQL queries also called Native SQL in SAP jagron.

However SAP gives you the advantage to use a common SQL query for all the database that are compatible with SAP so that it becomes easier to code, transport and understand the programs. Besides the same program can be used in SAP systems with different configurations.

For further reference you can go through the following link:

http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3969358411d1829f0000e829fbfe/content.htm

Regards,

Rajesh.

<b>Please reward points if found helpful.</b>

Read only

Former Member
0 Likes
995

hii setti,

check it out.

<b>open sql</b>-set of abap statements

-perform operations on central database.

-opearations and error messages are independent of database system in use.

<b>native sql</b>- allows to access database tables.

-declared in abap DDIC regardless of the database platform you are using.

ok?

-maharshi.

.