Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 8CB2C9FB4DE; Tue, 10 Apr 2007 11:34:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 23469-01; Tue, 10 Apr 2007 11:34:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail102.cra-arc.gc.ca (mail102.cra-arc.gc.ca [198.103.184.24]) by postgresql.org (Postfix) with ESMTP id D65E59FB832; Tue, 10 Apr 2007 11:34:38 -0300 (ADT) Received: from SD01ITMB01.PROD.NET (unknown [7.32.10.166]) by mail102.cra-arc.gc.ca (mail) with ESMTP id B637CAF2TW; Tue, 10 Apr 2007 10:34:37 -0400 (EDT) Received: from SD01ITMV12.PROD.NET ([7.32.10.12]) by SD01ITMB01.PROD.NET with Microsoft SMTPSVC(6.0.3790.2499); Tue, 10 Apr 2007 10:34:37 -0400 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C77B7D.5D51528F" Subject: EXECUTE in a funtion to return a VIEW object ID Date: Tue, 10 Apr 2007 10:34:37 -0400 Message-ID: <7CCC5BEF5E72394C963E529B54EB4A642A19C5@SD01ITMV12.PROD.NET> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: EXECUTE in a funtion to return a VIEW object ID Thread-Index: Acd7fVzxJ2if9abRRYCuqPnvdcEo3Q== From: "Wilkinson, Jim" To: , X-OriginalArrivalTime: 10 Apr 2007 14:34:37.0314 (UTC) FILETIME=[5D7FE620:01C77B7D] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/445 X-Sequence-Number: 112348 This is a multi-part message in MIME format. ------_=_NextPart_001_01C77B7D.5D51528F Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi there, I have tried many ideas to get this working but no luck. Can some show me or explain what is happening EXAMPLE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 =3D "May" and tablename.text_field2 =3D "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 ------_=_NextPart_001_01C77B7D.5D51528F Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

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 =3D “May” and tablename.text_field2 =3D “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

------_=_NextPart_001_01C77B7D.5D51528F--