List:General Discussion« Previous MessageNext Message »
From:Jeyabalan Murugesan Sankarasubramanian Date:July 20 2004 6:16am
Subject:Re: empty_blob() equivalent
View as plain text  
Actually i need to add a wavefile in byte[] format to the table with column name blob_col
of type blob.  In Oracle empty_blob() is inserted into the table. While retrieving
OracleResultSet supports getBLOB(). This returns oracle.sql.BLOB. From this i am able to
insert the byte[] with the following code.

oracle.sql.BLOB myblob = ((OracleResultSet)rs).getBLOB("blob_col");
OutputStream os = myblob.getBinaryOutputStream();

This works in Oracle, which i m migrating to MySQL. For this i need equivalent thing so
that i can insert byteArray in column blob_col.

> In the last episode (Jul 20), Jeyabalan Murugesan Sankarasubramanian said:
> > Is there any equivalent of empty_blob() in mysql. Kindly guide us in
> > this regard. Thanks in advance.
> You didn't tell us what empty_blob() is supposed to do.  If
> empty_blob() checks to see whether a blob is empty:
>   SELECT .... WHERE myblob = '';
> If empty_blob() zeroes out a blob:
>   UPDATE ... SET myblob = '';
> blobs are just large varchars, basically.
> -- 
> 	Dan Nelson
> 	dnelson@stripped


This e-mail transmission and any attachments may contain confidential
information belonging to the sender.  The information is intended solely for
the use of the individual(s) or entities addressed.  If you are not the
intended recipient, you are hereby notified that any copying, disclosing,
distributing, or use of this e-mail and/or attachment is strictly
prohibited.  If you received this transmission in error please notify the
sender immediately and delete the message and all attachments.

empty_blob() equivalentJeyabalan Murugesan Sankarasubramanian20 Jul
  • Re: empty_blob() equivalentDan Nelson20 Jul
Re: empty_blob() equivalentJeyabalan Murugesan Sankarasubramanian20 Jul
  • Re: empty_blob() equivalentDan Nelson20 Jul