Passing variable name instead of table name in for each statement

confidentbala

New Member
Hi All,
Is there any possible to get the table name in a variable and pass the variable name in for each statement as follows.

DEFINE VARIABLE m_table AS CHARACTER NO-UNDO.
m_table = "pt_mstr".
FOR EACH m_table NO-LOCK.
DISPLAY m_table.
END.

Help me out.
Thanks in advance.:confused:
 
You want dynamic queries. Start by looking in the documentation for the QUERY object. The QUERY-PREPARE method is the key to success. There are lots of simple examples posted in threads here or by doing a search of the Progress Knowledge Center.
 
Back
Top