Dynamic ESQL/C
Posted in 1998
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration, Security, Permissions & Auditing, Platform-Specific Issues
Right. I'll try to be brief and make sense at the same time:
NT version of DB-Access won't allow me to connect to Solaris Informix server to
send an text file with SQL code. In theory, the command line would look like
this:
dbaccess my_db@my_server my_file.sql
or
dbaccess my_db@my-server -<my_file.sql
That doesn't work becauase I cannot specify a username and password (Not on the
command line). So, the Solaris server boots me without loading the file.
(dbaccess is pulling username@host from NT env vars). So, I have to rewrite
dbaccess.
If I wasn't trying to be brief, I'd tell the long-winded but quite entertaining
tale of why this must work from the command line.
So, today I learned ESQL/C. And I tried rewriting db-access.
It's a very simple program, and of course it doesn't work. The part that's
giving me trouble
has to do with the dynamic SQL part. According to this book I have, (I-ESQL/C
Programmer's Manual, Imfx Press),
before I start building a dynamic sql statement, I have to know what it is. If
it's a select, I use a certain structure. If it's a delete, I use another
structure... I'm hoping there's a better way than this...
And so, my question:
How do I build and execute a dynamic sql statement, with ESQL/C, when the
sql is *so* dynamic, that even I don't know what it is?
Thanks you for your time. Here's a recipe:
Strawberry Cheesecake Tart
A quick recipe for a make-ahead dessert.
1 prepared refrigerated pie crust, for 9-inch single-crust pie
(half of a 15-ounce package)
2 packages (8 ounces each) cream cheese, softened
3 tablespoons sugar
1 teaspoon vanilla
3 ounces semisweet chocolate, melted
1 1/2 to 2 pint baskets strawberries, stemmed and halved
2 tablespoons strawberry or red currant jelly, melted
Heat oven to 425 degrees F. Press pie crust into 9-inch round tart pan with
removable bottom. Fold edge in and press firmly against side of pan. Prick crust
all over with fork. Refrigerate 10
minutes. Bake in center of oven 10 to 12 minutes until lightly browned.
Cool on rack. Meanwhile, in bowl beat cheese, sugar and vanilla to blend
thoroughly. When tart shell is completely cool,
spread cheese mixture evenly over chocolate. Arrange strawberries on cheese
mixture and brush lightly with jelly. Refrigerate at least 1 hour before
serving.
Makes 8 servings
Nutritional Information per serving: 410 calories; 31 g fat; 70 mg
cholesterol; 280 mg sodium; 30 g carbohydrate; 2 g fiber; 6 g protein