Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Dan Copeland — — source: Informix-list mailing list archive (1991-1998)
I'm VERY new to ESQL/C (though not new to C/C++) and have been unable to
figure out some of the basic tenets of ESQL programming.
For example, I wrote the following function:
int dbalias (newname,oldname)
$parameter char newname[40];
$parameter char oldname[40];
{
EXEC SQL CREATE SYNONYM :newname FOR :oldname;
return 1;
}
When I preprocess this code with the esql command, I get:
esqlc: "dbio.ec", line 32: Error -33051: Syntax error on identifier or
symbol ':'.
I've included sqltypes (EXEC SQL include sqltypes;) to no avail. What
do I need to do to get ESQL to recognize the fact that I want to insert
the values of these variables?
On a more fundamental level, when do I need to use the EXEC SQL prepare
construct as opposed to the above method of direct insertion?
Please email any insight to dcopeland@singular.com. Many thanks.
- Dan
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.