Ask Your Question
0

how to change Base table field to required YES [closed]

asked 2017-07-29 18:01:22 +0200

Joe Castor gravatar image

updated 2017-07-29 18:03:49 +0200

I have a text field in a table originally set to Required NO, that I need to change to YES. When trying to change it, I get the error that says the column could not be changed. Should the column instead be deleted and a new column be appended? Answering yes, the next error "Column is referenced in constraint or View" (which it is in several places). Can anything be done to work around this?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Joe Castor
close date 2017-07-31 13:49:28.315463

1 Answer

Sort by » oldest newest most voted
0

answered 2017-07-29 19:41:31 +0200

Ratslinger gravatar image

The column could not be changed because the field is missing data in one or more records. Since you are seemingly tied into other areas with this field, your best bet it to get data into those fields and then you should be able to change the requirement.

edit flag offensive delete link more

Comments

Ratslinger, I ran a query to list any/all entries with EMPTY in that column and there were none. I tried to make the change again without success. Any other ideas?.

Joe Castor gravatar imageJoe Castor ( 2017-07-29 22:45:29 +0200 )edit

Not familiar with EMPTY. Should be something like:

Select * From "YOUR_TABLE" Where "YOUR_FIELD" IS NULL

Ratslinger gravatar imageRatslinger ( 2017-07-29 23:21:01 +0200 )edit

Here is what I ran. Ignore my "empty." Sorry: SELECT "MemberID" AS "MemberID", "FirstName" AS "FirstName", "AlternateFirstName" AS "AlternateFirstName", "LastName" AS "LastName" FROM "MemberMaster" WHERE "AlternateFirstName" = 'NULL' ORDER BY "MemberID" ASC

Joe Castor gravatar imageJoe Castor ( 2017-07-30 01:02:58 +0200 )edit

Your Where says to look for the word NULL in field AlternateFirstName. it should be

Where "AlternateFirstName" IS NULL Note: no quotes around IS NULL.

Ratslinger gravatar imageRatslinger ( 2017-07-30 01:11:13 +0200 )edit

Just a note: "MemberID" AS "MemberID" is just a lot of extra typing. You only want to use AS if you want the column name different. ie: "MemberID" AS "Member Identification".

Ratslinger gravatar imageRatslinger ( 2017-07-30 01:17:08 +0200 )edit

Since I have the odb, I checked this out. View Vue_FamilyList is halting the process. First, I copied the SQL to text editor. Deleted the View. Changed the field in 'MemberMaster'. Re-established View based on SQL saved in text editor. All OK.

Ratslinger gravatar imageRatslinger ( 2017-07-30 20:01:43 +0200 )edit

Once again you worked your magic. Thank you. It's fixed.

Joe Castor gravatar imageJoe Castor ( 2017-07-31 13:48:21 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2017-07-29 18:01:22 +0200

Seen: 205 times

Last updated: Jul 29 '17