Skip to content
Advertisement

how to fetch email address from oracle database

Hi All i am trying to fetch certain email patterns from oracle db 11g i have used the below queries

Unfortunately i have to scan through the complete schemas in order to fetch the value (@pqr.de) where ever it exists in which ever column and table it is residing , ideally this activity is to list out inactive email addresses (inactive eamil address i need to check seperately in the other system not by querying)

query

i am getting error

Error report –

how to resolve the error , since i am trying to retreive the list of tables from the above query

TESTED QUERY – Failed at line 60

Error report –

Advertisement

Answer

Your approach basically works (though there are simpler methods, if you really have to do this; there are some alternative approaches here for example), so the error you are getting from the execution of a a particular l_sql value suggests a problem with that specific construction. A likely culprit is a table or column name which is a reserved word, which is confusing the parser. You may also have problems with quoted identifiers, and you are looking for tables across all schemas (including internal ones like SYS) but are not specifying the owner of each table.

Those issues can be avoided by adding double-quotes and the owner to your cursor and construction statements:

db<>fiddle

i have tested got the below error

Error report –

The query should be OK with CLOB values, so I suspect line 60 is now the output line, and l_sql is itself too big; in which case you can change that to:

Error report –

ORA-06502: PL/SQL: numeric or value error: number precision too large ORA-06512: at line 61

This is probably when i.seq reaches 128; power(2, 127) is too big for your int result variable. Which if I’m reading this right means you have a table with 128 text columns? Not sure what the point of that is though.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement