Re: variable used for "CREATE TABLE"
Posted in 1997
You'll need to create a string that you want to run and then execute it immediate. I think you can do this in 4GL? let table_name = "xxx" let sql_str = "create table ", table_name, "(...);" PREPARE stmt_id FROM sql_str EXECUTE stmt_id similar for indexes. Forgive me if my 4gl is off a bit } } Hi all, } } } This might be a stupid question, but after having read the manuals, etc.. I } can't find the answer.. } } I am modifying a 4GL application that prints a report. } } To print this report, the application creates a table (Not a TEMP table) } and it's index. This table is then used to hold data to be processed for } this report. When the program ends, the table is destroyed. } } My problem is that I want the program to be useable by more than one person } at a time. I would like to be able to check if the table exists already } because user1 is running the application.. If it's running, then I would } use another table name for user2, user3, and so on. } } I should be able to use a variable instead of hard-coding the table name in } the create statement. } } example: LET table_name = "my_table" } LET index_variable = "i_my_table" } } } CREATE TABLE table_name } ... } ... } } CREATE UNIQUE INDEX index_variable ON table_variable } ... } } } Thank you } Gerard Godin, for Marc Beauvais } -- Bill Ennis Voice: 312-474-7516 SSA Fax: 312-474-7460 500 W. Madison email: ennis@ssax.com ennis@accesschicago.net