Walt Mankowski on 26 Jan 2004 20:36:02 -0000


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

Re: [PLUG] Perl/MySQL conundrum


On Mon, Jan 26, 2004 at 08:22:05PM +0000, beldon@speakeasy.net wrote:
> Here is the generates SQL.
> 
> INSERT INTO main (msgtime, servername, logtype, msgcomp, msgid, msgtype, msgsrc, msgstr) VALUES ('Thu Jan 22 15:37:06 2004', 'EGLDAT02', 'Application', 'EGLDAT02', '0', 'ERROR', 'IWRcer2\:IWReqMan', " EGLDAT02\, 4540\(688\)\, 2004\/01\/22 15\:37\:06\.284\; Error\: 4294967255\, Generic\; Process ID\: 4540\; Thread\: 2184\; Host\: EGLDAT02\; Text\: AS\_ValidateTicket2\: Invalid ticket\.\; BackTraceInfo\:  1\. File Name\: Y\:\\src\\iwr\\IWR\\SessionManager\\authsession\.cpp\; Line\#\:1289\; Desc\.\:AS\_ValidateTicket2\: Invalid ticket\.\; 2\. File Name\: Y\:\\src\\iwr\\IWR\\SessionManager\\authsession\.cpp\; Line\#\:1384\; Desc\.\:validateTicket2\; 3\. File Name\: Y\:\\src\\iwr\\IWR\\SessionManager\\accmansession\.cpp\; Line\#\:48\; Desc\.\:Failed to create AuthSession object\.\; 4\. File Name\: Y\:\\src\\iwr\\IWR\\SessionManager\\sessionmanager\.cpp\; Line\#\:346\; Des
> c\.\:Unable to get auth session\.\; 5\. File Name\: Y\:\\src\\iwr\\IWR\\RequestManager\\RqMgrServices\\imcgiauthenticator\.cpp\; Line\#\:86\; Desc\.\:IMCGIAuthenticator\:\:authenticateUser\;   ");,

Lordy, you're not using bind variables?  Or formatting your SQL so
that it can be read more easily?

I can't help you with the latter (and I think Outlook may be partly to
blame there) but I think using bind variables will help solve your
problem.  If you've never used them before, take a look at Mark
Dominus's "Short guide to DBI"[1] which does an excellent job of
explaining how to use them.  One of the many great things about bind
vars is that they solve the problem of escaping quotation marks, which
it sounds like you're having a problem with.

Well, on second reading I see that Mark never actually refers to them
as "bind variables".  Just search for "?" on the page.

Walt

1. http://www.perl.com/pub/a/1999/10/DBI.html

Attachment: signature.asc
Description: Digital signature