mce has asked for the wisdom of the Perl Monks concerning the following question:
The mysql table search is setup:use strict; use DBI; my $o = DBI -> connect("foo","bar","you wish"); my $dir="/A_Directory"; opendir(DIR, $dir) or die $!; foreach ( readdir DIR ) { next if /^\.{1,2}$/; my $file=$dir."/".$_; my $query; $query="insert into search ( title ) values ( '$file' )"; print "$query: ",$o->do($query),"\n"; $query="update search set body = LOAD_FILE('$file') where title = +'$file'"; print "$query: ",$o->do($query),"\n"; } closedir(DIR); $o->disconnect;
title -> varchar(200) primary key not null body -> text fulltext on title and bodyNow, the title is inserted OK, but the body is never inserted. (I also tried to put it all in one sql statement, but got the same problem).
But, when I copy/paste the stdout in the mysql CLI,
it works fine.
Am I missing something?
note: perl 561, MySQL 3.23.47
---------------------------
Dr. Mark Ceulemans
Senior Consultant
IT Masters, Belgium
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: load_file and mysql
by gmax (Abbot) on Feb 07, 2002 at 10:42 UTC | |
|
Re: load_file and mysql
by davis (Vicar) on Feb 07, 2002 at 09:34 UTC | |
by mce (Curate) on Feb 07, 2002 at 09:47 UTC | |
by davis (Vicar) on Feb 07, 2002 at 09:57 UTC | |
by mce (Curate) on Feb 07, 2002 at 09:47 UTC | |
|
Re: load_file and mysql
by tachyon (Chancellor) on Feb 07, 2002 at 09:59 UTC | |
|
Re: load_file and mysql
by Ryszard (Priest) on Feb 07, 2002 at 10:04 UTC | |
by mce (Curate) on Feb 07, 2002 at 10:36 UTC |