Pro*C - equivalencing strings to arrays

From: Obakesan <cjundieseastwd_at_powerup.com.au>
Date: 2000/06/23
Message-ID: <8iufvl$skp1_at_inetbws1.citec.com.au>#1/1


HiYa

I'm a tad confused about this, as the documentation seems to say different things, or at least not tell the whole story at different places.

if i have a declaration like:

#define ACCOUNT_CODE_LENGTH          9
#define ACCOUNT_CODE_STRING          (ACCOUNT_CODE_LENGTH + 1)

as well as some others, to enable this:

typedef struct recipient_names_record
{

    char    account_code[ACCOUNT_CODE_LENGTH+1];
    char    recipient_id[RECIPIENT_ID_LENGTH+1];
    char    recipient_title[RECIPIENT_TITLE_LENGTH+1];  
    char    recipient_given_names[RECIPIENT_GIVEN_NAMES_LENGTH+1];      
    char    recipient_surname[RECIPIENT_SURNAME_LENGTH+1];      
} RECIPIENT_NAMES_REC; I can then in the code declare a host variable

RECIPIENT_NAMES_REC fetched;

and then

exec sql select

    account_code,

    recipient_id,
    recipient_title,
    recipient_given_names,
    recipient_surname

into

:fetched.account_code
:fetched.recipient_id
:fetched.recipient_title
:fetched.recipient_given_names
:fetched.recipient_surname

where ...

but if I want to make this a string, I have to (for each line) do something like;

exec sql var fetched.account_code is string;

right??

do I need to put a value after string? in some parts of the manual it indicates that I should (makes sence to me) other parts don't ...

which is right?

--

See Ya
(when the bandwidth gets better ;-)
Chris Eastwood                            Please remove undies for reply
Photographer, Stunt Programmer            WWW -> www.powerup.com.au/~cjeastwd/
Motorcyclist and dingbat
Received on Fri Jun 23 2000 - 00:00:00 CEST

Original text of this message