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.
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
>From: pcaicedo@mmrree.gov.ec (Pablo "Lobo" Caicedo)
>Subject: Answer please...
>Date: 10 Nov 1994 08:11:03 -0600
>X-Informix-List-Id: <news.9729>
>
>How I can create a table using variable table name, if this name is input
>by keyboard ?
>
>Example:
>
>database xxx
>globals
> define
> name char(8)
>end globals
>
> main
> prompt "Input name for table" , for name
> create table name (colum1 char(1))
> end main
Use PREPARE and EXECUTE:
DATABASE xxx
MAIN
DEFINE tabname CHAR(18)
DEFINE stmt CHAR(100)
PROMPT "Input name for table" FOR tabname
LET stmt = "CREATE ", tabname CLIPPED, " (Colum1 CHAR(1))"
PREPARE p_create FROM stmt
EXECUTE p_create
FREE p_create
END MAIN
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
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.