Re: ESQL/C insert statement problem
Posted in 1991
Path: emory!swrinde!mips!sdd.hp.com!hplabs!pyramid!infmx!jacob
From: jacob@informix.com (Jacob Salomon)
Newsgroups: comp.databases.informix
Message-ID: <1991Dec10.212731.13207@informix.com>
Date: 10 Dec 91 21:27:31 GMT
References: <1991Dec05.192501.13636@dircon.co.uk> <1991Dec6.174109.10282@informix.com>
Sender: news@informix.com (Usenet News)
Organization: Informix Software, Inc.
In article <1991Dec6.174109.10282@informix.com> johnl@informix.com (Jonathan Leffler) writes:
>In article <1991Dec05.192501.13636@dircon.co.uk> uaa1006@dircon.co.uk (Peter Miles) writes:
>>
>>The manual for Informix-Esql/C (Version 4.0) says that if you
>>have a structure defined as follows...
>>
>>$struct foo
>>{
>> char name[20];
>> char address[20];
>> char phone[20];
>>} bar;
>>
>> ... (full text deleted)
>> -- Pete
>>--
>>Pete Miles uaa1006@dircon.co.uk
>> ...uknet!dircon!uaa1006
>
>There is a bug in the manual.
>You should use the syntax:
>
>$ insert into customer values ($foo.name, $foo.address, $foo.phone);>
>This is guaranteed.
>
>your structure declaration should be:
>
>$struct foo
>{
> char name[21];
> char address[21];
> char phone[21];
>} bar;
Hi Jonathan & co.
In haste, I previously gave an incomplete answer to the user's
problem. However, what I tols him still applies: it must be
incorrect C. Rather, I think, he should be using:
$ insert into customer values ($bar.name, $bar.address, $bar.phone);foo is merely the name of a structure template, not a defined
variable. 'bar' is the host variable.
See you on the e-mail, johnl
-- Jake
--
----------------Obligatory smart-$$$ remark:---------------------
| There's two kinds of people: Those who categorize people into |
| two groups and those who don't. (Aging proverb.) |
-----------------------------------------------------------------