On Sun, Jul 11, 2010 at 09:12:09AM -0500, Jay A. Kreibich scratched on the wall:
> On Sun, Jul 11, 2010 at 01:45:50PM +0000, c...@comcast.net scratched on the 
> wall:
> 
> > I would like to restrict the values that are entered into
> > the "recommendation" column. 
> > 
> > How would I state that at the time I create the column in that table? 
> 
>   Using a CHECK constraint.
> 
> > Since that table/column exists today without any restrictions, how
> > do I alter it to restrict the values entered? 
> 
>   You can't.  You need to build a new table and copy the data over.

  I should have been more specific...

  You can't add a CHECK constraint to an existing table.  
 

  You could also limit values with a set of BEFORE INSERT and BEFORE
  UPDATE triggers.  Triggers can be added to an existing table.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to