2007 Jan 23 7:18 AM
Hi All,
I have to fetch the records from Database table using Index, how can i write the query using Index. Can any body plz send me the sample code.
Help Me,
Balu.
2007 Jan 23 7:26 AM
Hello Bala,
You donot need to specify the index in your select statement. Just include the fields on which the index is created in the where clause of the select statement, The optimizer will choose the appropriate index at run-time so as to optimize the performance.
Regards,
Manoj
Hi All,
I have to fetch the records from Database table using Index, how can i write the query using Index. Can any body plz send me the sample code.
Help Me,
Balu.
2007 Jan 23 7:23 AM
Hi,
See the below Example.
select * from vbak up to 100 rows
into table t_vbak
where vbeln > v_vbeln.
sort t_vbak by vbeln descending.
read table t_vbak index 1.
Regards,
Ram
Pls reward points if helpful.
2007 Jan 23 7:26 AM
Hi All,
I have to give the Index in the select query only when i am retrieving the data from database table, how to write the query , can any body send me th code.
Balu.
2007 Jan 23 7:26 AM
Hello Bala,
You donot need to specify the index in your select statement. Just include the fields on which the index is created in the where clause of the select statement, The optimizer will choose the appropriate index at run-time so as to optimize the performance.
Regards,
Manoj
2007 Jan 23 7:30 AM
when we creating the table, primary index will creeated automatically. Other than this we can created the secondary indexes. so we writing the select query, the sap itself will select the correct index with respect to the fields u specified in the select query
2007 Jan 23 7:33 AM
Hi All,
I am having indexes on the database table, can i use those indexes in the select query, how to write that,
Help me,
Balu.
2007 Jan 23 7:35 AM
Just specify the fields on which those indexes are created in the where clause of the select statement. The optimizer will choose the best index at run-time. You will not be able to specify an index EXPLICITLY with the select statement.
Hope this helps.
Manoj
2007 Jan 23 7:35 AM
check the fields that is specified in the index. after that use that field in the select query. so sap will take that index only
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |