We do something like this with C and UNIX using ESQL. It goes something like
this :
$BEGIN WORK
sprintf ( sql_string, "SELECT %s FROM %s where %s",columns, sql_table,
sql_where)
$PREPARE get_data FROM $sql_string
$DECLARE sql_cursor CURSOR FOR get_data
$OPEN sql_cursor
$FETCH INTO $col_data1
$col_data2 ...
and so on...
You'll have to tailor it for your use. My syntax may not be perfect either.
The trick will be for you to determine what format each of the columns are are
so you can return the data to the user.
John.
_______________________________________________________________________________
> From: dray@icsware.com on Wed, Oct 18, 1995 9:07 PM
> Subject: Embedded SQL
> To: informix-list@rmy.emory.edu
Is there a way to use variables in embedded sql commands in C/UNIX
environment? This is what I want to do
select :var_column_name from :var_table_name;
I know how to host variables but wanted to know if host variables
canbe used for the table and column names.
Thanks in advance
------------------ RFC822 Header Follows ------------------
> Received: by po.gis.prc.com with SMTP;18 Oct 1995 19:51:12 U
> Received: by
> rmy.rmy.emory.edu (5.65/Emory_rmy.3.4.0) via MAILPROG
> id AA13212 ; Wed, 18 Oct 95 19:50:39 -0400
> Return-Path: ilist@rmy.emory.edu
> From: dray@icsware.com
> Message-Id: <463nnk$mto@natasha.rmii.com>
> Subject: Embedded SQL
> Date: Wed, 18 Oct 1995 20:29:41 GMT
> Reply-To: dray@icsware.com
> Organization: Rocky Mountain Internet Inc.
> Sender: informix-list-owner@rmy.emory.edu
> To: informix-list@rmy.emory.edu
> X-Informix-List-To: muhlenberg_john@prc.com
> X-Informix-List-Id: <news.18036>