Recently a colleague of mine needed to access Oracle to build a report but did not have the rights to create a stored procedure, which would be the obvious method of choice. We therefore need to pass parameters from Reporting Services to Oracle using the “Query Type” of text. To do this in SQL Server it is relatively intuitive.
Create a shared Data Source – I have used Adventure Works.
Then add a DataSet:
This query will return all records from the Adventure Works ‘people’ table, showing the following fields; FirstName, MiddleName, LastName and Email Address. If you wanted to restrict this list using a parameter, all you would need to do is add a parameter to the report.
In this instance I have added a parameter titled “EndsWith”, so we can use a WHERE with any character or string to filter by the last characters of the FirstName. I have also added a parameter called “BeginsWith”. Now you can edit the DataSet to add the where statement as follows:
SELECT FirstName, MiddleName, LastName, EmailAddress
FROM Person.Contact
WHERE (FirstName LIKE @BeginsWith +’%’ + @EndsWith)
Now this will work perfectly with SQL Server, however should you wish to connect to Oracle, you will need to make a few simple, but not obvious, changes. These are as follows:
SELECT FirstName, MiddleName, LastName, EmailAddress
FROM Person.Contact
WHERE (FirstName LIKE :BeginsWith +’%’ + :EndsWith)
So in short all you have to do is change the @ sign to a : (colon), easy when you know how, a real pain when you don’t!
This report will appear as follows when connected to Oracle, or SQL (as long as there are the same databases).
How Artificial Intelligence and Data Add Value to Businesses
Knowledge is power. And the data that you collect in the course of your business
May
Databricks Vs Synapse Spark Pools – What, When and Where?
Databricks or Synapse seems to be the question on everyone’s lips, whether its people asking
1 Comment
May
Power BI to Power AI – Part 2
This post is the second part of a blog series on the AI features of
Apr
Geospatial Sample architecture overview
The first blog ‘Part 1 – Introduction to Geospatial data’ gave an overview into geospatial
Apr
Data Lakehouses for Dummies
When we are thinking about data platforms, there are many different services and architectures that
Apr
Enable Smart Facility Management with Azure Digital Twins
Before I started writing this blog, I went to Google and searched for the keywords
Apr
Migrating On-Prem SSIS workload to Azure
Goal of this blog There can be scenario where organization wants to migrate there existing
Mar
Send B2B data with Azure Logic Apps and Enterprise Integration Pack
After creating an integration account that has partners and agreements, we are ready to create
Mar