Re: Changing the tablename at runtime
Posted in 1998
Not being able to prepare those statements is true however
you can substitute the file name and the isql operations
by variables which will achieve the result you want.
The Load/Unload command have an implied prepare that
gets triggered whenever there is a variable in the statement.
Ex:
database eagle
main
define f_txtfile char(10),
f_sel char(50)
let f_txtfile = "org.txt"
let f_sel = "select * from org"
unload to f_txtfile f_sel
end main
Mariusz
Adam Sorati <adams@sgen.com.au> wrote in article
<3507CE3A.C14D6166@sgen.com.au>...
> Informix Online 5.0
> ISQL 4.1
> RDS 4.1
>
> I have a database with many tables which all have the same structure,
> what I want to do is allow the use to select the table they want to work
>
> with and then make my program use that as the tablename in my queries.
> I have tried the prepare statement but it is very limited, the many
> function
> of the program is to unload rows from the table and the documentation
> says that you can not use an unload statement in a prepare.
> Has anyone got any ideas on how I can avoid writting a different program
>
> for each table.
>
> Thank you
>
> Adam Sorati
> adams@sgen.com.au
>
> C
>
>