cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Using sql inside Notebook using question marks

JensV
New Contributor II

Hi all,

I have a very quick question that I hope someone can help with.

I want to execute a very simple sql statement like 

%sql
select * from  json.`/Volumes/adfmeta/Objects.json`
where ObjectName like '%SGm$RITWebsader$911a%'

However, the sql does not find anything and ask for ::parm insted

How do i accept that my whare clause has question marks????

1 ACCEPTED SOLUTION

Accepted Solutions

JAHNAVI
Databricks Employee
Databricks Employee

Hi @JensV , 
Question marks are used as parameter placeholders, so could you please try to escape the question mark using Backslashes?

select * from json.`/Volumes/adfmeta/Objects.json` where ObjectName like '%SGm\\$RITWebsader\\$911a%'

Alternatively, we can use regex equation like this: SELECT * FROM json.`/Volumes/adfmeta/Objects.json` WHERE ObjectName RLIKE '.*SGm\\$RITWebsader\\$911a.*'

Jahnavi N

View solution in original post

1 REPLY 1

JAHNAVI
Databricks Employee
Databricks Employee

Hi @JensV , 
Question marks are used as parameter placeholders, so could you please try to escape the question mark using Backslashes?

select * from json.`/Volumes/adfmeta/Objects.json` where ObjectName like '%SGm\\$RITWebsader\\$911a%'

Alternatively, we can use regex equation like this: SELECT * FROM json.`/Volumes/adfmeta/Objects.json` WHERE ObjectName RLIKE '.*SGm\\$RITWebsader\\$911a.*'

Jahnavi N

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group