In the last episode (Jul 20), Jeyabalan Murugesan Sankarasubramanian said:
> 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();
> os.write(byteArray);
> 
> 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.

MySQL doesn't have any special blob functions.  They are treated as
very large string fields, so you should be able to do a plain UPDATE or
INSERT.  If you're using a language that supports bind variables or
placeholders, something similar to this should work:

query("UPDATE mytable SET blob_col=%s WHERE id=%d", byteArray, rowid)

-- 
        Dan Nelson
        [EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to