Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create table from Informix 4GL

Status
Not open for further replies.

trdin

Programmer
Jan 19, 2004
13
0
0
VE
Hey Guys,

I'm trying to create a table from 4GL, but i want to be able give the name to the table, i mean Prompt for a name, store it in a variable and then create the table using that name stored in that variable, any thoughts?

Thanks a lot

trdin.
 
trdin:

With Informix 4GL, you can build nearly any data management statement with a string, declare a cursor, and execute it. I'll leave building the string to you, but here's an example:

DATABASE testdb

MAIN
DEFINE selstring CHAR(50)

LET selstring = "CREATE TABLE to_sn (col1 smallint);"
PREPARE create_table FROM selstring

EXECUTE create_table

END MAIN
# end 4GL stub

Also, you can't create a table without including at least one column. Let me know if you any further questions.

Regards,


Ed

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top