David Bowman wrote:
I copied some tables from MS Access and tried to set the primary key
and when saving get the following msg.
SQL Status: 23000
Error code: -10
Attempt to insert null into a non-nullable column: column: LastName
table: Student Information in statement [ALTER TABLE "Student
Information" ALTER COLUMN "LastName" VARCHAR(25) NOT NULL]
I would like to know why this is happening and how can I set whatever
field as primary key
When you copy in the data to a new table in a Base file you are given
the option of declaring fields as 'required' or 'not required'. A
primary key field field must be a 'required field' or NOT NULL in it's
definition.
So - if you have moved your data already and have not done this, don't
worry you can fix the problem.
Let's say my import table is called 'access_data' and it has a field
'CustNo' that I want to make the primary key, but I failed to define the
field as NOT NULL - here is what you do.
Open the database, Open the table definition for edit. In the field
select Entry Required = True and save the table definition. Assuming
there are no null values in the column this will save without a problem.
Now you can set the field to be the primary key.
(note if there are any NULL values in that column you will need to fix
that before you can proceed )
--
OpenOffice.org User Community Forum: http://user.services.openoffice.org
United States PostgreSQL Association: http://www.postgresql.us/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]