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?
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.