‎2007 May 10 4:52 AM
what is mean by array fetch and what is the use of it
‎2007 May 11 11:18 AM
Hi,
Array fetch is noting but extracting all the field of a database table using * in the select clause.
for example select * from vbap
generally it should be avoid to improve the performance by selecting only required fields from the table as below
It is mostly used to fetch multiple records in a single command.
e.g.
select * from mara into table z_mara.
FYI:
Other type is sequential type, in which select...endselect is used and each recordis processed after fecthcing...
e.g.
select single * from mara
" process ur data
append mara into z_mara.
endselect.
Both of above statement performs same function but first one is using array fetch and second one is using sequential fetch.
Jogdand M B
‎2007 May 10 7:19 AM
The main difficulties is connecting the programming language with the sql interface is the transfer of retrieved data fecords..
when the system process an sql statement it does not know how long the result would be.
The system has to transfer these records to the calling of a program in the form of a structure that is an <b>array</b>.
*The disadvantage of the array is that it is a static definition..u have to specify the size before runtime..As u do noy know the size it will overflow.
<b>*<i>To avoid this problem sap system translates the open sql statements into an embeded sql...</i></b>
*To do this the system defines a cursor and the cursor is the logical connection to the selected datasets in the database and transfer between abap programs.
*This<u> <b>FETCH</b></u> operation passes one or more records to the database interface..
This is called as array fetch..
Reward if it's useful..
Regards,
Manoj @ Eminent.
‎2007 May 11 11:18 AM
Hi,
Array fetch is noting but extracting all the field of a database table using * in the select clause.
for example select * from vbap
generally it should be avoid to improve the performance by selecting only required fields from the table as below
It is mostly used to fetch multiple records in a single command.
e.g.
select * from mara into table z_mara.
FYI:
Other type is sequential type, in which select...endselect is used and each recordis processed after fecthcing...
e.g.
select single * from mara
" process ur data
append mara into z_mara.
endselect.
Both of above statement performs same function but first one is using array fetch and second one is using sequential fetch.
Jogdand M B
‎2007 May 11 2:17 PM