Walt Mankowski on 26 Jan 2004 19:55:03 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Perl/MySQL conundrum


On Mon, Jan 26, 2004 at 07:45:03PM +0000, beldon@speakeasy.net wrote:
> I am working on a Perl script which takes Windows event logs, parses them, and puts the information into a MySQL database.  The Perl script runs on Windows and the MySQL database is on a SuSE Linux box, and I'm using an ODBC connection to the MySQL database.  I've defined all of the fields I need and have evrything working...except one thing.
> 
> One of the fields is a Text field in MySQL.  I keep getting an error because of the odd characters in the free-form text.  I have tried everything I could personally think of (like going through each line one character at a time to scrub out the offending characters), as well as the Perl cookbook solution which goes like this:
> 
>      $msgstr =~ s/([\'\"])/\\$1/g;
> 
> All to no avail.  What I get is:
> 
> Error: [1064] [2] [0] "[TCX][MyODBC]You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '' SWID=20040124230026169EGLDAT02PID3984TID4820 - EGLDAT02, 1936"
> 
> For the record, here is what I'm trying to insert into the Text field specific to the above error, but it could be just about anything:
> 
> SWID=20040124230026169EGLDAT02PID3984TID4820 - EGLDAT02, 1936(c4c), 2004/01/24 23:00:46.293; Error: 0, Generic; Process ID: 1936; Thread: 3148; Host: EGLDAT02; Text: Unknown error while executing report d:\program files\cognos\cer2\published reports\ACSC Reports - Architect\apps\Master Gaming Report (Summary by Game).imr.; BackTrace Info:  1. File Name: Y:\src\iwr\IWR\Dispatchers\irsdispatchers\irsinstance.cpp; Line#:1180; Desc.:Unknown error while executing report d:\program files\cognos\cer2\published reports\ACSC Reports - Architect\apps\Master Gaming Report (Summary by Game).imr.;
> 
> Any help would be much appreciated.

Since it says you have an SQL syntax error, could you show us the code
you're using so we can make sure it isn't? :)

Walt

Attachment: signature.asc
Description: Digital signature