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 -> Oracle 8.0.5 conversion

Oracle 8.0.5 conversion

From: Sverre Hjelm <shjelm_at_csulb.edu>
Date: Mon, 14 Jun 1999 23:02:03 +0000
Message-ID: <376589EA.D42A0C6@csulb.edu>


Hi,

I'm developing an aplication for Oracle 8.0.5 in OCI using the new(?) OCI-interface routines. I am trying to autoconvert date types to asciiz strings by using the following define (this is a part of a switch-case, where I have identified the external oracle type as a DATE).

OCIDefineByPos(ociStmt, &ociVarString->ociDefine, db->ociError, col, ociVarString->s, dataSize, SQLT_STR, &ociVarString->indicator, NULL, NULL, OCI_DEFAULT) ...where ociVarString is my own class containing a char *, OCIDefine * and an indicator variable. The OCIDefine variable is set to NULL. This works well, except that dates are returned in the default format. In order to try to specify the format, I followed the above line with:

OCIAttrSet(ociVarString->ociDefine, OCI_HTYPE_DEFINE, &dateFormat, strlen(dateFormat), OCI_ATTR_PDFMT, db->ociError)

As you can see, I use the ociDefine which was allocated by the first call. dateFormat is an asciiz string containing the correct format. However, this last call does not seem to have any impact. The date is still returned in the default format. Can anyone explain how to set the formatstring for this, without having to edit the ora.init file (I just want to change my own application, not everyone elses) or messing around with ENV. Of course I can use TO_CHAR in my queries, but I want something more elegant :)

Please include cc:shjelm_at_csulb.edu in any replies. Tnx,

Sverre Hjelm Received on Mon Jun 14 1999 - 18:02:03 CDT

Original text of this message

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