Oracle date

2003-12-20 Thread landon kelsey
sql from Oracle

insert into log_book values 
(TO_DATE('08/12/1973','MM/dd/'),'C150','N5787G',1,1.8);

would like

insert into log_book values 
(STR_TO_DATE('08-12-1973','%m-%d-%Y'),'C150','N5787G',1,1.8);

according to the manual, STR_TO_DATE is not until 4.0...I have 3.23.52

hate to write a program to change the format on 500 insert statements

any suggestions

_
Enjoy the holiday season with great tips from MSN.  
http://special.msn.com/network/happyholidays.armx

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


Re: Oracle date

2003-12-20 Thread beacker
The kind of processing you desired is easily accomplisches
with the following perl program:

#!/usr/bin/perl
while (STDIN) {
if (/TO_DATE/) {
s/TO_DATE/STR_TO_DATE/;
s/(..)\/(..)\/()/$1-$2-$3/;
s/MM\/dd\//%m-%d-%Y/;
}
print $_;
}

[EMAIL PROTECTED] cat Landon.odat
insert into log_book values 
(TO_DATE('08/12/1973','MM/dd/'),'C150','N5787G',1,1.8);

[EMAIL PROTECTED] ./Landon.pl Landon.odat
insert into log_book values 
(STR_TO_DATE('08-12-1973','%m-%d-%Y'),'C150','N5787G',1,1.8);

Brad Eacker ([EMAIL PROTECTED])



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