Views over multiple tables and conditional selection (ticket #1134)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Views over multiple tables and conditional selection (ticket #1134)

Christian Schwarz
Hello!

We're getting a "no such column" SQL error executing conditional select
statements using this view:

CREATE VIEW ENTF as select ENTF1.new_key, ENTF1.tp_id_start,
ENTF1.tp_id_ziel, ENTF2.weg_id, ENTF2.weg_rel_nr from ENTF1, ENTF2 where
ENTF1.keyentf2 = ENTF2.keyentf2;

These are the tables the view is using:

CREATE TABLE ENTF1 (new_key integer, tp_id_start integer, tp_id_ziel
integer, keyentf2 integer);
CREATE TABLE ENTF2 (keyentf2 integer primary key, weg_id integer,
weg_rel_nr integer);

Further investigations revealed that ticket #1134 is describing this
problem. Is there any chance to work around this problem (of course
except not using views)? Is this issue going to be solved in the near
future?

Regards, Christian
Reply | Threaded
Open this post in threaded view
|

Re: Views over multiple tables and conditional selection (ticket #1134)

D. Richard Hipp
"Christian Schwarz" <[hidden email]> wrote:

> Hello!
>
> We're getting a "no such column" SQL error executing conditional select
> statements using this view:
>
> CREATE VIEW ENTF as select ENTF1.new_key, ENTF1.tp_id_start,
> ENTF1.tp_id_ziel, ENTF2.weg_id, ENTF2.weg_rel_nr from ENTF1, ENTF2 where
> ENTF1.keyentf2 = ENTF2.keyentf2;
>
> These are the tables the view is using:
>
> CREATE TABLE ENTF1 (new_key integer, tp_id_start integer, tp_id_ziel
> integer, keyentf2 integer);
> CREATE TABLE ENTF2 (keyentf2 integer primary key, weg_id integer,
> weg_rel_nr integer);
>
> Further investigations revealed that ticket #1134 is describing this
> problem. Is there any chance to work around this problem (of course
> except not using views)? Is this issue going to be solved in the near
> future?
>

Us an "AS" clause on each result column of the view in order to
assign the specific name you want to that column.
--
D. Richard Hipp <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

AW: Views over multiple tables and conditional selection (ticket #1134)

Christian Schwarz
In reply to this post by Christian Schwarz
> Us an "AS" clause on each result column of the view in order to
> assign the specific name you want to that column.

That works. Many thanks!

Regards, Christian