Forums

ASP

This topic is locked

Inserting Date In ORACLE

Posted 01 Jul 2003 11:16:26
1
has voted
01 Jul 2003 11:16:26 Serge Khachatour posted:
I want to insert date and time in an oracle database. I am familiar with oracle and know that i need to use the TO_DATE(variable, 'MM/DD/YYYY') function. However, where do i say use this format in my code. Please help me someone <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
This below is my date coming in to the page.
&lt;%
Dim TheDate
TheDate = Request.Form("begdate"
TheDate = CDate(TheDate)
%&gt;
&lt;%
' *** Insert Record: set variables

If (CStr(Request("MM_insert") = "SubmitMessage" Then

MM_editConnection = MM_connect_STRING
MM_editTable = "SCOTT.MESSAGES"
MM_editRedirectUrl = "ControlPanel.asp"
MM_fieldsStr = "txtSubject|value|txtMessage|value|hdnMsgID|value|hdnMobileNum|value|hdnDateTime|value"
MM_columnsStr = "SUBJECT|',none,''|MESSAGE|',none,''|MESSAGEID|none,none,messageid.NEXTVAL|MOBILENUM|',none,''|SENDDATE|',none,NULL"

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"

' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next

' append the query string to the redirect URL
If (MM_editRedirectUrl &lt;&gt; "" And Request.QueryString &lt;&gt; "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString &lt;&gt; "" Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If

End If
%&gt;

The above code is my insert statement. The date is inserted via a hidden field called (hdnDateTime).
Please help me on the issue of date. Where do i say the TO_DATE(hdnDateTime, 'MM/DD/YYYY')

Reply to this topic