Not Allowing Null And Duplicates

Questions and answers regarding general SQL and backend databases

Not Allowing Null And Duplicates

Postby JonathonBevan1342106235 » Fri Aug 10, 2012 4:05 pm

Hi

I have a table called projects.

It seems to me the best validation when a user enters data is that the database 1. will not accept null in the field project_name and 2 will not allow duplicate project names in the field project_name (ignoring case).

Unfortunately - the "null checkbox" is disabled when I look at my table or sample tables. So I am unable to toggle allow nulls..

Also, I have spent ages looking at the documentation and I cannot find how to not allow duplicates. I really want to apply the rule to the database...

I could do an SQL lookup I suppose but that is more complicated than I imagined. The foundset is a subset of projects so using that cleanly is no good. If I try to do a dataset Servoy tells me there are unupdated foundset records (which is right, I am currently in validation mode and I don't want to save the changes until record is valid). etc..etc..

Any help would be much appreciated
JonathonBevan1342106235
 
Posts: 46
Joined: Thu Jul 12, 2012 5:17 pm

Re: Not Allowing Null And Duplicates

Postby ptalbot » Fri Aug 10, 2012 4:25 pm

Servoy is 'database agnostic', meaning it can connect to any JDBC enabled database, but this also mean that any specific action on that database should be done on specific client/admin UI.
So, depending on the database you are using, you need an admin client to change the nullable value of a field, and add unique constraints, this is not done in Servoy.
For PostgreSQL for example, you can use pgAmin III which is a very good DB client which will allow you to manage and maitain your database. It's free and Open Source and you can download it from here: http://www.pgadmin.org/download/
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Not Allowing Null And Duplicates

Postby JonathonBevan1342106235 » Fri Aug 10, 2012 4:39 pm

Thank you very much. I understand that answer. I know Sevory is a front end thing... I just thought it might support basic common SQL components.

Kind Regards
Jonathon
JonathonBevan1342106235
 
Posts: 46
Joined: Thu Jul 12, 2012 5:17 pm


Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 3 guests

cron