Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 54E509FB9D4 for ; Tue, 3 Apr 2007 10:04:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 24025-09 for ; Tue, 3 Apr 2007 10:03:56 -0300 (ADT) 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 CCB619FB486 for ; Tue, 3 Apr 2007 10:04:01 -0300 (ADT) Received: from SD07ITMB01.PROD.NET (unknown [7.32.21.166]) by mail102.cra-arc.gc.ca (mail) with ESMTP id A75D103ETL for ; Tue, 3 Apr 2007 09:04:00 -0400 (EDT) Received: from SD01ITMV12.PROD.NET ([7.32.10.12]) by SD07ITMB01.PROD.NET with Microsoft SMTPSVC(6.0.3790.2499); Tue, 3 Apr 2007 09:04:00 -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_01C775F0.8BBF04E7" Subject: Using a variable as a view name in a select Date: Tue, 3 Apr 2007 09:04:00 -0400 Message-ID: <7CCC5BEF5E72394C963E529B54EB4A642A19B3@SD01ITMV12.PROD.NET> In-Reply-To: <141386.39515.qm@web57105.mail.re3.yahoo.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Using a variable as a view name in a select Thread-Index: Acd177batVi1I4Y/QfqhSTZqFXouEQAAA6uA From: "Wilkinson, Jim" To: X-OriginalArrivalTime: 03 Apr 2007 13:04:00.0095 (UTC) FILETIME=[8BC5DEF0:01C775F0] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/27 X-Sequence-Number: 28027 This is a multi-part message in MIME format. ------_=_NextPart_001_01C775F0.8BBF04E7 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I have created a view, called april_may. I need to select this view by combineing to fields in the database to create the view name etc ... =20 Create view as select * from table_X; =20 I need to do something like this ...=20 =20 Select * from (select table.start_month||_||table.end_month); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Start_month =3D april End_month =3D May =20 What I what to pass to the select is the combination of the 2 fields as the view name. =20 Any ideas ? ------_=_NextPart_001_01C775F0.8BBF04E7 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I have created a view, called april_may.   I need to select this view by combineing to = fields in the database to create the view name etc = …

 

Create view as select * from = table_X;

 

I need to do something like this = …

 

Select * from (select = table.start_month||_||table.end_month);

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

Start_month  =3D = april

End_month =3D = May

 

What I what to pass to the select = is the combination of the 2 fields as the view = name.

 

Any ideas = ?

------_=_NextPart_001_01C775F0.8BBF04E7--