-- file_names that are not ended with numeric value after chr(59) _
select file_name
from dba_data_files
where substr(file_name,1,instr(file_name,'.dbf')) like '%\_%' escape '\'
and is_number(replace(substr (substr(file_name,1,instr(file_name,'.dbf')),instr(file_name,'_',1,(REGEXP_COUNT(file_name, '_', 1, 'i')))+1,100 ),'.','')) = 0
CREATE FUNCTION is_number (p_string IN VARCHAR2)
RETURN INT
IS
v_new_num NUMBER;
BEGIN
v_new_num := TO_NUMBER(p_string);
RETURN 1;
EXCEPTION
WHEN VALUE_ERROR THEN
RETURN 0;
END is_number;
Komentarze
Prześlij komentarz