Search Postgresql Archives

EXECUTE in a funtion to return a VIEW object ID

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

 



Title: EXECUTE in a funtion to return a VIEW object ID

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 returns MayApril 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


[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