PeopleTools Reference: Meta-SQL %Table


Replaces with the actual table name of the given record.

Generally, this just means adding a “PS_” to the front of the record name. But, PeopleTools actually checks the alternate table name from the Record Type tab to see if a value is there first.

Two Uses:

  • Access a table with a reference or record object rather than embedding a table name in the SQL; PeopleTools will not index the table/record in a string literal.
  • Reference the Temporary table in an App Engine; %Table is the only way to reference the table because the table name is assign dynamically at run time.



SqlExec(“SELECT NAME FROM %Table(:1) WHERE EMPLID = :2”, Record.NAMES, &emplid, &name);

&sql = CreateSql(“SELECT * FROM %Table(:1) WHERE EMPLID = :2”, &MyRecord, &emplid);


2 Responses to “PeopleTools Reference: Meta-SQL %Table”

  1. Manoj Says:

    %Table also has a very important use in Application Engines, when temporary tables are used. It resolves to the temporary table created.

    If %Table(MY_TEMP_TABLE) is used on a AE which can be run parallely, on the first instance of the AE, %Table(MY_TEMP_TABLE) would become PS_MY_TEMP_TABLE01.

    For the 2nd instance, it would be PS_MY_TEMP_TABLE02 and so on.

  2. Jayesh Jhurani Says:

    It should be mandatory to use %Table, I used TEMP table name instead and faced problem coz table name was assigned at run time.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: