Previous Next

Thread: Case statement containing a greater than evaluation

Last post 07-05-2008 9:23 AM by NathanBlakley. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 07-04-2008, 12:26 PM

    Case statement containing a greater than evaluation

     Hi, I am attempting to split the Message column of a Windows event log into two, for import into a database (max literal of 2000). This would require a greater than string length evaluation. The following is not acceptable to Log Parser:

    CASE (STRLEN(Message)>2000)
            WHEN True Then SUBSTR(Message, 0, 2000)
            ELSE Message
        END AS Message1,

    Any suggestions? 

    Thanks. 

    Have a great day
  • 07-05-2008, 9:23 AM In reply to

    Re: Case statement containing a greater than evaluation

    The answer is that there is no negative fallout from Log Parser for not testing the length of the Message string. Just trying the following seems to work.

    SUBSTR(Message, 0, 1999) AS Message1,
        SUBSTR(Message, 2000, 1999) AS Message2,
        SUBSTR(Message, 4000, 1999) AS Message3,
        SUBSTR(Message, 6000, 1999) AS Message4,

    Chunking the data is ugly, but following up the import with a stored procedure, from a vbs script allows me to import the rest of the way into a CLOB (Oracle). 

    Have a great day
Page 1 of 1 (2 items)
Page view counter