On 12/8/06 9:47 PM, Jeffrey Horn wrote: > I have a database table in which several columns are all functions of a > single sixteen digit number. Some of them are subsets of digits, others are > encryptions of the number, etc. > > Is there a way in RDBO to override things so that I can get all the > individual values of the columns, but can prevent setting these columns > directly? I would like to try to enforce just setting the sixteen digit > number and having the other columns auto-populated from it.
To prevent certain columns from being set, add "on_set" triggers that die or croak or cause some other kind of fatal error. To automatically set the other numbers when the big sixteen-digit number is set, add "on_set" and "on_load" triggers to that column that split the value up and set all the other columns. (Triggers are disabled during trigger-service routines, so this will work okay.) Read all about triggers here: http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/Metadata/Colum n.pm#TRIGGERS -John ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object