Another FB system table is system table for trigger. The reason I create this view is to scan for some code inside the source of the trigger. For example, I want to change the field type of table A, then I want to know, this field is being used by which trigger, so I can search thorough this view:
CREATE VIEW "vSYS_FindTriggerSource"(
"triggerName",
"tableName",
"triggerInactive",
"triggerSource")
AS
select r.rdb$trigger_name, r.rdb$relation_name, r.rdb$trigger_inactive, r.rdb$trigger_source
from rdb$triggers r
where r.rdb$system_flag = 0
If you want to seach some text in the trigger source then you can use this simple query:
select *
from "vSYS_FindTriggerSource"
where "triggerSource" containing 'some_field'
The keyword "containing" here (if I'm not forget) is exists from FB 2. The difference between "containing" and "like" is the "like" is case sensitive where "containing" is case insensitive, and also you not need the "%" sign like in "like" keyword.
That view also display the status of the trigger, if the "triggerInactive" field value is zero, then it means that trigger is active and vice versa.
Rabu, 2007 September 19
Langgan:
Poskan Komentar (Atom)

3 komentar:
The first query for system tables which I learn was
select RDB$DEPENDENT_NAME, RDB$DEPENDENT_TYPE
from RDB$DEPENDENCIES
where RDB$DEPENDED_ON_NAME = 'MY_TABLE' and RDB$FIELD_NAME = 'MY_FIELD';
This query show all dependencies on field and dependent type is:
0 - table
1 - view
2 - trigger
3 - computed_field
4 - validation
5 - procedure
6 - expression_index
7 - exception
8 - user
9 - field
10 - index
It was IB4 and WISQL shown very clear message like '... there are X dependencies' on trying to delete some fields...
CONTAINING is in Firebird since the first versions (1.0, 1.5, 2.0).
Milan Babuskov
http://www.firebirdfaq.org
black mold exposureblack mold symptoms of exposurewrought iron garden gatesiron garden gates find them herefine thin hair hairstylessearch hair styles for fine thin hairnight vision binocularsbuy night vision binocularslipitor reactionslipitor allergic reactionsluxury beach resort in the philippines
afordable beach resorts in the philippineshomeopathy for eczema.baby eczema.save big with great mineral makeup bargainsmineral makeup wholesalersprodam iphone Apple prodam iphone prahacect iphone manualmanual for P 168 iphonefero 52 binocularsnight vision Fero 52 binocularsThe best night vision binoculars here
night vision binoculars bargainsfree photo albums computer programsfree software to make photo albumsfree tax formsprintable tax forms for free craftmatic air bedcraftmatic air bed adjustable info hereboyd air bedboyd night air bed lowest pricefind air beds in wisconsinbest air beds in wisconsincloud air beds
best cloud inflatable air bedssealy air beds portableportables air bedsrv luggage racksaluminum made rv luggage racksair bed raisedbest form raised air bedsaircraft support equipmentsbest support equipments for aircraftsbed air informercialsbest informercials bed airmattress sized air beds
bestair bed mattress antique doorknobsantique doorknob identification tipsdvd player troubleshootingtroubleshooting with the dvd playerflat panel television lcd vs plasmaflat panel lcd television versus plasma pic the bestThe causes of economic recessionwhat are the causes of economic recessionadjustable bed air foam The best bed air foam
hoof prints antique equestrian printsantique hoof prints equestrian printsBuy air bedadjustablebuy the best adjustable air bedsair beds canadian storesCanadian stores for air beds
migraine causemigraine treatments floridaflorida headache clinicdrying dessicantair drying dessicantdessicant air dryerpediatric asthmaasthma specialistasthma children specialistcarpet cleaning dallas txcarpet cleaners dallascarpet cleaning dallas
Poskan Komentar