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:
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
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
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
&
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
>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 &
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
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:
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
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
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
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" ]
;>>>>>>>>> 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
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
14 matches
Mail list logo