validation

Oracle: find dependent objects

Wednesday, February 28th, 2007

This query helps to find the objects, that depend from the specified one

SELECT CONSTRAINT_NAME, OWNER,TABLE_NAME FROM DBA_CONSTRAINTS
WHERE R_CONSTRAINT_NAME IN
( SELECT CONSTRAINT_NAME
FROM dba_constraints
WHERE
OWNER=upper(’&user_dependent_from’) AND
TABLE_NAME=upper(’&object_dependent_from’)  )
AND STATUS=’ENABLED’;

Example:

CREATE TABLE city ( city_id int , name char(10) , PRIMARY KEY ( city_id ) ) ;
CREATE TABLE country ( cou_id int, name char(19),
city_id int constraint ZZZ REFERENCES city ( city_id [...]

RFC-(2)822/(2)821 compliant e-mail validation in PHP

Thursday, February 2nd, 2006

This code snippet is probably the most easiliy searched one. However most authors do not read RFC. For example, the following address: “John Doe+Super”@example.com is likely to be valid!
The code snippet below is intended for use primarily with web forms therefore CFWS (comments and folding whitespace) is not allowed.

// returns TRUE if e-mail address is [...]

Keep on coding