regexp-like

Oracle query logic to identify email addresses across the dwh schemas

百般思念 提交于 2021-02-17 06:46:12
问题 I was performing an activity to identify eMail addresses based on certain pattern (@xyz.de). I initially tried checking the DBA_TAB_COLS [data dictionary] view but this just finds email column names and I manually need to check the big list of tables. Instead of doing that, is there is a more effective way to just fetch the the pattern value @xyz.de ? Database - oracle 11g Query used SET SERVEROUTPUT ON 100000 DECLARE lv_count number(10):=0; l_str varchar2 (1000); lv_col_name varchar2(255) :=

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION

旧城冷巷雨未停 提交于 2020-07-23 09:21:05
问题 Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION . My answer/tried code is: select city from station where REGEXP_LIKE(city,'[^aeiou]+'); But it doesn't seem to be correct. Kindly help me with this. 回答1: As BackSlash have already commented, you've written the wrong REGEXP_LIKE pattern and you should change it to '^[aeiou].+' , or you can even ommit .+ from your pattern, as you're only interested in the first letter of your string (containing more than 1

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION

对着背影说爱祢 提交于 2020-07-23 09:20:14
问题 Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION . My answer/tried code is: select city from station where REGEXP_LIKE(city,'[^aeiou]+'); But it doesn't seem to be correct. Kindly help me with this. 回答1: As BackSlash have already commented, you've written the wrong REGEXP_LIKE pattern and you should change it to '^[aeiou].+' , or you can even ommit .+ from your pattern, as you're only interested in the first letter of your string (containing more than 1

Oracle split message with regexp_substr

穿精又带淫゛_ 提交于 2020-01-24 00:19:11
问题 I need to split message: 500 Oracle Parkway.Redwood Shores.*.=13 Now I have a bit worked solution for Substr1/2/4 SELECT '500 Oracle Parkway.Redwood Shores.*.=13' string1, REGEXP_SUBSTR('500 Oracle Parkway.Redwood Shores.*.=13','.[^.]+') "SUBSTR1" , replace(REGEXP_SUBSTR('500 Oracle Parkway.Redwood Shores.*.=13','[$.]+ [^.]+'),'.',null) "SUBSTR2" , REGEXP_SUBSTR('500 Oracle Parkway.Redwood Shores.*.=13','[$.]+.[$.]+[^.]') "SUBSTR3" , REGEXP_SUBSTR('500 Oracle Parkway.Redwood Shores.*.=13','[^

jpa native Query regexp like with querydsl

断了今生、忘了曾经 提交于 2020-01-06 06:41:12
问题 I have i query statement like this: select t.* from T_ex_table t where regexp_like(t.note, '^(.*[^[:digit:]]+)?([condition])([^[:digit:]]+.*)?$', 'n') And if I use it in jpa with querydsl(com.querydsl) like(this is scala, and it doesn't important): @Query(value = "select t.*" + " from T_PURCHASE t" + " where regexp_like(t.note," + " '^(.*[^[:digit:]]+)?([?1])([^[:digit:]]+.*)?$'," + " 'n')", nativeQuery = true) def getByTrackingNo(trackingNo: String): Purchase While i debug test, it always

Oracle SQL - Get rows with values in IP address format (dotted quad)

一世执手 提交于 2019-12-08 08:14:37
问题 I have a table which has SOURCEIP and DESTINATIONIP columns, and their data type is VARCHAR2. A value in these columns is either an IP address in dotted quad format, or an encrypted anonymous address, which in this case it can be a random string of letters and digits in varying lengths. Which query can I use which will only give me rows with an least one proper (dotted quad) IP in either SOURCEIP or DESTINATIONIP? 回答1: To validate the IP address, you could use REGEXP_LIKE . Pattern : 0-255.0

Oracle SQL - Get rows with values in IP address format (dotted quad)

梦想的初衷 提交于 2019-12-08 02:44:25
I have a table which has SOURCEIP and DESTINATIONIP columns, and their data type is VARCHAR2. A value in these columns is either an IP address in dotted quad format, or an encrypted anonymous address, which in this case it can be a random string of letters and digits in varying lengths. Which query can I use which will only give me rows with an least one proper (dotted quad) IP in either SOURCEIP or DESTINATIONIP? To validate the IP address, you could use REGEXP_LIKE . Pattern : 0-255.0-255.0-255.0-255 For example, SQL> WITH DATA AS( 2 SELECT '10.20.30.40' ip_address FROM dual UNION ALL 3