Re: VIEW - Problems
Posted in 1993
In article <2a10lv$ptu@maicgn.SoftwareEngineering>, ar@mai.de (Achim Reiners) writes: |> Well, my last INFORMIX-problem was solved by this group, but |> |> I have a new problem with Informix-VIEWs: |> |> |> There is a View defined over ( for simplicity ) 2 tables (Regard the OUTER! ): |> |> CREATE TABLE A ( |> A_ID SERIAL (1) , |> A_NAME CHARACTER(10), |> B_ID INTEGER ); |> |> |> CREATE TABLE B ( |> B_ID SERIAL (1) , |> B_NAME CHARACTER(10) , |> B_NR INTEGER ); |> |> |> CREATE VIEW V |> AS SELECT |> A.A_ID, |> A.A_NAME, |> B.B_ID, |> B.B_NAME, |> B.B_NR |> FROM |> A, |> OUTER B |> WHERE |> A.B_ID = B.B_ID; |> |> |> |> Mostly selects against the View V work as expected. The only case when they do |> not is when I specify a WHERE-clause to a column of B. |> |> SELECT * FROM V WHERE B_NR = 6 |> |> This SELECT returns data that has B_NR entries which are not equal to 6 ! In |> these result entries simply all the columns of B are omitted ( NULL, I think). |> I'm not sure if anyone replied this one. If your table A & B have following rows A B 1 "ab" 5 1 "ab" 5 2 "cd" 2 2 "cd" 2 Then your query "SELECT * FROM V WHERE B_NR = 6" should return no rows. If it returns a_id a_name b_id b_name b_nr 1 ab 2 cd then you are hit by bug # 12821, which is fixed in 5.01 darshan