Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks,

I have been using DBD::Sybase, and it works great for me, however an image column has been added to a table, and I've been asked to write some perl to allow the upload of jpegs to this cell. Can I use a sql statement to do this? the cpan documentation is good, but I don't understand the image stuff. If anybody has got a working snippet I would be grateful.

Thanks in advance,
Jonathan

Replies are listed 'Best First'.
Re: inserting images into Sybase db
by Joost (Canon) on Mar 01, 2005 at 14:30 UTC

      Here's the DBD::Sybase documentation link.

      Jason L. Froebe

      Team Sybase member

      No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

Re: inserting images into Sybase db
by jbrugger (Parson) on Mar 01, 2005 at 15:04 UTC
    we use 'cgi' and plain sql for this. eg:
    # Untested snips of code if ($query->param('type') eq 'upload') { my $cgi = new CGI; my $fh = $cgi->param($upload_field_name); while (read($fh,$buffer,BUFFER_SIZE)) { $value .= $buffer; } # mind the danger of this sql syntax, where $value may be # a ; separated value to some 'hackers'. # however, i believe DBI::Sybase doesn't allow ? and execute($value) +; # use a regexp to filter out update, delete, create, alter etc. $sth = $dbh->prepare('update table set value = ' . $value . ' where +...'); }