Hope this helps u

CREATE TABLE photo( name VARCHAR(50) NOT NULL, pic MEDIUMBLOB, picname
varchar(50),
     INDEX(name),
     FOREIGN KEY(name)
     REFERENCES person(name) ON DELETE CASCADE
     ) TYPE = INNODB ;

INSERT INTO photo(name , pic, picname) values( 'raman',
load_file('e:/mysql/images/Click.gif'),'Click.gif') ;

SELECT length(pic) FROM photo WHERE picname = 'Click.gif' ;

UPDATE photo SET pic = load_file('e:/mysql/images/mod_jk.jpeg') where name =
'velan' ;

SELECT pic FROM photo WHERE name = 'velan' INTO DUMPFILE 'C:/TEMP/pic2.gif'
;

now you can go to c:/temp/pic2.gif and open in a browser to check whether it
is corrupted or transferring etc.,


regards

----- Original Message -----
From: "Ivan Paul" <[EMAIL PROTECTED]>
To: "kayamboo" <[EMAIL PROTECTED]>
Sent: Thursday, September 26, 2002 4:25 PM
Subject: Re: Updating blob from command line


> dear kayamboo,
>
> if i'm not wrong, there is three blob type:
> 1. blob
> 2. medium blob
> 3. long blob,
>
> but problem for me now, is how to initialize the blob type
> (blob/medium/long) into table structure.
>
> so can u give me some information about that, i mean the command to create
> medium or longblob.
>
> for table example:
>
> create table blob_test
> (
>     blob_test_id bigint null auto_increment,
>     blob_sbj varchar(40) null,
>     blob_img ???,
>     primary key(blob_test_id),
>     index idx_blob_test_id(blob_test_id)
> );
>
> TIA,
> Ivan Paul
> Web Developer
> Mediate - Media Communications
> http://www.bhaktimedia.com
>
>
> ----- Original Message -----
> From: kayamboo <[EMAIL PROTECTED]>
> To: Ivan Paul <[EMAIL PROTECTED]>
> Cc: list mysql <[EMAIL PROTECTED]>
> Sent: Thursday, September 26, 2002 13:53
> Subject: Re: Updating blob from command line
>
>
> > Paul,
> >
> > I checked for InnoDb and this have to work with MyIsam also.
> > But also decide your size. If your size exceeds the limit, it get
> truncated
> > and u never come to  know during insert.  so you can go for mediumblob
if
> it
> > exceeds the blob size.  Check for the size restrictions in the manual.
> >
> >
> > regards
> >
> > ----- Original Message -----
> > From: "Ivan Paul" <[EMAIL PROTECTED]>
> > To: "kayamboo" <[EMAIL PROTECTED]>
> > Sent: Thursday, September 26, 2002 3:11 PM
> > Subject: Re: Updating blob from command line
> >
> >
> > > dear kayamboo,
> > >
> > > can i use myisam table type to input my blob data in gif/jpeg (image
> > > format)?
> > >
> > > TIA,
> > >
> > > Ivan Paul
> > > Web Developer
> > > Mediate - Media Communications
> > > http://www.bhaktimedia.com
> > >
> > > ----- Original Message -----
> > > From: kayamboo <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Cc: list mysql <[EMAIL PROTECTED]>
> > > Sent: Thursday, September 26, 2002 09:55
> > > Subject: Fw: Updating blob from command line
> > >
> > >
> > > > sorry i missed the update statement
> > > >
> > > > UPDATE temponly SET pic = load_file('e:/mysql/images/mod_jk.jpeg')
> where
> > > > name = 'velan' ;
> > > >
> > > > regards
> > > > ----- Original Message -----
> > > > From: "kayamboo" <[EMAIL PROTECTED]>
> > > > To: "Chris" <[EMAIL PROTECTED]>
> > > > Cc: "list mysql" <[EMAIL PROTECTED]>
> > > > Sent: Thursday, September 26, 2002 9:15 AM
> > > > Subject: Re: Updating blob from command line
> > > >
> > > >
> > > > > CREATE TABLE temponly(name VARCHAR(50) NOT NULL PRIMARY KEY, pic
> > > BLOB)TYPE
> > > > =
> > > > > INNODB ;
> > > > > INSERT INTO temponly(name , pic) values( 'velan',
> > > > > load_file('e:/mysql/images/Click.gif')) ;
> > > > >
> > > > > Hope this helps.
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Chris" <[EMAIL PROTECTED]>
> > > > > To: <[EMAIL PROTECTED]>
> > > > > Sent: Wednesday, September 25, 2002 11:31 PM
> > > > > Subject: Updating blob from command line
> > > > >
> > > > >
> > > > > > Greetings,
> > > > > >
> > > > > > Is there anyway to import an image into a blob column from the
> > > > > > command line? By like making an sql script?
> > > > > >
> > > > > > What I have is a database that has 4 blob columns per row that
> holds
> > > > > > signature images. Every once in awhile a new signature needs to
> > update
> > > > the
> > > > > old
> > > > > > signature. I need to be able to update the database with the new
> > image
> > > > > > through a script since it needs to be automated.
> > > > > >
> > > > > > Does anybody have any ideas, and can this be done?
> > > > > >
> > > > > > Thanks!
> > > > > > - Chris
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > ---------------------------------------------------------------------
> > > > > > Before posting, please check:
> > > > > >    http://www.mysql.com/manual.php   (the manual)
> > > > > >    http://lists.mysql.com/           (the list archive)
> > > > > >
> > > > > > To request this thread, e-mail
> <[EMAIL PROTECTED]>
> > > > > > To unsubscribe, e-mail
> > > > > <[EMAIL PROTECTED]>
> > > > > > Trouble unsubscribing? Try:
> > http://lists.mysql.com/php/unsubscribe.php
> > > > > >
> > > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > Before posting, please check:
> > > >    http://www.mysql.com/manual.php   (the manual)
> > > >    http://lists.mysql.com/           (the list archive)
> > > >
> > > > To request this thread, e-mail <[EMAIL PROTECTED]>
> > > > To unsubscribe, e-mail
> > > <[EMAIL PROTECTED]>
> > > > Trouble unsubscribing? Try:
http://lists.mysql.com/php/unsubscribe.php
> > > >
> > >
> >
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to