#3 Parsing of a multiline trace event.

closed
nobody
None
9
2004-07-26
2004-07-12
No

Hi Paul,
you can see the newse source of our scanning modul at:

http://cvs.sourceforge.net/viewcvs.py/etprof/etprof/Test/test_etscan.py?rev=1.8&view=auto

Now we have to work out how to define the grammar for
the trace-entry with multipe lines :

PARSING IN CURSOR #6 len=181 dep=0 uid=8564 oct=6
lid=8564 tim=1314794115 hv=1049137217 ad= '712a38b0 '
UPDATE SIEBEL.S_EVT_ACT SET
LAST_UPD_BY = :1,
MODIFICATION_NUM = :2,
APPT_START_DT = :3,
LAST_UPD = :4
WHERE
ROW_ID = :5 AND MODIFICATION_NUM = :6
END OF STMT

This entry is constructed out of a ParsingInHeader

PARSING IN CURSOR #6 len=181 dep=0 uid=8564 oct=6
lid=8564 tim=1314794115 hv=1049137217 ad= '712a38b0 '

After this the lines ( 1..n ) of the SQL

UPDATE SIEBEL.S_EVT_ACT SET
LAST_UPD_BY = :1,
MODIFICATION_NUM = :2,
APPT_START_DT = :3,
LAST_UPD = :4
WHERE
ROW_ID = :5 AND MODIFICATION_NUM = :6

After this the End-marker of the SQL and the End of
ParsingInSection

END OF STMT

The QUESTION IS HOW WE WOULD DEFINE THE GRAMMAR FOR THIS:
The header is no Problem for us.
we want to have the SQL parsed as one 'Item'
Do you have an idea?

regards Carl r.

Discussion

1 2 > >> (Page 1 of 2)
    • summary: Parsing of a mulitline trace event. --> Parsing of a multiline trace event.
     
    • priority: 5 --> 9
    • status: open --> pending
     
    • status: pending --> open
     
  • Paul McGuire
    Paul McGuire
    2004-07-13

    Logged In: YES
    user_id=893320

    Carl -

    Have you tried something like:

    ZeroOrMore( ~Literal("END OF STATEMENT") + restOfLine )
    + "END OF STATEMENT"

    Can you post examples of a single line and multiline SQL
    statement, including the surrounding text? I want to see
    how a single line SQL statement is delimited.

    -- Paul

     
  • Logged In: YES
    user_id=385682

    Thanks paul for your respionse, here the whole picture,a
    complete extended trace file (see upload)

    Carl

     
  • Paul McGuire
    Paul McGuire
    2004-07-15

    Logged In: YES
    user_id=893320

    I made the following changes to your code to match multiline
    SQL (I hacked variable names, you'll want to clean them up
    in your program):

    traceLineEvt = (
    _EVENT_NAME_.setResultsName ("TraceEvent")+
    _CUR_HANDLE_.setResultsName
    ("CursorHandle") +
    OneOrMore
    (_PARAM_GROUP_).setResultsName ("Params") )

    traceHdr = "PARSING IN CURSOR" + restOfLine; # <-
    define better grammar for this
    traceLine = ( Suppress
    ("=====================") +
    traceHdr.setResultsName("ParsingStats") +
    ( OneOrMore( LineStart() + ~Literal("END
    OF STMT") + restOfLine )).setResultsName("SQLstmt") +
    Suppress("END OF STMT") +
    OneOrMore( Group
    (traceLineEvt) ).setResultsName("Events") )

    Let me know if you want more explanation or comments.
    This is (another!) area that could use more documentation
    and/or examples.

    -- Paul

     
  • Logged In: YES
    user_id=385682

    Thanks paul,
    this is more then i expected!
    i will implement this or next week
    and tell you about the results

    with kind regards
    carl

     
  • Paul McGuire
    Paul McGuire
    2004-07-15

    • status: open --> closed
     
  • Paul McGuire
    Paul McGuire
    2004-07-15

    Logged In: YES
    user_id=893320

    Carl -

    I'm glad that worked for you. I'll close out this request.

    -- Paul

     
1 2 > >> (Page 1 of 2)