I want to create projection by joining two flex tables, while creating projection it is giving the error as PK=FK relationships should be defined on the joining fields. I am able to create PK on the master table; but while creating foreign key on child table; its giving error as incompatible datatype on the primary key and foreign key fields.
I have made the joining fields as real columns in flex table. The data type of joining fields are varchar(40)
Below is the code :
CREATE projection flex_projection_emp_dep (emp_dept,dept_name,dept_code)
AS select e.dept,d.dept,d.dept_code from flex_emp e INNER join
flex_dep d
on e.dept=d.dept
below code worked fine while creating primary key:
alter table flex_emp add primary key(dept)
Below code didn't worked while creating foreign key:
alter table flex_dep add foreign key(dept) references flex_emp(dept)
It is giving error: incompatible data type between primary key and foreign key columns. Although datatype of joining fields are same i.e varchar(40).
How to create foreign key on flex table?
How to create projections by joining two flex tables
Moderator: NorbertKrupa
Re: How to create projections by joining two flex tables
Hi,
As per the question from your subject, we can't create Pre Join projection on flex tables , instead you can create View by joining two flex tables.
Or
You can create projections on individual flex table and create a View by joining two Projections.
-Sasi
As per the question from your subject, we can't create Pre Join projection on flex tables , instead you can create View by joining two flex tables.
Or
You can create projections on individual flex table and create a View by joining two Projections.
-Sasi