Last active
April 10, 2019 11:49
-
-
Save edermfl/dd18cbed62be692b2abb1d433ee90db1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--IMPORTANTE: O ÚLTIMO PARAMENTRO INDICA QUAL O GRUPO QUE SERÁ RETORNANDO, VIDE EXEMPLO: | |
-- RECUPERA DA MENSAGEM O NOME DA USUÁRIO/SCHEMA, RETORNANDO "SCHEMA" | |
SELECT REGEXP_SUBSTR('ORA-01400: cannot insert NULL into ("SCHEMA"."TABLE_NAME"."COLUMN_NAME")','"(.*?)"',1,1) FROM DUAL; | |
-- RECUPERA DA MENSAGEM O NOME DA TABELA, RETORNANDO "TABLE_NAME" | |
SELECT REGEXP_SUBSTR('ORA-01400: cannot insert NULL into ("SCHEMA"."TABLE_NAME"."COLUMN_NAME")','"(.*?)"',1,2) FROM DUAL; | |
-- RECUPERA DA MENSAGEM O NOME DA COLUNA, RETORNANDO "COLUMN_NAME" | |
SELECT REGEXP_SUBSTR('ORA-01400: cannot insert NULL into ("SCHEMA"."TABLE_NAME"."COLUMN_NAME")','"(.*?)"',1,3) FROM DUAL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment