Desktop productivity for business analysts and programmers

Column level lock or Contraint on editing by column in EG

Reply
Contributor
Posts: 22

Column level lock or Contraint on editing by column in EG

I know that there are method to protect record in dataset by lib, rec and mem level. I wonder if I can protect particular column in the dataset from being edited?

Some trick i have played with:
1. create IC on dataset A with dataset B reference on A primary key, so that dataset A's primary cannot be edited. (can i customerised the error message when editing dataset A's primary key? i only can customerised the message when editing the foreign key on B)
2. create a dummy column same as the required to be protected column ccc, then create ic on check the value where ccc = dummy. (can i hide the dummy by code in dataset ? or can i check the value on a different dataset ?)

I know the tricks are silly, but that what i can only think of, please shed me some light please!
PROC Star
Posts: 1,146

Re: Column level lock or Contraint on editing by column in EG

A very common one is to define a view on the base table. Only give access to the view to your users. Leave out any columns you don't want them to see, make the permissions on the view read-only.

I'm not sure you could have some columns updatable and others read-only.
Contributor
Posts: 22

Re: Column level lock or Contraint on editing by column in EG

thanks for the reply TomKari, but i has to clarify that the read-only i want to protect is those reference column and i have already defined a view based on the original table. I already "Leave out any columns you don't want them to see", so..thanks for your reply anyway, anyone else please shed me some light....
Super User
Posts: 5,388

Re: Column level lock or Contraint on editing by column in EG

A dull (?) answer is to store your data in a database that supports column level security.
I think most commercial databases do (including SAS SPD Server).

/Linus
Data never sleeps
Ask a Question
Discussion stats
  • 3 replies
  • 182 views
  • 0 likes
  • 3 in conversation