Hello.
Maybe mysql puts the name of the column (firmwareimage), at the beginning of the output (--skip-column-names should prevent it). Rakesh Gupta <[EMAIL PROTECTED]> wrote: > > > > > Hi There, > I am trying to insert blob in table and then retrieve it from table using > Linux shell. Here is script that i used. > > Load Blob into DB and Retrieve it using linux shell. > # add firmware into DB > ACTION="insert into FIRMWARE > (firmwarename, releasedate, bootcodename, usermanualname, releasenotes, > checksum, hwrevision, comments, dependencyfwid) > values (\"$FWNAME\", \"$RELDATE\", \"$BOOTNAME\", \"$MANUAL\", > LOAD_FILE(\"$FW/$1/$BRNOTES\"), \"$CHECK\", \"$HWREV\", \"$COMMENT\", > $FWDEPID); > VALUE=`echo "$ACTION" | mysql -u$APMU -p$APMPW -h$HOSTDB -D$APMDB` > if [ $? != 0 ]; then > echo $ACTION >> $LOG > echo $VALUE >> $LOG > echo [DBERR-002] >> $LOG > continue > fi > > select length(firmwareimage) from FIRMWARE where firmwareid=129; > > > +-----------------------+ > | length(firmwareimage) | > +-----------------------+ > | 3763016 | > +-----------------------+ > > It shows the correct size of binary file > > # get blob from Database > > ACTION="select firmwareimage from FIRMWARE where status !='Deleted' and > firmwareid=$1 ;" > VALUE=`echo "$ACTION" | mysql -u$APMU -p$APMPW -h$HOSTDB -D$APMDB` > if [ $? != 0 ]; then > echo $ACTION >> $LOG > echo [DBERR-001] >> $LOG > continue > fi > echo $VALUE > /tmp/tmp_129.bin > > [EMAIL PROTECTED] tmp]# diff ts_129.bin tmp_129.bin > Binary files ts_129.bin and tmp_129.bin differ > > Retrieved binary file size increases. Does anyone know about this issue and > how to fix it. > > -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.NET http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Gleb Paharenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]