Re: Pro*C and VARCHAR pointer arrays

From: <dlm_at_hermes.dlogics.com>
Date: 22 Jan 92 15:15:36 CST
Message-ID: <1198.297d8a98_at_hermes.dlogics.com>


ppe_at_niksula.hut.fi (Petri Pellinen) writes:
> 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];
> [... it didn't work the way he expected!]

Pro*C 1.3 does not support pointers-to-VARCHAR; your choices are:

o	char[]
o	char*
o	VARCHAR[]

when the array notation is used, it means that you are specifying the maximum string length. when the pointer notation is used, it means that you must ensure that the pointed-to array is large enough.

in general you CANNOT precompile pointers-to-arrays nor arrays-of-pointers DIRECTLY with the precompiled SQL.

Of course, if you must have arrays of varchars you can simulate this in various ways, but the additional work is up to you, using the basic types above.

--
Dave Mausner, Senior Consultant / Datalogics Inc / Chicago IL / 312-266-4450
dlm_at_dlogics.com                                 Motto: Just show me the code
Received on Wed Jan 22 1992 - 22:15:36 CET

Original text of this message