Skip to Content
avatar image
Former Member

ST05 Trace Query

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 05, 2009 at 06:54 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 23, 2009 at 04:35 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 23, 2009 at 11:01 PM

    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...

    Add comment
    10|10000 characters needed characters exceeded