Perl and SQL

Victor Odhner plug-devel@lists.PLUG.phoenix.az.us
Tue Mar 25 06:58:02 2003


Hi, Austin.
I see nothing nasty about storing data in variables,
especially if the data volume is large.

I presume you are using DBI.  It's very common to
prepare a variable $sql that contains the whole
query.

In building such a string, use '' for quoting
instead of "" to keep your escape characters.

Vic

--------

Austin wrote:

Hello Everyone,
     I am playing around with a little perl and SQL.  I am having 
trouble doing an insert into a text field when the text is large and 
nasty.  I am not sure how I can properly escape out the nasty characters.
     I have the text stored into a variable which I then use in my 
insert statement.  This works fine with smaller stuff of course but it 
seems like an awfully unpleasant way of inserting LARGISH text.  I am 
pretty new to both perl and SQL so I think I may be missing something 
(or do I have to escape out every reserved token before inserting?).

Austin