You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@empire-db.apache.org by Daniel Wenning <Da...@htwg-konstanz.de> on 2019/11/20 08:01:23 UTC

Views of Database in EmpireDB

Hello there,

I am trying to include a VIEW of SQLSERVER 2014 into an EmpireDB SELECT Statement.

The Statement in SQLSERVER for the view was something like:

CREATE VIEW foobar AS SELECT TITLE FTOM LECTURE 
JOIN LECTURER ONLECTURER.ID = LECTURE.LECTURER_ID
WHERE  LECTURER.Name = 'A. Einstein';

How can I achieve somethin like SELECT * FROM foobar WHERE A = B ?

Thanks in advance.
-- 
Sincerely

Daniel Wenning



Re: Views of Database in EmpireDB

Posted by Jan Glaubitz <ja...@glaubitz.org>.
Hi Daniel,

you can create your view in your empire-db model definition like a table. Just use DBView instead of DBTable.

Example here: https://git-wip-us.apache.org/repos/asf?p=empire-db.git;a=blob;f=empire-db-examples/empire-db-example-advanced/src/main/java/org/apache/empire/samples/db/advanced/SampleAdvDB.java;h=43a46f1971b86516d48ae03e06897552ccb87892;hb=HEAD <https://git-wip-us.apache.org/repos/asf?p=empire-db.git;a=blob;f=empire-db-examples/empire-db-example-advanced/src/main/java/org/apache/empire/samples/db/advanced/SampleAdvDB.java;h=43a46f1971b86516d48ae03e06897552ccb87892;hb=HEAD>

- jan

> Am 20.11.2019 um 09:01 schrieb Daniel Wenning <Da...@htwg-konstanz.de>:
> 
> Hello there,
> 
> I am trying to include a VIEW of SQLSERVER 2014 into an EmpireDB SELECT Statement.
> 
> The Statement in SQLSERVER for the view was something like:
> 
> CREATE VIEW foobar AS SELECT TITLE FTOM LECTURE
> JOIN LECTURER ONLECTURER.ID = LECTURE.LECTURER_ID
> WHERE  LECTURER.Name = 'A. Einstein';
> 
> How can I achieve somethin like SELECT * FROM foobar WHERE A = B ?
> 
> Thanks in advance.
> --
> Sincerely
> 
> Daniel Wenning
> 
>