Ask Your Question
0

Can I prevent base from putting duplicates in a table? [closed]

asked 2013-08-05 15:33:29 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Can I prevent base from putting duplicates in a table? I have added the same name twice in a table. Now I've been searching but can not find anything about this. Is it possible to make so that no two of the same name can get into a table.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-05 23:06:22.381632

2 Answers

Sort by » oldest newest most voted
1

answered 2013-08-06 01:01:26 +0100

w_whalley gravatar image

You can add a unique constraint to the column. Here's how.

You can avoid the case sensitivity problem pointed out by tinus087 by defining the text field as VARCHAR_IGNORECASE.

edit flag offensive delete link more

Comments

good job on the link, very usefull. I already tested the VARCHAR_IGNORECASE the outcome was the same.

Tested it again with, you where right. The VARCHAR_IGNORECASE in combination with the SQL code ALTER TABLE "Customers" ADD UNIQUE ("CustomerID"); works perfect.

tinus087 gravatar imagetinus087 ( 2013-08-06 08:11:44 +0100 )edit
0

answered 2013-08-05 16:08:47 +0100

tinus087 gravatar image

updated 2013-08-05 16:45:24 +0100

One way to do this is to make the 'Name' field the primary key. Only downside is that if you use a client ID or person ID you must fill it in yourself.

Please note that if you choose to use this, that the use of capital letters will matter. For example 'Smith' and 'smith' will create 2 different records in the database.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-08-05 15:33:29 +0100

Seen: 1,234 times

Last updated: Aug 06 '13