sql >> Database >  >> RDS >> Oracle

sub-tekenreeks in orakel

Zoiets misschien; mijn CTE is het resultaat van uw 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. MySQL LOG() Functie – Retourneer de natuurlijke logaritme van een waarde

  2. Veroorzaakt door:android.database.sqlite.SQLiteException:geen dergelijke tabel:(code 1) Android

  3. Oracle Connection String voor RAC-omgeving?

  4. UTF16 hex naar tekst