Query a database table whose name is known only at runtime

Status
Not open for further replies.
A

Austin

Guest
I get a database table name at run time(let us suppose from user). I need to query the table and return few fields(which I know). How to do this?

"FOR EACH" wont accept a variable name in it. So, I cant use it.

I have gone through dynamic queries, especially SET-BUFFERS() method. Even with this, I need to know the table name before.

I need something like:

DEF VAR tablename AS CHAR.
tablename = somename.
FOR EACH tablename WHERE ....:
...
...
END.


Can someone please point me to right direction?

Continue reading...
 
Status
Not open for further replies.
Top