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 -> Re: OCI & Dates

Re: OCI & Dates

From: Konstantin Kivi <konst_at_sirena.rinet.ru>
Date: Mon, 11 Jan 1999 13:13:03 GMT
Message-ID: <F5ECpr.4oD.0.debian@sirena.rinet.ru>


Paul-Marc Marot <Paul-Marc.Marot_at_capway.com> wrote:
> You will have to use PRO*C

Extremely good advice !
1) this will not help to bind struct tm 2) exactly the same can be done with oci to John
use strftime to convert date to string
and then do what you do

> For example

> EXEC SQL INSERT...

> For date types you use TO_DATE, for example TO_DATE('11/01/1998',
> 'DD/MM/YYYY')

> See precompilers documentation

> Paul-Marc

> John Fisher a écrit dans le message <775s85$pt3$1_at_pollux.dnai.com>...
> >
> >Hello,
> >
> >I'm writing a C program that needs to execute simple SQL INSERT statements
> >on a remote Oracle database. Let me first preface by saying I haven't done
> >anything like this with Oracle before. Basically my understanding is that I
> >need to create an SQL statement containing a series of placeholders, such
> as
> >:EMP_NUM or :CURRENT_SALARY, then execute a series of OCIBindByName() calls
> >to 'fill in the blanks.' So my first question is, is this the 'correct' way
> >to build an INSERT statement? Secondly, if this is correct, how to I build
> >and insert a date/time value, given a (struct tm *) value, and bind it into
> >an associated value?
> >
> >Thanks,
> >John
> >
> >
> >

--
Sincerely Yours, Konstantin Kivi, Russia, konst_at_sirena.rinet.ru

    aka <k-kivi_at_usa.net>, 2:5020/457.24_at_fidonet.org           Received on Mon Jan 11 1999 - 07:13:03 CST

Original text of this message

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