EXECUTE in a funtion to return a VIEW object ID
EXECUTE in a funtion to return a VIEW object ID
От:
"Wilkinson, Jim" <Jim.Wilkinson@cra-arc.gc.ca>
Дата:
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