Re: Creating a view on multiple tables
Posted in 1995
>From: Mark Steele <74431.3327@CompuServe.COM>
>Date: 12 May 1995 05:10:52 GMT
>X-Informix-List-Id: <news.13807>
>
>Currently I have a database that has numerous tables with the same
>schema. Basically they are the same table, split in to seperate
>tables by quarter. I am trying to create a view that will create
>the apperance of one all inclusive table. What I get instead is
>an error 531. Is it not possible? Can a view not be created on
>two similar tables? I don't want to combine the tables into one,
>for that would create an umanageable table of 40+ gig.
How are you doing it? You cannot use a UNION view because
ANSI SQL (at least in SQL-89) does not mandate the support
of UNION views, and Informix does not support them.
Error -531 is about duplicate column names. That suggests that you
are not using the formulation:
CREATE VIEW CombinedTable (Col01, Col02, Col03, ...)
AS SELECT * FROM Q1, Q2, Q3, Q4
...
This allows you to specify the names of the columns in the view table.
Using display labels (column aliases) is not reliable in this context.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>