array of C structs in Oracle8

From: Jerry Murr <jdm2_at_lsdn.ksc.nasa.gov>
Date: Mon, 18 May 1998 11:16:26 -0400
Message-ID: <356050C9.488C9EA2_at_lsdn.ksc.nasa.gov>



[Quoted]  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 Mon May 18 1998 - 17:16:26 CEST

Original text of this message