> > > Here's another use for flagging records: Our db tables which
> > > contain scientific data contain an "approved" field, whose
> > > default value is "false". After data is inserted into the
> > > database, an analyst checks it out, and then we toggle the
> > > flag to "true". Of course, our non-admin canned queries all
> > > include "WHERE approved = true".
> >
> > This is a good place to use views. You can create views for 
> > these tables using this WHERE clause, and allow end users to 
> > run whatever queries they want.
> 
> Views???

Views are "virtual tables". You can create a view with an SQL statement that
selects the slice of data that you want. That view can then be treated, in
most respects, as if it were a table.

CREATE VIEW ApprovedOnly AS

SELECT abunchoffields
FROM     mytable
WHERE  approved = 1

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to