Re: C structures and Pro*C

From: Scott Urman <surman_at_wwsun10.us.oracle.com>
Date: 3 Aug 1994 16:07:45 GMT
Message-ID: <31ofci$qo6_at_dcsun4.us.oracle.com>


In article <CtxtLG.Bst_at_world.std.com>, extel_at_world.std.com (Chris eastland) writes:
|>
|> The book says structures can be referenced directly as host variables
|> in a pro*c program but structures can't be declared as hostvar type.
|> Can;'t find any examples of this anywhere.
|>
|> Does anyone have an example that shows what they mean, what can be done?
|> I'd like to avoid moving from structure to hostvars so Oracle can move
|> them yet again to its own variables, as long as I am more or less being
|> ANSI about it
|>
|> chris

The Pro*C supplement does mention this, but it is misleading, to say the least. With version 1.5 of Pro*C, you can't use structure members as host variables. The only things allowed in a declare section (and consequently allowed as host vars) are arrays, scalar variables, and pointers. You can't use a structure member in an SQL statement, nor can you use a subscripted array. You can use a pointer to an array or a structure element, however. Pro*C 2.0 (shipped with Oracle 7 Release 7.1) allows you to use both structures and subscripted arrays as host variables. You no longer need a declare section, and so any C variable can be used in an SQL statement. Note that this is for Pro*C 2.0 only, and NOT for Pro*C 1.6. Received on Wed Aug 03 1994 - 18:07:45 CEST

Original text of this message