views and row identifier

Questions and answers regarding general SQL and backend databases

views and row identifier

Postby Hans Nieuwenhuis » Thu Jun 05, 2014 10:52 am

Hi,

I am using Servoy 7.3.1 and Postgresql 9.3
I have a table that has a primary key, so the column that is the primary key is NOT NUL.

I created a view that has that column included and in Servoy I set it as row-identifier.

Servoy now complains :
Code: Select all
Table "tablexx" has column "columnyy" which has row identity set but column allows null.
Make sure column data is never null.


But the "allow null" checkbox is not editable.

What to do ??? or just ignore the warning ??

Regards,
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: views and row identifier

Postby mboegem » Thu Jun 05, 2014 9:10 pm

Hi Hans,

it's been a while ago since I used views, but I think Servoy assumes the column can be empty.
This is strange as you are saying it's the pk in the other table.
Anyway, can you try to put COALESCE around your rowid?
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1749
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: views and row identifier

Postby Hans Nieuwenhuis » Thu Jun 05, 2014 9:36 pm

Thanks Marc,

I'll try that, but I think the problem is more with Postgresql views.

Before I used Oracle and there the columns in a view also have a NotNull atribute.
It looks like Postgresql does not have that.

And I guess Servoy sets all columns in a Postgresql view to nullable.
And then if You set a column as row identifier You end up with this warning.

Maybe one of the Servoyans can comment on this ?

Regards,
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: views and row identifier

Postby deezzub » Fri Jun 06, 2014 2:25 pm

deezzub
 
Posts: 328
Joined: Tue May 28, 2013 3:02 pm
Location: Oldenburg, Germany

Re: views and row identifier

Postby Hans Nieuwenhuis » Fri Jun 06, 2014 4:06 pm

Thanks Sebastian,

I looked at the response to your ticket from Servoy. It is "won't fix".
That makes sense because your case is about tables, for which the columns can be set tot null/not null.

For Postgresql views the columns can not be set to null/not null.

Regards,
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: views and row identifier

Postby deezzub » Fri Jun 06, 2014 5:21 pm

Hans Nieuwenhuis wrote:That makes sense because your case is about tables, for which the columns can be set tot null/not null.

For Postgresql views the columns can not be set to null/not null.


Hello Hans, do you mean in Servoy or in the database?
deezzub
 
Posts: 328
Joined: Tue May 28, 2013 3:02 pm
Location: Oldenburg, Germany

Re: views and row identifier

Postby Hans Nieuwenhuis » Fri Jun 06, 2014 5:39 pm

Hello Sebastian,

Both.

In Postgresql You can not set a views column to null/not null and if a view contains table columns that are defined as not null in the table,
the view does not reflect this.

In servoy the columns from a Postgresql view are all shown as "null allowed" and that flag is not editable.

Regards,
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands


Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 5 guests