Home » SQL & PL/SQL » SQL & PL/SQL » SQL INSERT date string using ASP into Oracle database
SQL INSERT date string using ASP into Oracle database [message #21341] Fri, 26 July 2002 11:49 Go to next message
Emad Ramadan
Messages: 1
Registered: July 2002
Junior Member
I'm sure from my code, I have tried many methods without solution, the day,month and year are variables from select <html> form, I tried to use the to_date function as :
script language="VBScript"
fday = request.form("day")
fmonth = request.form("month")
fyear = request.form("year")
birthdate = fday&"/"&fmonth&"/"&fyear
birthdate="to_date("&birthdate&",dd/mm/yyyy)"
SQL="INSERT INTO PASSENGER VALUES ('"&birthdate&"');"

##: and also I'm getting the same error:
[[Oracle]][[ODBC]][[Ora]]ORA-00917: missing comma

anybody can help me ?
Re: SQL INSERT date string using ASP into Oracle database [message #21342 is a reply to message #21341] Fri, 26 July 2002 12:01 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
wat is the date format in database?
by default it is dd-mon-yy.
either change that in database or
do to_char(date,'dd-mon-yy') in your asp code
Re: SQL INSERT date string using ASP into Oracle database [message #24060 is a reply to message #21341] Thu, 23 January 2003 04:35 Go to previous message
luis gold
Messages: 1
Registered: January 2003
Junior Member
try this:

fday = request.form("day")
fmonth = request.form("month")
fyear = request.form("year")
birthdate = fday&"/"&fmonth&"/"&fyear
birthdate="to_date('"&birthdate&"',dd/mm/yyyy)"
SQL="INSERT INTO PASSENGER VALUES ("&birthdate&");"
Previous Topic: help!!! please,tell me about plan table result .
Next Topic: select first value
Goto Forum:
  


Current Time: Fri Apr 10 14:27:25 CDT 2026