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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
Ashok_Gopeani
Helper I
Helper I

Facing issue while referring query parameters in direct query

Hi Team,

 

I am trying to referring query parameters in direct query like below but it is giving error always...

SELECT * FROM table_name WHERE cm_run_id = @cmrunid

Ashok_Gopeani_0-1745826360634.png

could you please let me know what is the correct syntax to refer query params in direct query for paginated report

 

1 ACCEPTED SOLUTION
grazitti_sapna
Super User
Super User

Hi @Ashok_Gopeani,

The error ORA-00936 typically occurs in Oracle databases and indicates a missing expression in your SQL query. This error is often caused by an incomplete or improperly structured SQL query.

 

In Oracle, parameters are typically referred to with a colon (:) before the parameter name, unlike SQL Server which uses @. So, change @cmrunid to :cmrunid for Oracle.

 

  • In Power BI Report Builder, after creating the parameter (cmrunid), make sure that it is mapped correctly to the query. Oracle expects the parameter to be prefixed with a colon (:).

  • Make sure that the Data Type of the parameter matches the Data Type of cm_run_id in the database (e.g., if cm_run_id is a string in the database, set your parameter data type to Text).

Try using 

SELECT *
FROM table_name
WHERE cm_run_id = :cmrunid

 

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!

 

 

View solution in original post

2 REPLIES 2
Ashok_Gopeani
Helper I
Helper I

Thank you very much for the solution.. its working

grazitti_sapna
Super User
Super User

Hi @Ashok_Gopeani,

The error ORA-00936 typically occurs in Oracle databases and indicates a missing expression in your SQL query. This error is often caused by an incomplete or improperly structured SQL query.

 

In Oracle, parameters are typically referred to with a colon (:) before the parameter name, unlike SQL Server which uses @. So, change @cmrunid to :cmrunid for Oracle.

 

  • In Power BI Report Builder, after creating the parameter (cmrunid), make sure that it is mapped correctly to the query. Oracle expects the parameter to be prefixed with a colon (:).

  • Make sure that the Data Type of the parameter matches the Data Type of cm_run_id in the database (e.g., if cm_run_id is a string in the database, set your parameter data type to Text).

Try using 

SELECT *
FROM table_name
WHERE cm_run_id = :cmrunid

 

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!

 

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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