Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Insert sysdate - Need assistance
"Jimi" <Jimi_at_NOSPAM.com> wrote in message
news:hWsH6.3236$VM5.104865_at_ozemail.com.au...
> Hi,
>
> I am having trouble inserting the system date into Oracle 8i, can anyone
> help me with the syntax?
>
> Sean
>
> strInsert = "INSERT INTO FIX ( RID, DATEREC, NAME, DEPARTMENT, STANDARD,
> FIXIT, RNAME, PROBLEM, CURRENTSTATUS) VALUES (" & intTempKey & ",
> DATEREC=TO_DATE('SYSDATE', 'DD-MON-YYYY'), '"&UCASE(name)&"',
> '"&UCASE(department)&"', '"&UCASE(standard)&"', '"&UCASE(fixit)&"',
> '"&UCASE(rname)&"', '"&UCASE(problem)&"', '"&UCASE(currentstatus)&"')"
>
>
You are mixing vb functions and Oracle functions so you are likely going to
run into trouble.
In pure Oracle it would be
to_date(sysdate,'dd-mon-yyyy') /* so without quotes */
and the ucase functions would need to read as UPPER
I don't know the vb sysdate function from the top of my head, but either you
should use that, or get rid of the ucase and run this as a pass thru query.
Hth,
Sybrand Bakker, Oracle DBA Received on Tue May 01 2001 - 02:51:45 CDT