DBI - Writing blobs - blob types 
Author Message
 DBI - Writing blobs - blob types

 I'm trying to insert a  blob into an Informix database using Perl5
running under DEC Unix.

 The sql command is:

 $sql_cmd = "INSERT INTO ibitmap(imovie_id,bitmap) VALUES
('$DB_MOVIE','$BLOB')";

 How do I format $BLOB so that it is a blob? And how do I reference this
variable so that perl thinks it is a blob? (Note, the error message I
receive when I try the above is:

SQL: -617: A blob data type must be supplied within this context.

 I've searched the world over (via the web) and looked through all the
books I can find, however I'm still missing this.

 Thanks for any suggestions,

 Ricky Houghton



Sat, 28 Apr 2001 03:00:00 GMT  
 DBI - Writing blobs - blob types


Quote:
>  I'm trying to insert a  blob into an Informix database using Perl5
> running under DEC Unix.

>  The sql command is:

>  $sql_cmd = "INSERT INTO ibitmap(imovie_id,bitmap) VALUES
> ('$DB_MOVIE','$BLOB')";

>  How do I format $BLOB so that it is a blob? And how do I reference this
> variable so that perl thinks it is a blob? (Note, the error message I
> receive when I try the above is:

Just a guess without realy trying. The single quotes mean you're passing
2 literal strings '$DB_MOVIE' and '$BLOB'. try
...VALUES($DB_MOVIE,$BLOB)";

HTH

Steve



Sun, 29 Apr 2001 03:00:00 GMT  
 DBI - Writing blobs - blob types
Hmm, be careful. That string ahs to be legit SQL to the SQL parser;
strings
must be quoted. Try this:

$sql_cmd = "INSERT INTO ibitmap(imovie_id,bitmap)
VALUES (\"$DB_MOVIE\",\"$BLOB\")";

Quote:



> >  I'm trying to insert a  blob into an Informix database using Perl5
> > running under DEC Unix.

> >  The sql command is:

> >  $sql_cmd = "INSERT INTO ibitmap(imovie_id,bitmap) VALUES
> > ('$DB_MOVIE','$BLOB')";

> >  How do I format $BLOB so that it is a blob? And how do I reference this
> > variable so that perl thinks it is a blob? (Note, the error message I
> > receive when I try the above is:

> Just a guess without realy trying. The single quotes mean you're passing
> 2 literal strings '$DB_MOVIE' and '$BLOB'. try
> ...VALUES($DB_MOVIE,$BLOB)";

> HTH

> Steve

--
Matthew O. Persico
Nothing even remotely clever at the moment.


Sun, 29 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. To Blob or not To Blob

2. MySQL BLOB types and DBD::mysql

3. DBI:mysql blob/text access

4. get blob to web with dbi

5. Can I read BLOB as stream by DBI

6. Perl DBI::DB2 inserting blob data

7. How to access BLOB field from DBI

8. Bad free() with perl, DBI, Informix and blobs

9. How can I insert blob data using DBI?

10. DBI/DBD::Informix and retrieving BLOB data

11. inserting a binary scalar into a DBI blob

12. Retrieving BLOBs from Oracle using DBI

 

 
Powered by phpBB® Forum Software