Skip to content

Tag: regex

How to select values between a XML tag in SQL Query

I have a table with CLOB column storing a XML. The structure of XML is unreadable. I want to get values between few tags like <DOMAINID>; sample is shown below. XML: I am using this: Expected result: Actual XML: Answer Do not use regular expressions to parse XML; use a proper XML parser. However, what you have is not properly

Regexp search SQL query fields

I have a repository of SQL queries and I want to understand which queries use certain tables or fields. Let’s say I want to understand what queries use the email field, how can I write it? Example SQL …

Convert from sql query condition to REGEXP_LIKE

I am converting an SQL query condition like: I tried to execute query in Oracle using condition belove but no result return: Result look like for example 169011310 so _ are numeric characters Answer The $ in regex means end of string, you need to remove it because % in TSQL means any text, any zero or more chars, and

Problems passing a Python String to SQL query

I got some issues passing my SQL query made in Python to MS SQL. Were talking about retrieving some code via pyodbc, editing it with regex, and passing it back into a new table of the Database. I also tried some print()-Commands to assure the Code is running in Python and being edited the right way, but I am not