Re: using binary data in variable in an INSERT/UPDATE statement

2004-05-11 Thread Scott T. Hildreth
..Also found this in the Docs (perldoc DBI, search for binary) Perl supports binary data in Perl strings, and the DBI will pass binary data to and from the driver without change. It is up to the driver implementors to decide how they wish to handle such binary data. On Mo

Re: using binary data in variable in an INSERT/UPDATE statement

2004-05-11 Thread Scott T. Hildreth
..forgot to cc list. On Mon, 2004-05-10 at 14:33, Scott T. Hildreth wrote: > I guess it would depend on which database you are using. I would try > it with a bind column and let the DBD driver handle the quoting if need > be, > > $dbh->do(q{ > update mystuff set binaryfld=? > Where id=

Re: using binary data in variable in an INSERT/UPDATE statement

2004-05-10 Thread JupiterHost.Net
Andy Hassall wrote: The general approach is to always use placeholders, and never directly interpolate values into SQL statements. This should insulate you from whatever encoding's needed. Constants in SQL are OK, but if you're putting encoding as in quote()ing or encoding as in prepare/execute

RE: using binary data in variable in an INSERT/UPDATE statement

2004-05-10 Thread Andy Hassall
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space> > -Original Message- > From: JupiterHost.Net [mailto:[EMAIL PROTECTED] > Sent: 10 May 2004 20:18 > To: [EMAIL PROTECTED] > Subject: Re: using binary data in variable in an > INSERT/UPDATE s

Re: using binary data in variable in an INSERT/UPDATE statement

2004-05-10 Thread JupiterHost.Net
Scott T. Hildreth wrote: I guess it would depend on which database you are using. I would try Good point :) I'm thinking MySQL, since this specific app will use MySQL excusively... it with a bind column and let the DBD driver handle the quoting if need be, I'm really hoping MySQL will work

Re: using binary data in variable in an INSERT/UPDATE statement

2004-05-10 Thread JupiterHost.Net
Anyone ever do this before? JupiterHost.Net wrote: Hello DBI folks! If I have a column that is binary and data that is binary do I simply $dbh->quote() it on an insert? IE my $binary_content = get_binary_stuff(); my $binary_content_Q = $dbh->quote($binary_content); $dbh->do("UPDATE MyStuff

using binary data in variable in an INSERT/UPDATE statement

2004-05-05 Thread JupiterHost.Net
Hello DBI folks! If I have a column that is binary and data that is binary do I simply $dbh->quote() it on an insert? IE my $binary_content = get_binary_stuff(); my $binary_content_Q = $dbh->quote($binary_content); $dbh->do("UPDATE MyStuff SET BinaryGoodies=$binary_content_Q WHERE ID=1"); ..