Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Paramenter list in SQL - to be used as variables with quotes and commas

Hello Community,

 

I have this SQL query for Oracle DB:

 

SELECT *
FROM
myTables
WHERE
OBS_DATE > (trunc(sysdate) - 365)

AND NAME in (

LIST OF VARIABLES 

)

 

 

The LIST of VARIABLES is usually an alphanumeric number and it must have quotes:

for instance:

'PPF000000028300444',
'PPF000000028300334'

 

I would like to have a Parameter that I can udpate and holds a list of this codes, with commas and quotes.

 

Therfore, how can I have inside the above query a parameter with my LIST of VARIABLES?

 

Thank you in advance,

Luca.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

So the secret is:

 

go into edit query -> advance editor -> put in the query NAME in ('"&PARAMETER_NAME&"').

 

since the parameter is aphanumeric: format such parameter as text.

 

Done. 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

So the secret is:

 

go into edit query -> advance editor -> put in the query NAME in ('"&PARAMETER_NAME&"').

 

since the parameter is aphanumeric: format such parameter as text.

 

Done. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.