I've setup an 'After Update' trigger on my table (project)
to record changes in a clob column called 'Note'.
My Project table structure is: (prj_id number(6), note clob).
My trigger definition is:
1. Create or Replace Trigger PROJECT_U
2. AFTER UPDATE on PROJECT
3. for EACH ROW
4. begin
-- dump structure: (oldv varchar2(500), newv varchar2(500)
5. insert into dump values(DBMS_LOB.substr(
ld.note,500,1),
6. DBMS_LOB.substr
new.note,500,1));
7. end;
Here's what's happening:
Good Behaviour: When I use TOracleQuery (tsql) and execute the following:
tsql.SQL.Clear;
tsql.SQL.Add('Update project set note=''You will see this...'' where prj_id=1001');
tsql.Execute;
the :new.note in the trigger body returns 'You will see this...'. This is OK!
Unacceptable Behaviour: When I use a TOracleDataset (tds), tie it with
a TwwDBGrid and edit the 'note' column in the grid (e.g. typed 'You
should see this...'), the trigger body fires but the :new.note returns
an empty string.
I set the TOracleDataset as follows:
tds.Active := False;
tds.SQL.Clear;
tds.SQL.Add('select p.*, p.rowid from project p'); // updateable table
tds.Active := True; // this will show the rows in the grid.
Interestingly, this also happened in the PL/SQL Developer when I edited the
'note' column directly in the grid. The plain SQL 'Update project set...'
behaved properly as above.
Can anybody please help? I'm
...
to record changes in a clob column called 'Note'.
My Project table structure is: (prj_id number(6), note clob).
My trigger definition is:
1. Create or Replace Trigger PROJECT_U
2. AFTER UPDATE on PROJECT
3. for EACH ROW
4. begin
-- dump structure: (oldv varchar2(500), newv varchar2(500)
5. insert into dump values(DBMS_LOB.substr(

6. DBMS_LOB.substr

7. end;
Here's what's happening:
Good Behaviour: When I use TOracleQuery (tsql) and execute the following:
tsql.SQL.Clear;
tsql.SQL.Add('Update project set note=''You will see this...'' where prj_id=1001');
tsql.Execute;
the :new.note in the trigger body returns 'You will see this...'. This is OK!
Unacceptable Behaviour: When I use a TOracleDataset (tds), tie it with
a TwwDBGrid and edit the 'note' column in the grid (e.g. typed 'You
should see this...'), the trigger body fires but the :new.note returns
an empty string.
I set the TOracleDataset as follows:
tds.Active := False;
tds.SQL.Clear;
tds.SQL.Add('select p.*, p.rowid from project p'); // updateable table
tds.Active := True; // this will show the rows in the grid.
Interestingly, this also happened in the PL/SQL Developer when I edited the
'note' column directly in the grid. The plain SQL 'Update project set...'
behaved properly as above.
Can anybody please help? I'm
