Re: Pro*C and VARCHAR pointer arrays

From: Frank M. Lopez <flopez_at_oracle.uucp>
Date: 23 Jan 92 04:51:30 GMT
Message-ID: <1992Jan23.045130.15252_at_oracle.com>


In article <PPE.92Jan21111212_at_daredevil.hut.fi> ppe_at_niksula.hut.fi (Petri Pellinen) writes:
>
>Hello everyone,
>
>My Pro*C compiler for MS-DOS makes an interesting error when compiling
>VARCHAR pointer arrays. If I say in a Pro*C program:
>
>VARCHAR *foo[7];
>
>the precompiler intelligently comes up with the following:
>
>struct {
>...
>} *foo;
>
>ie. makes a simple pointer out of an array. This is fine after you
>find the 'feature' in the precompiler and fix the results by hand but
>I am getting pretty fed up with editing each compilation of my program
>by hand. Has anyone out there come up with a solution to the problem?
>Does anyone _have_ the same problem or is it just me? When I called
>the oracle support number here in Finland the 'support' person just
>said that it is interesting that the precompiler does what it does. He
>hadn't come up with the problem before, but admitted after a few tests
>that it exists.
>
>Comments, suggestions, opinions? anyone?
>

It looks like the Pro*C Precompiler should give you an error message. Page 1-6 of the ORACLE Precompilers - Pro*C Supplement V1.3 states:

"... One-dimensional arrays of simple C types are also supported. However, for char[n] and VARCHAR[n], n specifies the maximum string length, not the number of strings in the array.

Two-dimensional arrays are allowed only for char[m][n] and VARCHAR[m][n], where m specifies the number of strings in the array and n specifies the maximum string length.

Pointers to simple C types are also supported. However, pointers to arrays, char[n], and VARCHAR[n] are not supported ..."

*END OF QUOTE* A pointer to VARCHAR[n] would be VARCHAR *[n].

  • frank -
Received on Thu Jan 23 1992 - 05:51:30 CET

Original text of this message