Re: array of C structs in Oracle8

From: Michael Krolewski <vandra_at_u.washington.edu>
Date: Tue, 19 May 1998 23:13:41 -0700
Message-ID: <35627495.A564826C_at_u.washington.edu>


you should be able to do the same

    insert into tableX ( .. dateField...) values ( ... to_date(:variable,'..HH24MISS') ... )

Mike Krolewski

Jerry Murr wrote:

> Refer to the Programmer's Guide to the Oracle Pro*C/C++ PreCompiler,
> Release 8.0
> Chapter 12 "Using Host Arrays". On page 16, it starts explaining the
> new V8.0
> capability to perform multi-row operations, involving multiple columns
> using
> an array of C structs.
>
> We are trying to use this technique, but we've hit a problem... the
> table
> columns include 'date' data types. The dates we insert include
> 'hh24miss' which
> is not part of the default date format used by Oracle. We therefore
> need a
> 'to_date' specification to support translation of the date/time fields
> in the
> struct into the date format Oracle needs when inserting the data.
>
> This is not a problem when fetching the data into the array of structs
> because
> the cursor definiton could include sql functions (such as 'to_char') to
>
> translate data into the format required by an element in the struct
> (see the
> example 'fetch_data' function on page 26). But the insert statement
> (the
> 'insert_data' function on page 26) doesn't appear to provide any
> opportunity
> to translate columns during insertion.
>
> Note: this application is only 1 of many that runs against a particular
> database
> instance and it could be a large impact to change the default date
> format for
> the instance. However, if this is the only way to support this
> capability, we
> will at least give it some consideration.
Received on Wed May 20 1998 - 08:13:41 CEST

Original text of this message