Subject | Re: [firebird-support] hiding some records |
---|---|
Author | Martijn Tonies |
Post date | 2008-07-29T12:15:31Z |
some records
CREATE VIEW ACTIVE_ARTICLES AS
SELECT * FROM ARTICLES WHERE ACTIVE = 'Y'
and use that instead -unless- you want inactive articles as well.
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> Hello, I use FB2.1. Is there any way to hide (at database level) somerecords
> from a table. I have a quite simple scenario: selling articles marked asfar in
> "inactive articles" And the use can choose wheter to see them or not. So
> every query I have for the articles table I do *WHERE ACTIVE = 'Y'* Theproblem
> is that in some forms I keep forgetting to add this clause and sometimesthe
> inactive articles appear even if they are "hidden" in my app. So I waswandering
> if there is some way to filter that records in the database level.Something
> like adding *WHERE ACTIVE = 'Y'* to every select I perform to thearticle's
> table...By far the easiest way of doing this is to create a view:
CREATE VIEW ACTIVE_ARTICLES AS
SELECT * FROM ARTICLES WHERE ACTIVE = 'Y'
and use that instead -unless- you want inactive articles as well.
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com