|
|
|
|
|
|
| Author |
Message |
Bing Du *nix forums beginner
Joined: 18 May 2005
Posts: 26
|
Posted: Thu Jul 20, 2006 7:48 pm Post subject:
retrieve value from an external file?
|
|
|
Hello everyone,
Without scripting, can this be done from mysql> command line? The
'publications' field is mediumtext in table 'research'. Since
'publication' is pretty long, I want to save it in a file on the file
system. But I don't know how, or if that's even possible, to grab the
content from the file and use it in the following update statement?
mysql>update research set publications='loooong text in a file' where
uid=319;
Any ideas?
Thanks in advance,
Bing
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org |
|
| Back to top |
|
 |
Chris White *nix forums beginner
Joined: 21 Apr 2006
Posts: 43
|
Posted: Thu Jul 20, 2006 8:07 pm Post subject:
Re: retrieve value from an external file?
|
|
|
On Thursday 20 July 2006 12:48 pm, Bing Du wrote:
| Quote: | Hello everyone,
mysql>update research set publications='loooong text in a file' where
uid=319;
|
You already have the data in a storage system ( a file on the filesystem ).
That said, use what you have, store the location to the file, then grab that
and use it to open the file and get the contents, using that for whatever
purpose you may have.
--
Chris White
PHP Programmer/DBlarg
Interfuel
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org |
|
| Back to top |
|
 |
mos *nix forums Guru Wannabe
Joined: 21 Feb 2005
Posts: 103
|
Posted: Thu Jul 20, 2006 8:28 pm Post subject:
Re: retrieve value from an external file?
|
|
|
At 02:48 PM 7/20/2006, you wrote:
| Quote: | Hello everyone,
Without scripting, can this be done from mysql> command line? The
'publications' field is mediumtext in table 'research'. Since
'publication' is pretty long, I want to save it in a file on the file
system. But I don't know how, or if that's even possible, to grab the
content from the file and use it in the following update statement?
mysql>update research set publications='loooong text in a file' where
uid=319;
Any ideas?
Thanks in advance,
Bing
|
Bing,
You could create a temporary table with a single text field and
then use "Load Data Infile <filepath> ..." to put the text data into the
temporary table. Once it is there you can use the temporary table to update
your research table.
Mike
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org |
|
| Back to top |
|
 |
Bing Du *nix forums beginner
Joined: 18 May 2005
Posts: 26
|
Posted: Fri Jul 21, 2006 2:06 pm Post subject:
Re: retrieve value from an external file?
|
|
|
| Quote: | On Thursday 20 July 2006 12:48 pm, Bing Du wrote:
Hello everyone,
mysql>update research set publications='loooong text in a file' where
uid=319;
You already have the data in a storage system ( a file on the filesystem
).
That said, use what you have, store the location to the file, then grab
that
and use it to open the file and get the contents, using that for whatever
purpose you may have.
|
Thanks Chris. What you said makes sense to me. Sure I can do that in a
script. But I'm still not clear how it can be done from the 'mysql>'
command line. I cannot change the table definition to make the
'publications' field to store the location of the file. The
'publications' field stores the actual content of the file.
Bing
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org |
|
| Back to top |
|
 |
Bing Du *nix forums beginner
Joined: 18 May 2005
Posts: 26
|
Posted: Fri Jul 21, 2006 2:07 pm Post subject:
Re: retrieve value from an external file?
|
|
|
| Quote: | At 02:48 PM 7/20/2006, you wrote:
Hello everyone,
Without scripting, can this be done from mysql> command line? The
'publications' field is mediumtext in table 'research'. Since
'publication' is pretty long, I want to save it in a file on the file
system. But I don't know how, or if that's even possible, to grab the
content from the file and use it in the following update statement?
mysql>update research set publications='loooong text in a file' where
uid=319;
Any ideas?
Thanks in advance,
Bing
Bing,
You could create a temporary table with a single text field and
then use "Load Data Infile <filepath> ..." to put the text data into the
temporary table. Once it is there you can use the temporary table to
update
your research table.
|
That sounds like a good idea that's worth trying. Thanks much, Mike.
Bing
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sat Nov 22, 2008 8:50 pm | All times are GMT
|
|
Mortgages | Loans | Debt Help | Mobile Phone | Mortgages
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|