Re: There has to be a way to do this

2004-02-11 Thread Thomas Spahni
So there is something wrong with what is > returned. Neither "0" or "count(*) 0" seem to work. So, does anyone have an > idea as to what I need to put in for the comparison? > > > Mike > > > From: gerald_clark <[EMAIL PROTECTED]> > > Date:

Re: There has to be a way to do this

2004-02-10 Thread Eamon Daly
Okay, the lack of locking was driving me crazy. Here's my version: #!/usr/bin/sh MYSQL="mysql -v test" ethernet_address=$1 cat < To: "gerald_clark" <[EMAIL PROTECTED]> Cc: "MySql List" <[EMAIL PROTECTED]> Sent: Tuesday, February 10, 2004 10:5

Re: There has to be a way to do this

2004-02-10 Thread gerald_clark
ES ($ethernet_address);" else echo "UPDATE hardware_assets SET operating_system='10.3.3';" fi Where cetechnology is the database. All the variables are set. When I run this, it starts the mysql client application, with the mysql> prompt. Nothing is inserted or updated in

Re: There has to be a way to do this

2004-02-10 Thread Mike Tuller
idea as to what I need to put in for the comparison? Mike > From: gerald_clark <[EMAIL PROTECTED]> > Date: Mon, 09 Feb 2004 14:28:27 -0600 > To: Mike Tuller <[EMAIL PROTECTED]> > Cc: MySql List <[EMAIL PROTECTED]> > Subject: Re: There has to be a way to do this &

Re: There has to be a way to do this

2004-02-09 Thread Ryan Yagatich
mysql> >>prompt. Nothing is inserted or updated in the database though. >> >>This is the same problem I had when I tried to do it this way, but I am not >>knowledgeable in shell scripting yet to know what I am doing wrong. >> >> >> >> >>> From: ger

Re: There has to be a way to do this

2004-02-09 Thread Ryan Yagatich
>This is the same problem I had when I tried to do it this way, but I am not >knowledgeable in shell scripting yet to know what I am doing wrong. > > > > >> From: gerald_clark <[EMAIL PROTECTED]> >> Date: Mon, 09 Feb 2004 11:11:24 -0600 >> To: Mike Tuller &

Re: There has to be a way to do this

2004-02-09 Thread Mike Tuller
d had only the line for RESULT=, and then did echo $RESULT. It returns nothing. Not a 0 or a 1, nothing. > From: gerald_clark <[EMAIL PROTECTED]> > Date: Mon, 09 Feb 2004 14:28:27 -0600 > To: Mike Tuller <[EMAIL PROTECTED]> > Cc: MySql List <[EMAIL PROTECTED]> > Su

Re: There has to be a way to do this

2004-02-09 Thread gerald_clark
ation, with the mysql> prompt. Nothing is inserted or updated in the database though. This is the same problem I had when I tried to do it this way, but I am not knowledgeable in shell scripting yet to know what I am doing wrong. From: gerald_clark <[EMAIL PROTECTED]> Date:

Re: There has to be a way to do this

2004-02-09 Thread Alec . Cawley
Mike Tuller <[EMAIL PROTECTED]> wrote on 09/02/2004 16:53:00: > I have posted this question a few times, and have not seen the answer that I > need. > > I have a shell script, that gathers information from systems, and I want > that info to be entered into a database. I want it to check fir

Re: There has to be a way to do this

2004-02-09 Thread Mike Tuller
t; Date: Mon, 09 Feb 2004 11:11:24 -0600 > To: Mike Tuller <[EMAIL PROTECTED]> > Cc: MySql List <[EMAIL PROTECTED]> > Subject: Re: There has to be a way to do this > > IF works on the selections not on the query. > Select IF(lastname='clark','Correct&#x

RE: There has to be a way to do this

2004-02-09 Thread Schwartz, Evelyn
Record If update fails Insert record -Original Message- From: Mike Tuller [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 11:53 AM To: MySql List Subject: There has to be a way to do this I have posted this question a few times, and have not seen the answer that I need. I have a

Re: There has to be a way to do this

2004-02-09 Thread gerald_clark
IF works on the selections not on the query. Select IF(lastname='clark','Correct',''Incorrect'), firstname from namefile; You need to do the checking in your script. For example in bash: RESULT=`echo "select count(*) from manefile where lastname='clark'" | mysql database` if [ "$RESULT" = "0" ]

Re: There has to be a way to do this

2004-02-09 Thread vpendleton
;>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< On 2/9/04, 10:53:00 AM, Mike Tuller <[EMAIL PROTECTED]> wrote regarding There has to be a way to do this: > I have posted this question a few times, and have not seen the

There has to be a way to do this

2004-02-09 Thread Mike Tuller
I have posted this question a few times, and have not seen the answer that I need. I have a shell script, that gathers information from systems, and I want that info to be entered into a database. I want it to check first to see if the data is already entered, and if not, add it. If it has already