Intro to ABAP - Chapter 11_v1

3
ABAP Native SQL | Document 2.11 | August-2003 Slide 1 IBM Global Services © Copyright IBM Corporation 2003 Using ABAP Native SQL EXEC SQL. EXEC SQL. <any SQL statement> <any SQL statement> ENDEXEC. ENDEXEC. In this example, the program creates a table in the Oracle database, which is not known to the ABAP Dictionary. The newly created The newly created database database table is populated table is populated using an using an SQL INSERT statement. SQL INSERT statement.

Transcript of Intro to ABAP - Chapter 11_v1

Page 1: Intro to ABAP - Chapter 11_v1

ABAP Native SQL | Document 2.11 | August-2003 Slide 1

IBM Global Services

© Copyright IBM Corporation 2003

Using ABAP Native SQL

EXEC SQL.EXEC SQL.<any SQL <any SQL

statement>statement>ENDEXEC.ENDEXEC.

In this example, the programcreates a table in the Oracledatabase, which is not knownto the ABAP Dictionary.The newly created The newly created databasedatabasetable is populated using table is populated using ananSQL INSERT statement.SQL INSERT statement.

Page 2: Intro to ABAP - Chapter 11_v1

ABAP Native SQL | Document 2.11 | August-2003 Slide 2

IBM Global Services

© Copyright IBM Corporation 2003

SELECT Using ABAP Native SQL Data retrieved

using the SELECT statement is

transported to the ABAP program

using Host Variables.

A Host Variable is any data itemA Host Variable is any data itemthat is defined by the ABAP that is defined by the ABAP program and used inside an program and used inside an ABAP Native SQL Statement. ABAP Native SQL Statement. They must be preceded by a They must be preceded by a

colon.colon.

DefinedUsed These are Host These are Host VariablesVariables

Page 3: Intro to ABAP - Chapter 11_v1

ABAP Native SQL | Document 2.11 | August-2003 Slide 3

IBM Global Services

© Copyright IBM Corporation 2003

ABAP Native SQL and the PERFORMING Option

The PERFORMING The PERFORMING <form> option creates <form> option creates

a looping structure a looping structure that for every that for every

row retrieved, the row retrieved, the subroutine is called.subroutine is called.