RE: Shell Script to Insert Data

2003-10-10 Thread Jeff McKeon
The way I usually do it is this.. I have a shell scipt called "query" It contains: /fullpath/mysql --user=root --password= Database_Name I then make new scripts for the queries as such: (query file name: Select_all.sql) Select * from Table where blah=foo; To run this I then execute

Re: Shell Script to Insert Data

2003-10-10 Thread Colleen Dick
Mike Tuller wrote: I am trying to create a script that will insert data. Right now I am just using something simple to test this out, but I can't get it to work. Here is what I have. mysql --user=root --password= Database_Name; INSERT INTO table_name (column_name) VALUES ("value"); After I

Re: Shell Script to Insert Data

2003-10-10 Thread gerald_clark
The first line starts mysql. When mysql exits, the second line does nothing, as it is not a valid shell command. try : echo 'INSERT INTO table_name (column_name) VALUES ("value")' | mysql --user=root --password= Database_Name Or put the second line in a file, and cat the file through a

RE: Shell Script to Insert Data

2003-10-10 Thread Jeff McKeon
Put the full path to mysql in the script... Jeff > -Original Message- > From: Mike Tuller [mailto:[EMAIL PROTECTED] > Sent: Friday, October 10, 2003 1:07 PM > To: [EMAIL PROTECTED] > Subject: Shell Script to Insert Data > > > I am trying to create a script that will insert data. Righ