Re: dynamic methode with pro c

From: <shockerman_at_my-deja.com>
Date: Tue, 20 Jul 1999 18:29:42 GMT
Message-ID: <7n2f62$481$1_at_nnrp1.deja.com>


What I ended up doing was this:
Have the tablename stored in the variable tablename defined as char tablename[x]; //insert length of tablename for x sprintf(buffer, "create table %s (x number, y date)", tablename); sql(buffer);

[Quoted] void sql(char *_comm) {

	EXEC SQL BEGIN DECLARE SECTION;
		char *comm = _comm;
	EXEC SQL END DECLARE SECTION;
	EXEC SQL EXECUTE IMMEDIATE :comm;
	EXEC SQL commit work;

}
Good luck.
James

In article <7n221m$2e4$1_at_news.cs.tu-berlin.de>,   yangdong_at_cs.tu-berlin.de (Dong Yang) wrote:
> I'm using pre compiler for c or c++
> and want to insert into a table where the table name will only be
known in runtime
> which of the dynamic methode should i use?
> dong
>
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Tue Jul 20 1999 - 20:29:42 CEST

Original text of this message