sql >> Databasteknik >  >> RDS >> Oracle

understräng i orakel

Något sånt här, kanske; min CTE är resultatet av din GET_DDL.

with test (col) as 
(select q'[
CREATE OR REPLACE  TRIGGER "owner"."trigger_delete" BEFORE DELETE ON roles FOR EACH ROW
BEGIN
DBMS_APPLICATION_INFO.read_client_info (acct_utils.trigger_enabled);
IF acct_utils.trigger_enabled <> 'F' THEN
  INSERT INTO delete_table (ID, key, object, type, keytype, objecttype, created, deleted, deletedby) VALUES(
    :old.id,
    :old.key,
    'delete',
    null,
    :old.keytype,
    null,
    :old.whencreated,
    (CURRENT_TIMESTAMP AT TIME ZONE 'GMT'),
    SYS_CONTEXT('TMCtx', 'USERKEY')
  );
END IF;
END trigger_delete;]' 
from dual)
select substr(col, 
              instr(upper(col), 'INSERT INTO DELETE_TABLE'),
              --
              instr(col, ';', instr(upper(col), 'INSERT INTO DELETE_TABLE'), 1) -
              instr(upper(col), 'INSERT INTO DELETE_TABLE') + 1
             ) result
from test;



  1. MariaDB UCASE() Förklarad

  2. Hur konverterar man en MySQL DB till XML?

  3. Hur man ställer in Oracle EBS Auditing

  4. Inga operationer tillåtna efter att uttalandet stängts