regular_expressions
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| regular_expressions [2018/12/08 12:49] – created 0.0.0.0 | regular_expressions [2019/09/27 07:56] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Regular_Expressions ====== | ||
| - | |||
| Oracle can do almost as much as Perl but it's not quite there yet! | Oracle can do almost as much as Perl but it's not quite there yet! | ||
| - | Select a piece out of a long filename: | ||
| - | < | ||
| This will pick out the date part of the filename. | This will pick out the date part of the filename. | ||
| + | < | ||
| + | string := '/ | ||
| + | |||
| + | select regexp_substr( | ||
| + | , string, | ||
| + | , ' | ||
| + | , 1 --<-- starting position | ||
| + | , 1 --<-- nth occurrence | ||
| + | , ' | ||
| + | , 2 --<-- 11g: subexpression to return | ||
| + | , ) | ||
| + | from dual | ||
| + | </ | ||
| + | |||
| + | Pick out the file number. This expression will work with all these combinations. Useful for automating the addition of datafiles to the tablespace. | ||
| + | < | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | < | ||
| + | select regexp_substr(file_name,' | ||
| + | from | ||
| + | where tablespace_name = ' | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | === References === | ||
| + | [[http:// | ||
| - | ====References==== | ||
| - | [[http:// | ||
regular_expressions.1544273361.txt.gz · Last modified: 2018/12/08 12:49 by 0.0.0.0
