I am using PHP to insert data to Oracle db. There is a table field with datatype CLOB but it allows to insert upto 4000 characters. I did a bit of searching on Google and found that PL/SQL can insert more than 4000 chars to CLOB field. Then I plan to use Oracle Trigger to solve my problem. My plan is replace the PHP insert query with PLSQL insert.
create or replace
TRIGGER EXTEND_CLOB
BEFORE INSERT ON T_SESSIONS
for each row
BEGIN
insert into t_sessions (id,data,expires) values ( :new.id, :new.data, :new.expires );
END;
This trigger can work but it will insert 2 records (trigger once, PHP once). Is there anyway to ignore the query insert by PHP?