Search Postgresql Archives

how to use variable for select query in pl/pgsql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello everybody,

i want use a variable to denote a table name in select query.

for example:

DECLARE
       table_message_data varchar;
       record_message_data record;
BEGIN
         table_message_data := prefix || 'message_data';

     select into record_message_data * from table_message_data;
END;

the "prefix" is the function input parameter,but i don't know how to use
the "table_message_data" in select query.


please tell me,thanks.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux