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

OPEN sql & -ve SQL ST

Former Member
0 Likes
877

what is diff b/n open sql and -ve sql.

7 REPLIES 7
Read only

Former Member
0 Likes
839

Difference:

Open Sql

DATA wa TYPE spfli.

SELECT SINGLE carrid connid cityfrom cityto

INTO CORRESPONDING FIELDS OF wa

FROM spfli

WHERE carrid EQ 'LH' AND connid EQ '0400'.

IF sy-subrc EQ 0.

WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.

ENDIF.

Native SQL.

DATA: BEGIN OF wa,

connid TYPE spfli-connid,

cityfrom TYPE spfli-cityfrom,

cityto TYPE spfli-cityto,

END OF wa.

DATA c1 TYPE spfli-carrid VALUE 'LH'.

EXEC SQL PERFORMING loop_output.

SELECT connid, cityfrom, cityto

INTO :wa

FROM spfli

WHERE carrid = :c1

ENDEXEC.

FORM loop_output.

WRITE: / wa-connid, wa-cityfrom, wa-cityto.

ENDFORM.

check in the Abap Examples in SE38 for more details

Bala.M

Read only

Former Member
0 Likes
839

Open SQL is SAPs version of SQL and is guaranteed to run on all database platforms. Native SQL is particular to the databaase you are using and therefore is not necessarily portable to different databases.

I find native SQL to be slower.

Rob

Read only

Former Member
0 Likes
839

hi

good

Native sql statements change according to the database, where as the open sql statements are abap statements and they goto the database utility and convert them to native sql statements and pass it to database.

thanks

mrutyun^

Read only

Former Member
0 Likes
839

Hi

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
839

hi,

open SQL:

ABAP/4 code is portable between databases. To access the database in an ABAP/4 program you will code SAP’s Open SQL. Open SQL is a subset and variation of ANSI SQL. The ABAP/4 interpreter passes all Open SQL statements to the database interface part of the work process. There, they are converted to SQL that is native to the installed RDBMS. For example, if you were running an Oracle database, your ABAP/4 Open SQL would be converted by the database interface to Oracle SQL statements.

If you use Open SQL, your SQL statements will be passed to the database interface. Using Open SQL has three main advantages. All of these advantages are implemented via the database interface.

Portability

The first advantage is the fact that your SQL statements will be portable between databases. For example, if for some reason your company wanted to switch from an Oracle to an Informix database, it could change the database, and your ABAP/4 code would continue to run without modification.

Buffering Data on the Application Server

Secondly, the database interface buffers information from the database on the application server. When data is read from the database, it can be stored in the buffers on the application server. If a request were then made to access the same records, they would already be on the application server, and the request is satisfied from the buffer without having to go to the database. This buffering techniques reduces the load on the database sever and on the network link between the database and the application servers, and can speed up database access time by a factor of 10 to 100 times.

Automatic Client Checking

The third advantage of using Open SQL is automatic client handling. With Open SQL, the client field is automatically populated by the database interface. This gives your development and testing teams many advantages, such as ability to perform multiple simultaneous testing and training on a single database without interference from each other.

reward if its useful

Read only

Former Member
0 Likes
839

hi,

ABAP Native SQL

ABAP Native SQL allows you to include database-specific SQL statements in an ABAP program. Most

ABAP programs containing database-specific SQL statements do not run with different databases. If

different databases are involved, use Open SQL. To execute ABAP Native SQL in an ABAP program, use

the statement EXEC.

ABAP Open SQL

Subset of standard SQL statements.

To avoid conflicts between database tables and to keep ABAP programs independent from the database

system used, SAP has generated its own set of SQL statements known as Open SQL.

Using Open SQL allows you to access all database tables available in the R/3 System, regardless of the

manufacturer.

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 helps, Do reward.

Read only

Former Member
0 Likes
839

open sql general sql, which do not based on any database (oracle/access) for all it is same

native sql is specific to its language.

oracle has its own set of commands

access has its own set of commands

but in OPen sql , for all there is only one set of commands

Reward if useful