EXECUTE in a funtion to return a VIEW object ID

Поиск
Список
Период
Сортировка
Искать
От
Wilkinson, Jim
Тема
EXECUTE in a funtion to return a VIEW object ID
Дата
Msg-id
7CCC5BEF5E72394C963E529B54EB4A642A19C5@SD01ITMV12.PROD.NET
Список

Hi there,

I have tried many ideas to get this working but no luck.

Can some show me or explain what is happening

EXAMPLE

==========

I am trying to read to 2 text fields to combine them togther to form the name of a

VIEW.  example

   SELECT * FROM ( 'april'||'may') ;

I have tried the EXECUTE in a function to PREPARE a dynameic select call;

EXECUTE 'SELECT * FROM '

        ||select tablename.text_field1 from tablename

        ||select tablename.text_field2 from tablename;

If tablename.text_field1 =May and tablename.text_field2 =Aprl, this function only returnsMayApril and not the columns and data that I expected.

What am I doing wrong here?

Has anyone done this before or have any ideas on how to do it ?

Thanks

В списке pgsql-general по дате отправления
От: Alvaro Herrera
Дата:
От: Tom Lane
Дата:
FAQ