
ivan

ivan.revelli@synaptica.info

8 March 2010
Oracle Version : 10g
As you know inside a Oracle row trigger you cannot access to the base table, for example when you make a trigger like this, on a table named “activity“.
CREATE OR REPLACE TRIGGER UNAME.ACTIVITY_FK_MENU_INTEGRITY
AFTER INSERT OR UPDATE
ON UNAME.ACTIVITY
REFERENCING NEW AS New OLD AS Old
FOR EACH ROW
DECLARE
tmpVar NUMBER;
e_Menu_Already_Exists EXCEPTION;
BEGIN
[...]

ivan

ivan.revelli@synaptica.info

19 February 2010
by using some simple view in Oracle you can extract a lot of information about your DB schema, some explicit samples :
(assuming that MyDBOwner is the owner of the DB and ACTIVITY is a table of a schema, this sample is succesfully tested on Oracle 10g)
– LIST OF USERS
SELECT OWNER,COUNT(DISTINCT TABLE_NAME) FROM ALL_TAB_COLUMNS [...]

ivan

ivan.revelli@synaptica.info

6 July 2009
Sometime,appen is required to produce an Xml Document where you can’t have a good Xml parser or for perfomance you can’t use that.
Assuming thay you need create a simple Xml file like :
Worng Xml file :
<?xml version="1.0" encoding="ISO-8859-1"?>
<person>
<firstname>Rossi</firstname>
<lastname>Rossiglio</lastname>
<birthdate>27/02/1973</birthdate>
<companyname>pippo&pluto</companyname>
</person>