Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> SYSDATE truncated (OCI Problem?)

SYSDATE truncated (OCI Problem?)

From: Thomas Broquist <thomas.broquist_at_computech.se>
Date: Fri, 04 Dec 1998 09:38:19 +0100
Message-ID: <36679F7B.5854AB08@computech.se>


Hi!

I've got a problem with an UPDATE statement called from OCI:

#define ORA_MOD "UPDATE turn SET been_there = DECODE(:1, 0, NULL, SYSDATE) WHERE login = :2"
/* [snip] */

oopen(&cda_mod, &lda, 0, -1, -1, 0, -1); oparse(&cda_mod, ORA_MOD, -1, 0, 2) != 0); obndrn(&cda_mod, 1,(text*)&been_there, sizeof(been_there), SQLT_INT, -1, 0, 0, -1, -1);
obndrn(&cda_mod, 2,(text*)login, sizeof(login), SQLT_STR, -1, 0, 0, -1, -1);
been_there = 1;
oexec(&cda_mod);
ocom(&lda);
/* [snip] */

When executed, this statement updates the been_there DATE column of the turn table to
SYSDATE (when been_there != 0). However, the resulting value is truncated to the
beginning of the day.
When i run the above statement in SQL*plus it works just fine.

Platform:
HP-UX

Environment (among others):
NLS_LANG=american_america.we8iso8859p1
ORACLE_SID=oradb6
ORA_NLS32=/oracle_sw/donald/oracle732/ocommon/nls/admin/data

Database:
Oracle7 Server Release 7.3.2.3.0

What am I missing? An ALTER SESSION SET NLS_XXX or something like that?

Any hints would be greatly apreciated!

Regards Thomas Broquist Received on Fri Dec 04 1998 - 02:38:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US