hi i want to get
the data only from second error i.e., using regexp or substr
ORA-28007:The pwd cannot be reused.
ORA-06502: PL/SQL:numeric or value error ORA-28007:The pwd cannot be reused.
Assuming that you have the error message in column COL1, this should do it:
SUBSTR(COL1, INSTR(COL1, 'ORA-', 1, 2))
slightwv (䄆 Netminder)
Just in case you ever want just the second error no matter what:
with mydata as(select 'ORA-28007:The pwd cannot be reused. ORA-06502: PL/SQL:numeric or value error ORA-28007:The pwd cannot be reused.' myerror from dual)selectregexp_substr(myerror,'(ORA-[0-9]{5}.+)(ORA-[0-9]{5})',1,1,null,1)from mydata;
SUBSTR(COL1, INSTR(COL1, 'ORA-', 1, 2))