Re: How to do a check to see if I update or insert

2004-01-26 Thread John Jolet
you SURE you want to do that in a shell script?  I'd do it in perl
On Monday 26 January 2004 11:39 am, Mike Tuller wrote:
 I am stuck on this problem, and know there has to be a solution.

 I have a shell script, where I want to check to see if a record exists, and
 if it does then update the record with new information. If it doesn't then
 insert the information gathered by a script.

 How, in MySql, using a shell script, can I do this?


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Inserting Dates

2004-01-05 Thread John Jolet
Actually, you can insert the date with hyphens, also..so '2003-09-12'
will work.  and if you're not going to use the time, don't use a
datetime datatype...just use date.

On Mon, 2004-01-05 at 14:28, Donald Henson wrote:
 On Mon, 2004-01-05 at 12:46, Ian O'Rourke wrote:
  I'm very new to MySql and I'm having problems inserting dates into my tables
  (via the Web using Coldfusion). The user can put the following in the field:
  
  12/09/2003
  But the data returned from the database is:
  
  2012-09-20 03:00:00.0
  
  So I'm a bit confused about what I need to do in the insert statement so the
  user can just add the date (without a time). It's probably something really
  easy, but it;'s driving me nuts.
  
 
 Dates must be inserted in the mmdd format. For example, your entry
 above should be inserted as 20031209, assuming you meant 9 Dec 2003.
 Also note that the date must be inserted as a string which means
 enclosed in double quotation marks.
 
 Don Henson
 
 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Unusual date storage requirement

2003-10-27 Thread John Jolet
what about forcing the date to the first of whatever month the sale was in?  if it's 
got a valid date, put that, otherwise, put the first.

-Original Message-
From: sean peters [mailto:[EMAIL PROTECTED]
Sent: Monday, October 27, 2003 4:33 PM
To: [EMAIL PROTECTED]
Subject: Unusual date storage requirement


Hi all, 
I have run into a date storage problem that i don't like. A am storing 
historic house sales, and some of the old data i have received only contains 
the month and year, but not the date of the sale. Of course we want to store 
this information, but a DATE column won't quite do the job, because year, 
month, and day are all required.

So, my homecooked solution is to use a DATE column, and another column as a 
flag to denote whether the day-of-month is valid. Then i'll need to properly 
craft my searches to understand this.

I know that this is a horrible break of normalization, etc. but i haven't come 
up with a better solution. 

Also note that this is for a data warehouse, and myself and 1 other programmer 
are the only people who manipulate the data.

thanks in advance
sean peters
[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]