cancel
Showing results for 
Search instead for 
Did you mean: 

ST05 Trace Query

Former Member
0 Kudos

Hi,

Can anyone tell me what this SQL does?

SELECT WHERE "MANDT" = '530' AND "LGNUM" = 'FG3' AND "LGTYP" = 'BLK' AND "LGPLA" = 'BB015' FOR UPDATE

This is the detail when click "Explain" button on ST05

SELECT

/*+

FIRST_ROWS

*/

*

FROM

"LAGP"

WHERE

"MANDT" = :A0 AND "LGNUM" = :A1 AND "LGTYP" = :A2 AND "LGPLA" = :A3

FOR UPDATE

What is the words "FOR UPDATE" means?

Can we specify index any index to speed up the query?

Accepted Solutions (1)

Accepted Solutions (1)

former_member603052
Contributor
0 Kudos

Hi Eida,

The SQL statements you see in SQL Trace ST05 are open SQL Statements(understood to SAP) and not native SQL statements.

FOR UPDATE in that Query means the user you are tracing ran a transaction,made changes and saved(this gets update query which is shown to you.)

Regards,

Kalyan

Answers (2)

Answers (2)

ashish_vikas
Active Contributor
0 Kudos

I havn't seen a SQL tagged with "FOR UPDATE" ...

Probable its because you have copied it from trace your are finding it. It should not be present in ST04>detailed analysis>SQLs ... try to find it there ...

This SQl is simply selecting all the rows of table LAGP which satisfy mentioned condition in where clause ...

As its not using index on table LAGP, tuning may help if size of table LAGP is large...

Former Member
0 Kudos

Hello Eida,

Can anyone tell me what this SQL does?

SELECT WHERE "MANDT" = '530' AND "LGNUM" = 'FG3' AND "LGTYP" = 'BLK' AND "LGPLA" = 'BB015' FOR UPDATE

It means it will select some records from a table from client 530 and it will update(save those records in a database) those records

Rohit