0% found this document useful (0 votes)
82 views24 pages

Oracle

Power BI allows users to transform data into visuals and share with colleagues. It allows exploration and analysis of data from all sources in one view. Power BI has three versions - Power BI Desktop, Power BI Service, and Mobile Power BI. The major components of Power BI are Power Pivot, Power Query, Power Q&A, Power View, and Power Map.

Uploaded by

montosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views24 pages

Oracle

Power BI allows users to transform data into visuals and share with colleagues. It allows exploration and analysis of data from all sources in one view. Power BI has three versions - Power BI Desktop, Power BI Service, and Mobile Power BI. The major components of Power BI are Power Pivot, Power Query, Power Q&A, Power View, and Power Map.

Uploaded by

montosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Mention the important features of Power BI.

Features of Power BI are many. The most notable ones are:


 It allows users to transform data into visuals and share those visuals with colleagues.
 It allows users to explore and analyze data from all sources (in an all-in-one view).
 It allows users to scale across organizations with built-in governance and security.
 Once an output is generated, users can display the same in multiple devices that are compatible
with the Power BI application.
 With Power BI natural language processing or Power BI Q&A, users can perform queries on
reports using simple English words.

What are the versions of Power BI?


Power BI brings in a lot of flexibility when it comes to data reporting and visualization. For this
reason, the complete Power BI package has been divided into three versions. These versions allow all
kinds of users to leverage the functionalities of Power BI to the fullest.
The versions are:
 Power BI Desktop: The on-premise version for Windows 10
 Power BI Service: For publishing to the cloud
 Mobile Power BI: For mobile users

What are the major components of Power BI?


There are five different components of Power BI.
 Power Pivot: Fetches and cleans data and loads on to Power Query
 Power Query: Operates on the loaded data
 Power Q&A: Makes it possible for users to interact with reports using simple English language
 Power View: Lets users create interactive charts, graphs, maps, and other visuals
 Power Map: Enables the processing of accurate geographic locations in datasets

What is the purpose of the ‘Get Data’ icon in Power BI?


When users click on the Get Data icon in Power BI, a drop-down menu appears and it shows all data
sources from which data can be ingested. Data can actually be directly ingested from any source
including files in Excel, CSV, XML, JSON, PDF, and SharePoint formats and databases such as SQL,
Access, SQL Server Analysis Services, Oracle, IBM, MySQL, and much more. Also, Power BI
datasets and Power BI data flows are compatible. Data can also be taken in from Azure and other
online sources.

How can we filter data in Power BI?


Data can be filtered using various filters that are available in Power BI, implicitly. There are basically
three types of filters, namely, Page-level filters, Drillthrough filters, and Report-level filters.
 Drillthrough filters: With Drillthrough filters in Power BI Desktop, users can create a page in
their reports that focuses on specific entities such as suppliers, customers, or manufacturers.
 Page-level filters: These are used to filter charts that are present in individual pages.
 Report-level filters: They are used to simultaneously filter charts that are present in all pages of
a report.

Where is data stored in Power BI?


When data is ingested into Power BI, it is basically stored in Fact and Dimension tables.
 Fact tables: The central table in a star schema of a data warehouse, a fact table stores
quantitative information for analysis and is not normalized in most cases.
 Dimension tables: It is just another table in the star schema that is used to store attributes and
dimensions that describe objects stored in a fact table.

What are Content Packs?


Content packs are packaged reports, dashboards, and datasets, which can be shared with other Power
BI users in the organization. When a content pack is connected on the Powerbi.com portal, report
items are merged into workspace lists.
The most notable features of content packs are as follows:
 Provide access to specific groups or entire organizations
 Can be customized with a title and a description to help users select the right pack
 Users who have access to the content pack can create new dashboards from the contents

What are the different views in Power BI Desktop?


There are three different views in Power BI, each of which serves a different purpose.
 Report View: Users can add visualizations and additional report pages and publish the same on
the portal from here.
 Data View: Data shaping can be performed through Query Editor tools.
 Relationship View: Users can manage relationships between datasets in this view.

What is Row-level Security?


Row-level security restricts the data that a user can view and has access to, based on filters. For
configuring row-level security, users can define rules and roles in Power BI Desktop and publish the
same to Power BI Service. Also, the username() function can be used alongside table relationships to
restrict the data to the current user.
However, for enabling row-level security, a Power BI Pro subscription account is required, and Excel
sheets can only be used when they are converted to the .pbix file format.

What is DAX? What are the benefits of using variables in DAX?


DAX or Data Analysis Expressions can be used to query and return data by a table expression. It is a
formula language that is used to perform basic calculations and data analysis on the data in Power
Pivot. Also, it is used to compute calculated columns, calculated fields, and measures. However, data
cannot be inserted or modified using DAX.
DAX Syntax:
Total Sales = SUM(Sales[SalesAmount])
Where ‘Total Sales’ is a ‘Measure’; ‘SUM’ is a ‘DAX Function’, and ‘Sales[SalesAmount]’
represents the referenced table and the referenced column name.
Benefits of using variables in DAX:
 Variables can be reused in DAX queries, thus avoiding additional queries of the source database.
 Variables make DAX expressions understandable.

What is DAX?
Ans: To do basic calculation and data analysis on data in power pivot, we use Data Analysis
Expression (DAX). It is formula language used to compute calculated column and calculated field.
 DAX works on column values.
 DAX can not modify or insert data.
 We can create calculated column and measures with DAX but we can not calculate rows
using DAX.
Sample DAX formula syntax:
For the measure named Total Sales, calculate (=) the SUM of values in the [SalesAmount] column in
the Sales table.
A- Measure Name
B- = – indicate beginning of formula
C- DAX Function
D- Parenthesis for Sum Function
E- Referenced Table
F- Referenced column name

What are the most common DAX Functions used?

Ans: Below are some of the most commonly used DAX function:
 SUM, MIN, MAX, AVG, COUNTROWS, DISTINCTCOUNT
 IF, AND, OR, SWITCH
 ISBLANK, ISFILTERED, ISCROSSFILTERED
 VALUES, ALL, FILTER, CALCULATE,
 UNION, INTERSECT, EXCEPT, NATURALINNERJOIN,
NATURALLEFTEROUTERJOIN,
SUMMARIZECOLUMNS, ISEMPTY,
 VAR (Variables)
 GEOMEAN, MEDIAN, DATEDIFF

What is Bidirectional Cross-filtering in Power BI?


Bidirectional cross-filtering in Power BI Desktop allows data modelers to determine how they want
filters to flow for data using relationships between tables. With bidirectional cross-filtering, the filter
context is propagated to a second related table on the other side of a table relationship. This can help
data modelers solve the many-to-many problem without writing complicated DAX formulas. Thus,
bidirectional cross-filtering simplifies the job for data modelers.

How are relationships defined in Power BI Desktop?


If there are no null values or duplicate rows, relationships between tables can be defined in two ways:
 Manually: Users can manually define relationships between tables using primary and foreign
keys.
 With the autodetect feature: When enabled, this inherent feature of Power BI detects
relationships between tables and creates them automatically.

What do you know about Power BI Query Editor?


By using Power BI Query Editor, users can load data from a wider number of data sources and apply
transformations on them, including adding new columns and measures.
Power BI Query Editor comprises four tabs:
Query Editor Tab Use Case

Home  Import data from Query Editor into the New Query group
 Use the Parameter group to create and manage parameters
 Include a function to refresh the preview data for the
current table, or all tables, in the dataset
 Manage columns, reduce rows, and sort groups

Transform  Change the data types of columns, rename columns, replace


values, and fix errors in the Any Column group
 Structured Column group provides options for working with
the nested data
 Run R Script function enables to run R Queries directly on
Power BI Query Editor

Add Column  Use Add Custom Column to create a new column using a
DAX formula
 Use Conditional Column to add a column based on the values
in another column
 Use
the From Number group to apply statistical, standard, and
scientific functions to numerical columns

View  Show or hide Query Editor Settings


 From here, the Advanced Editor window can be opened
to view and edit the query code

What is Advanced Editor in Power BI?


Advanced Editor can be used to see the query that Power BI runs against data sources to import data.
 The query is written in M-code, the Power Query Formula Language
 To view the query code from Power BI Desktop, choose Edit Queries from the Home tab
 From either the Home or the View tab, click on Advanced Editor to work on the query. The
Advanced Editor window opens, displaying the code for the currently selected query
 When we make transformations to our data in Query Editor, the steps are saved to the Applied
Steps in the Query Settings
 These steps are also applied to the code in the Advanced Editor

Why should General Formatting be applied to data in Power BI?


By formatting data, users can help Power BI categorize and identify data, making it much easier to
work with.
 Enter a custom formula to create a new column, including calculations using values from the
other columns
 To create a new column, click on Add Custom Column
 In the new column name box, type the name of the column and add the formula to the custom
column formula box; for example, [ShipDate] – [OrderDate]
 Select a column from the available columns list and click on Insert or double-click to add it to
the custom column formula text box. Then, click on OK
 The new column is appended to the table, and the formula is visible in the Formula Bar
Custom Column Formula:
= Table.AddColumn(#"Sorted Rows",
"DaysOrderToShip", each [ShipDate] -
[OrderDate])
The above code is the formula to create a custom column, which calculates the days from when an
order was placed to when it got shipped.

What are the most common data shaping techniques?


The most common data shaping techniques are:
 Removing Columns and Rows
 Adding Indexes
 Applying a Sort Order

What is the difference between Calculated Columns, Calculated Tables, and Measures?
Calculated Columns Calculated Tables Measures

 Added to tables by  Created using DAX  Use other DAX functions


applying DAX formula formula to define values to create complex
on the existing data  Created in both Report calculations
 DAX formula defines and Data views  Used for highlighting
values in new columns  Work well for running totals, comparing
rather than querying data intermediate calculations sales, sales forecasting,
sources and the data that users and other purposes
 Useful when data sources want to be stored in the  Created in both Report
do not contain data model and Data views
presented in the desired
format

Which In-memory Analytics Engine is used in Power Pivot?


The primary in-memory analytics engine behind Power Pivot is xVelocity. This engine handles large
amounts of data as it stores data in columnar databases. In in-memory analytics, all data is loaded to
RAM memory, and therefore processing speed is really fast.

What is Power BI Designer?


A powerful and flexible new tool under Power BI umbrella, Power BI Designer empowers users to
create intuitive reports and dashboards, easily and quickly, and also lets users change visual views of
their data at fingertips for better analytics and informed decision-making. This designer is a host of
drag-and-drop capabilities that help users place content exactly where they want it on the report
canvas in a well-structured layout.

Is it possible to refresh Power BI Reports after they are published to the cloud?
Yes, it is possible. Gateways can be used to do so.
 For SharePoint: Data Management Gateway
 For Powerbi.com: Power BI Personal Gateway

What gateways are available in Power BI and why use them?


A gateway basically acts as a bridge between on-premise data sources and Azure Cloud Services.
 Personal Gateway: Data can be imported and valid on Power BI Service only. Also, this
gateway can only be used by a single person.
 On-premises Gateway: This gateway is the advanced form of Personal gateway. It supports
Direct Query, and multiple users can use this for refreshing data.

How can geographic data be mapped into Power BI Reports?


Through map chart and filled map chart, Power BI makes it possible for users to visually map
geographic data, both globally and regionally.
 Power BI integrates with Bing Maps to find default coordinates for locations in a process known
as geocoding.
 This integration means that users do not need to provide longitude and latitude coordinates.

What happens when you click on a single data point in one of the multiple visuals in a report?
When we do that, data gets selected and copied to the clipboard. Further, the copied data can be
pasted anywhere as per the requirement of the user.
What is z-order in Power BI?
Z-order is a design strategy that is used for arranging visuals over shapes. Also, z-order can be defined
as an implementation method that can be applied when reports have multiple elements. Further, this
can also be used to refresh the display after the order of items in a report is changed.

What is the prerequisite for connecting to a database in Azure SQL Database?


There is only one prerequisite for this. Before connecting to a database in Azure SQL Database, users
should configure firewall settings to allow remote connections.

What is self-service business intelligence?


Ans: Self-Service Business Intelligence (SSBI)
 SSBI is an approach to data analytics that enables business users to filter, segment, and,
analyze their data, without the in-depth technical knowledge in statistical analysis, business
intelligence (BI).
 SSBI has made it easier for end users to access their data and create various visuals to get
better business insights.
 Anybody who has a basic understanding of the data can create reports to build intuitive and
shareable dashboards.

What data sources can Power BI connect to?


Ans: The list of data sources for Power BI is extensive, but it can be grouped into the following:
 Files: Data can be imported from Excel (.xlsx, xlxm), Power BI Desktop files (.pbix) and
Comma Separated Value (.csv).
 Content Packs: It is a collection of related documents or files that are stored as a group. In
Power BI, there are two types of content packs, firstly those from services providers like
Google Analytics, Marketo or Salesforce and secondly those created and shared by other
users in your organization.
 Connectors to databases and other datasets such as Azure SQL, Databaseand SQL, Server
Analysis Services tabular data, etc.

What are Building Blocks in Power BI?


Ans: The following are the Building Blocks (or) key components of Power BI:
1. Visualizations: Visualization is a visual representation of data.
Example: Pie Chart, Line Graph, Side by Side Bar Charts, Graphical Presentation of the
source data on top of Geographical Map, Tree Map, etc.

2. Datasets: Dataset is a collection of data that Power BI uses to create its visualizations.
Example: Excel sheets, Oracle or SQL server tables.

3. Reports: Report is a collection of visualizations that appear together on one or more pages.
Example: Sales by Country, State, City Report, Logistic Performance report, Profit by
Products report etc.

4. Dashboards: Dashboard is single layer presentation of multiple visualizations, i.e we can


integrate one or more visualizations into one page layer.
Example: Sales dashboard can have pie charts, geographical maps and bar charts.

5. Tiles: Tile is a single visualization in a report or on a dashboard.


Example: Pie Chart in Dashboard or Report.

What are the different types of filters in Power BI Reports?


Ans: Power BI provides variety of option to filter report, data and visualization. The following are the
list of Filter types.
 Visual-level Filters: These filters work on only an individual visualization, reducing the
amount of data that the visualization can see. Moreover, visual-level filters can filter both data
and calculations.
 Page-level Filters: These filters work at the report-page level. Different pages in the
same report can have different page-level filters.
 Report-level Filters: There filters work on the entire report, filtering all pages and
visualizations included in the report.
We know that Power BI visual have interactions feature, which makes filtering a report a
breeze. Visual interactions are useful, but they come with some limitations:
 The filter is not saved as part of the report. Whenever you open a report, you can begin to
play with visual filters but there is no way to store the filter in the saved report.
 The filter is always visible. Sometimes you want a filter for the entire report, but you do not
want any visual indication of the filter being applied.

What are content packs in Power BI?


Ans: Content packs for services are pre-built solutions for popular services as part of the Power BI
experience. A subscriber to a supported service, can quickly connect to their account from Power BI
to see their data through live dashboards and interactive reports that have been pre-built for them.
Microsoft has released content packs for popular services such as Salesforce.com, Marketo, Adobe
Analytics, Azure Mobile Engagement, CircuitID, comScore Digital Analytix, Quickbooks Online,
SQL Sentry and tyGraph.

Organizational content packs provide users, BI professionals, and system integrator the tools to build
their own content packs to share purpose-built dashboards, reports, and datasets within their
organization.
Power BI Interview Questions – DAX

How is the FILTER function used?

Ans: The FILTER function returns a table with a filter condition applied for each of its source table
rows. The FILTER function is rarely used in isolation, it’s generally used as a parameter to other
functions such as CALCULATE.
 FILTER is an iterator and thus can negatively impact performance over large source tables.
 Complex filtering logic can be applied such as referencing a measure in a filter expression.
o FILTER(MyTable,[SalesMetric] > 500)

What is special or unique about the CALCULATE and CALCULATETABLE functions?

Ans: These are the only functions that allow you modify filter context of measures or tables.
 Add to existing filter context of queries.
 Override filter context from queries.
 Remove existing filter context from queries.
Limitations:
 Filter parameters can only operate on a single column at a time.
 Filter parameters cannot reference a metric.

What is the common table function for grouping data?

Ans: SUMMARIZE()
 Main groupby function in SSAS.
 Recommended practice is to specify table and group by columns but not metrics.You can use
ADDCOLUMNS function.
SUMMARIZECOLUMNS
 New group by function for SSAS and Power BI Desktop; more efficient.
 Specify group by columns, table, and expressions.

What are some benefits of using Variables in DAX ?

Ans: Below are some of the benefits:


 By declaring and evaluating a variable, the variable can be reused multiple times in a DAX
expression, thus avoiding additional queries of the source database.
 Variables can make DAX expressions more intuitive/logical to interpret.
 Variables are only scoped to their measure or query, they cannot be shared among measures,
queries or be defined at the model level.

How would you create trailing X month metrics via DAX against a non-standard calendar?

Ans: The solution will involve:


1. CALCULATE function to control (take over) filter context of measures.
2. ALL to remove existing filters on the date dimension.
3. FILTER to identify which rows of the date dimension to use.
Alternatively, CONTAINS may be used:
 CALCULATE(FILTER(ALL(‘DATE’),…….))

What are the different Excel BI add-in?


Ans: Below are the most important BI add-in to Excel:
 Power Query: It helps in finding, editing and loading external data.
 Power Pivot: Its mainly used for data modeling and analysis.
 Power View: It is used to design visual and interactively reports.
 Power Map: It helps to display insights on 3D Map.
Power BI Interview Questions – Power Pivot

What is Power Pivot?


Ans: Power Pivot is an add-in for Microsoft Excel 2010 that enables you to import millions of rows
of data from multiple data sources into a single Excel workbook. It lets you create relationships
between heterogeneous data, create calculated columns and measures using formulas, build
PivotTables and PivotCharts. You can then further analyze the data so that you can make timely
business decisions without requiring IT assistance.

What is Power Pivot Data Model?


Ans: It is a model that is made up of data types, tables, columns, and table relations. These data tables
are typically constructed for holding data for a business entity.

What is xVelocity in-memory analytics engine used in Power Pivot?


Ans: The main engine behind power pivot is the xVelocity in-memory analytics engine. It can handle
large amount of data because it stores data in columnar databases, and in memory analytics which
results in faster processing of data as it loads all data to RAM memory.

What are some of differences in data modeling between Power BI Desktop and Power Pivot for
Excel?
Ans: Here are some of the differences:
 Power BI Desktop supports bi-directional cross filtering relationships, security, calculated
tables, and Direct Query options.
 Power Pivot for Excel has single direction (one to many) relationships, calculated columns
only, and supports import mode only. Security roles cannot be defined in Power Pivot for
Excel.

Can we have more than one active relationship between two tables in data model of power
pivot?
Ans: No, we cannot have more than one active relationship between two tables. However, can have
more than one relationship between two tables but there will be only one active relationship and many
inactive relationship. The dotted lines are inactive and continuous line are active.
Power BI Interview Questions – Power Query

What is Power Query?


Ans: Power query is a ETL Tool used to shape, clean and transform data using intuitive interfaces
without having to use coding. It helps the user to:
 Import Data from wide range of sources from files, databases, big data, social media data, etc.
 Join and append data from multiple data sources.
o Shape data as per requirement by removing and adding data.

What are the data destinations for Power Queries?


Ans: There are two destinations for output we get from power query:
1. Load to a table in a worksheet.
2. Load to the Excel Data Model.

What is query folding in Power Query?


Ans: Query folding is when steps defined in Power Query/Query Editor are translated into SQL and
executed by the source database rather than the client machine. It’s important for processing
performance and scalability, given limited resources on the client machine.

What are some common Power Query/Editor Transforms?


Ans: Changing Data Types, Filtering Rows, Choosing/Removing Columns, Grouping, Splitting a
column into multiple columns, Adding new Columns ,etc.

Can SQL and Power Query/Query Editor be used together?


Ans: Yes, a SQL statement can be defined as the source of a Power Query/M function for additional
processing/logic. This would be a good practice to ensure that an efficient database query is passed to
the source and avoid unnecessary processing and complexity
by the client machine and M function.

What are query parameters and Power BI templates?


Ans:Query parameters can be used to provide users of a local Power BI Desktop report with
a prompt, to specify the values they’re interested in.
 The parameter selection can then be used by the query and calculations.
 PBIX files can be exported as Templates (PBIT files).
 Templates contain everything in the PBIX except the data itself.
Parameters and templates can make it possible to share/email smaller template files and limit the
amount of data loaded into the local PBIX files, improving processing time and experience .

Which language is used in Power Query?


Ans: A new programming language is used in power query called M-Code. It is easy to use and
similar to other languages. M-code is case sensitive language.

Why do we need Power Query when Power Pivot can import data from mostly used sources?
Ans: Power Query is a self-service ETL (Extract, Transform, Load) tool which runs as an Excel add-
in. It allows users to pull data from various sources, manipulate said data into a form that suits their
needs and load it into Excel. It is most optimum to use Power Query over Power Pivot as it lets you
not only load the data but also manipulate it as per the users needs while loading.
Power BI Interview Questions – Power Map

What is Power Map?


Ans: Power Map is an Excel add-in that provides you with a powerful set of tools to help you
visualize and gain insight into large sets of data that have a geo-coded component. It can help you
produce 3D visualizations by plotting upto a million data points in the form of column, heat, and
bubble maps on top of a Bing map. If the data is time stamped, it can also produce interactive views
that display, how the data changes over space and time.

What are the primary requirement for a table to be used in Power Map?
Ans: For a data to be consumed in power map there should be location data like:
 Latitude/Longitude pair
 Street, City, Country/Region, Zip Code/Postal Code, and State/Province, which can be
geolocated by Bing
The primary requirement for the table is that it contains unique rows. It must also contain location
data, which can be in the form of a Latitude/Longitude pair, although this is not a requirement. You
can use address fields instead, such as Street, City, Country/Region, Zip Code/Postal Code, and
State/Province, which can be geolocated by Bing.

What are the data sources for Power Map?


Ans: The data can either be present in Excel or could be present externally. To prepare your data,
make sure all of the data is in Excel table format, where each row represents a unique record. Your
column headings or row headings should contain text instead of actual data, so that Power Map will
interpret it correctly when it plots the geographic coordinates. Using meaningful labels also makes
value and category fields available to you when you design your tour in the Power Map Tour Editor
pane.
To use a table structure which more accurately represents time and geography inside Power Map,
include all of the data in the table rows and use descriptive text labels in the column headings, like
this:

In case you wish to load your data from an external source:


1. In Excel, click Data > the connection you want in the Get External Data group.
2. Follow the steps in the wizard that starts.
3. On the last step of the wizard, make sure Add this data to the Data Model is checked.
Power BI Interview Questions – Additional Questions

What is Power View?


Ans: Power View is a data visualization technology that lets you create interactive charts, graphs,
maps, and other visuals which bring your data to life. Power View is available in Excel, SharePoint,
SQL Server, and Power BI.
The following pages provide details about different visualizations available in Power View:
 Charts
 Line charts
 Pie charts
 Maps
 Tiles
 Cards
 Images
 Tables
 Power View
 Multiples Visualizations
 Bubble and scatter charts
 Key performance indicators (KPIs)
What is Power BI Designer?
Ans: It is a stand alone application where we can make Power BI reports and then upload it to
Powerbi.com, it does not require Excel. Actually, it is a combination of Power Query, Power Pivot,
and Power View.

Can we refresh our Power BI reports once uploaded to cloud (Share point or Powebi.com)?
Ans: Yes we can refresh our reports through Data Management gateway(for sharepoint), and Power
BI Personal gateway(for Powerbi.com)

What are the different types of refreshing data for our published reports?
Ans: There are four main types of refresh in Power BI. Package refresh, model or data refresh, tile
refresh and visual container refresh.
 Package refresh
This synchronizes your Power BI Desktop, or Excel, file between the Power BI service and OneDrive,
or SharePoint Online. However, this does not pull data from the original data source. The dataset in
Power BI will only be updated with what is in the file within OneDrive, or SharePoint Online.
 Model/data refresh
It referrs to refreshing the dataset, within the Power BI service, with data from the original data
source. This is done by either using scheduled refresh, or refresh now. This requires a gateway for on-
premises data sources.
 Tile refresh
Tile refresh updates the cache for tile visuals, on the dashboard, once data changes. This happens
about every fifteen minutes. You can also force a tile refresh by selecting the ellipsis (…) in the upper
right of a dashboard and selecting Refresh dashboard tiles.
 Visual container refresh
Refreshing the visual container updates the cached report visuals, within a report, once the data
changes.
To know more about data refresh and understand how to implement data refresh, you can check the
following link.

Is Power BI available on-premises?


Ans: No, Power BI is not available as a private, internal cloud service. However, with Power BI and
Power BI Desktop, you can securely connect to your own on-premises data sources. With the On-
premises Data Gateway, you can connect live to your on-premises SQL Server Analysis Services, and
other data sources. You can also scheduled refresh with a centralized gateway. If a gateway is not
available, you can refresh data from on-premises data sources using the Power BI Gateway –
Personal.

What is data management gateway and Power BI personal gateway?


Ans: Gateway acts a bridge between on-premises data sources and Azure cloud services.
Personal Gateway:
 Import Only, Power BI Service Only, No central monitoring/managing.
 Can only be used by one person (personal); can’t allow others to use this gateway.
On-Premises Gateway:
 Import and Direct Query supported.
 Multiple users of the gateway for developing content.
 Central monitoring and control.

What is Power BI Q&A?


Ans: Power BI Q&A is a natural language tool which helps in querying your data and get the results
you need from it. You do this by typing into a dialog box on your Dashboard, which the engine
instantaneously generates an answer similar to Power View. Q&A interprets your questions and
shows you a restated query of what it is looking from your data. Q&A was developed by Server and
Tools, Microsoft Research and the Bing teams to give you a complete feeling of truly exploring your
data.
What are some ways that Excel experience can be leveraged with Power BI?
Ans: Below are some of the ways through which we can leverage Power BI:
 The Power BI Publisher for Excel:
o Can be used to pin Excel items (charts, ranges, pivot tables) to Power BI Service.
o Can be used to connect to datasets and reports stored in Power BI Service.
 Excel workbooks can be uploaded to Power BI and viewed in the browser like Excel
Services.
 Excel reports in the Power BI service can be shared via Content Packs like other reports.
 Excel workbooks (model and tables) can be exported to service for PBI report creation.
 Excel workbook Power Pivot models can be imported to Power BI Desktop models.

What is a calculated column in Power BI and why would you use them?
Ans: Calculated Columns are DAX expressions that are computed during the model’s
processing/refresh process for each row of the given column and can be used like any other column in
the model.

Calculated columns are not compressed and thus consume more memory and result in reduced query
performance. They can also reduce processing/refresh performance if applied on large fact tables and
can make a model more difficult to maintain/support given
that the calculated column is not present in the source system.

How is data security implemented in Power BI ?


Ans: Power BI can apply Row Level Security roles to models.

 A DAX expression is applied on a table filtering its rows at query time.


 Dynamic security involves the use of USERNAME functions in security role definitions.
 Typically a table is created in the model that relates users to specific dimensions and a role.

What are many-to-many relationships and how can they be addressed in Power BI ?
Ans: Many to Many relationships involve a bridge or junction table reflecting the combinations of
two dimensions (e.g. doctors and patients). Either all possible combinations or those combinations
that have occurred.
 Bi-Directional Crossfiltering relationships can be used in PBIX.
 CROSSFILTER function can be used in Power Pivot for Excel.
 DAX can be used per metric to check and optionally modify the filter context.

Why might you have a table in the model without any relationships to other tables?
Ans: There are mainly 2 reasons why we would have tables without relations in our model:
 A disconnected table might be used to present the user with parameter values to be exposed
and selected in slicers (e.g. growth assumption.)
o DAX metrics could retrieve this selection and use it with other calculations/metrics.
 A disconnected table may also be used as a placeholder for metrics in the user interface.
o It may not contain any rows of data and its columns could be hidden but all metrics
are visible.

What is the Power BI Publisher for Excel?

Ans: You can use Power BI publisher for Excel to pin ranges, pivot tables and charts to Power BI.
 The user can manage the tiles – refresh them, remove them, in Excel.
 Pinned items must be removed from the dashboard in the service (removing in Excel only
deletes the connection).
 The Power BI Publisher for Excel can also be used to connect from Excel to datasets that are
hosted in the Power BI Service.
 An Excel pivot table is generated with a connection (ODC file) to the data in Azure.
The Publisher installs all necessary drivers on local machine to establish connectivity .

What are the differences between a Power BI Dataset, a Report, and a Dashboard?
Ans: Dataset: The source used to create reports and visuals/tiles.
 A data model (local to PBIX or XLSX) or model in an Analysis Services Server
 Data could be inside of model (imported) or a Direct Query connection to a source.
Report: An individual Power BI Desktop file (PBIX) containing one or more report pages.
 Built for deep, interactive analysis experience for a given dataset (filters, formatting).
 Each Report is connected to atleast one dataset
 Each page containing one or more visuals or tiles.
Dashboard: a collection of visuals or tiles from different reports and, optionally, a pinned.
 Built to aggregate primary visuals and metrics from multiple datasets.

What are the three Edit Interactions options of a visual tile in Power BI Desktop?
Ans: The 3 edit interaction options are Filter, Highlight, and None.
Filter: It completely filter a visual/tile based on the filter selection of another visual/tile.
Highlight: It highlight only the related elements on the visual/tile, gray out the non-related items.
None: It ignore the filter selection from another tile/visual.

What are some of the differences in report authoring capabilities between using a live or direct
query connection such as to an Analysis Services model, relative to working with a data model
local to the Power BI Desktop file?
Ans: With a data model local to the PBIX file (or Power Pivot workbook), the author has full control
over the queries, the modeling/relationships, the metadata and the metrics.
With a live connection to an Analysis Services database (cube) the user cannot create new metrics,
import new data, change the formatting of the metrics, etc – the user can only use the visualization,
analytics, and formatting available on the report canvas.
With a direct query model in Power BI to SQL Server, for example, the author has access to the same
features (and limitations) available to SSAS Direct Query mode.
 Only one data source (one database on one server) may be used, certain DAX functions are
not optimized, and the user cannot use Query Editor functions that cannot be translated into
SQL statements.

How does SSRS integrate with Power BI?


Ans: Below are some of the way through which SSRS can be integrated with Power BI:
 Certain SSRS Report items such as charts can be pinned to Power BI dashboards.
 Clicking the tile in Power BI dashboards will bring the user to the SSRS report.
 A subscription is created to keep the dashboard tile refreshed.
 Power BI reports will soon be able to be published to SSRS portal

What is the format available in Power BI?


 Power BI Desktop—for desktop computers
 Power BI service—an online SaaS (software as a service)
 Mobile Power BI apps—for iOS and Android devices
All of these can be used in conjunction. For example, you might create a report on your desktop, and
then publish and share it online so that colleagues on mobile devices can read it.

Describe the building blocks of Power BI


 Visualizations
Visualization is a chart, graph or similar visual representation of data.
 Datasets
A dataset is the group of data used to create a visualization, such as a column of sales figures.
Datasets can be combined and filtered from different sources using built-in connectors.
 Reports
A report is a group of visualizations on one or more pages; for example, charts, graphs, and maps
can be combined to create a report.
 Dashboards
A dashboard lets you share a one-page visualization with others, who can then interact with your
dashboard.
 Tiles
A tile is a visualization on your dashboard or in your report. As the creator, you can move tiles
around.

Iterative Statements in PL/SQL


Iterative control Statements are used when we want to repeat the execution of one or more statements for
specified number of times.
There are three types of loops in PL/SQL:
• Simple Loop
• While Loop
• For Loop

1) Simple Loop
A Simple Loop is used when a set of statements is to be executed at least once before the loop terminates.
An EXIT condition must be specified in the loop, otherwise the loop will get into an infinite number of
iterations. When the EXIT condition is satisfied the process exits from the loop.
General Syntax to write a Simple Loop is
:
LOOP
statements;
EXIT;
{or EXIT WHEN condition;}
END LOOP;
These are the important steps to be followed while using Simple Loop.

1) Initialise a variable before the loop body.


2) Increment the variable in the loop.
3) Use a EXIT WHEN statement to exit from the Loop. If you use a EXIT statement without WHEN
condition, the statements in the loop is executed only once.
2) While Loop
A WHILE LOOP is used when a set of statements has to be executed as long as a condition is true.
The condition is evaluated at the beginning of each iteration. The iteration continues until the
condition becomes false.
The General Syntax to write a WHILE LOOP is:
WHILE <condition>
LOOP statements;
END LOOP;
Important steps to follow when executing a while loop:

1) Initialise a variable before the loop body.


2) Increment the variable in the loop.
3) EXIT WHEN statement and EXIT statements can be used in while loops but it's not done oftenly.
3) FOR Loop
A FOR LOOP is used to execute a set of statements for a predetermined number of times. Iteration
occurs between the start and end integer values given. The counter is always incremented by 1. The
loop exits when the counter reachs the value of the end integer.
The General Syntax to write a FOR LOOP is:
FOR counter IN val1..val2
LOOP statements;
END LOOP;
 val1 - Start integer value.
 val2 - End integer value.
Important steps to follow when executing a while loop:

1) The counter variable is implicitly declared in the declaration section, so it's not necessary to declare
it explicity.
2) The counter variable is incremented by 1 and does not need to be incremented explicitly.
3) EXIT WHEN statement and EXIT statements can be used in FOR loops but it's not done oftenly.
NOTE: The above Loops are explained with a example when dealing with Explicit Cursors.
Implicit Cursors: Application
When you execute DML statements like DELETE, INSERT, UPDATE and SELECT statements,
implicit statements are created to process these statements.
Oracle provides few attributes called as implicit cursor attributes to check the status of DML
operations. The cursor attributes available are %FOUND, %NOTFOUND, %ROWCOUNT, and
%ISOPEN.
For example, When you execute INSERT, UPDATE, or DELETE statements the cursor attributes tell
us whether any rows are affected and how many have been affected.
When a SELECT... INTO statement is executed in a PL/SQL Block, implicit cursor attributes can be
used to find out whether any row has been returned by the SELECT statement. PL/SQL returns an
error when no data is selected.
The status of the cursor for each of these attributes are defined in the below table.
Attributes Return Value Example
%FOUND The return value is TRUE, if the DML statements SQL%FOUND
like INSERT, DELETE and UPDATE affect at least
one row and if SELECT ….INTO statement return
at least one row.
The return value is FALSE, if DML statements like
INSERT, DELETE and UPDATE do not affect row
and if SELECT….INTO statement do not return a
row.
%NOTFOUND The return value is FALSE, if DML statements like SQL%NOTFOUND
INSERT, DELETE and UPDATE at least one row
and if SELECT ….INTO statement return at least
one row.
The return value is TRUE, if a DML statement like
INSERT, DELETE and UPDATE do not affect even
one row and if SELECT ….INTO statement does
not return a row.
%ROWCOUNT Return the number of rows affected by the DML SQL%ROWCOUNT
operations INSERT, DELETE, UPDATE, SELECT

For Example: Consider the PL/SQL Block that uses implicit cursor attributes as shown below:
DECLARE var_rows number(5);
BEGIN
UPDATE employee
SET salary = salary + 1000;
IF SQL%NOTFOUND THEN
dbms_output.put_line('None of the salaries where updated');
ELSIF SQL%FOUND THEN
var_rows := SQL%ROWCOUNT;
dbms_output.put_line('Salaries for ' || var_rows || 'employees are updated');
END IF;
END;
In the above PL/SQL Block, the salaries of all the employees in the ‘employee’ table are updated. If
none of the employee’s salary are updated we get a message 'None of the salaries where updated'. Else
we get a message like for example, 'Salaries for 1000 employees are updated' if there are 1000 rows in
‘employee’ table.
Explicit Cursors 

An explicit cursor is defined in the declaration section of the PL/SQL Block. It is created on a SELECT
Statement which returns more than one row. We can provide a suitable name for the cursor.
General Syntax for creating a cursor is as given below:
CURSOR cursor_name IS select_statement;

 cursor_name – A suitable name for the cursor.


 select_statement – A select query which returns multiple rows.

How to use Explicit Cursor?


There are four steps in using an Explicit Cursor.
 DECLARE the cursor in the declaration section.
 OPEN the cursor in the Execution Section.
 FETCH the data from cursor into PL/SQL variables or records in the Execution Section.
 CLOSE the cursor in the Execution Section before you end the PL/SQL Block.
1) Declaring a Cursor in the Declaration Section:
DECLARE
CURSOR emp_cur IS
SELECT *
FROM emp_tbl
WHERE salary > 5000;
In the above example we are creating a cursor ‘emp_cur’ on a query which returns the records of
all the
employees with salary greater than 5000. Here ‘emp_tbl’ in the table which contains records of all
the
employees.
2) Accessing the records in the cursor:
Once the cursor is created in the declaration section we can access the cursor in the execution
section of the PL/SQL program.
How to access an Explicit Cursor?
These are the three steps in accessing the cursor.
1) Open the cursor.
2) Fetch the records in the cursor one at a time.
3) Close the cursor.
General Syntax to open a cursor is:
OPEN cursor_name;
General Syntax to fetch records from a cursor is:
FETCH cursor_name INTO record_name;
OR

FETCH cursor_name INTO variable_list;


General Syntax to close a cursor is:
CLOSE cursor_name;
When a cursor is opened, the first row becomes the current row. When the data is fetched it is copied
to the record or variables and the logical pointer moves to the next row and it becomes the current
row. On every fetch statement, the pointer moves to the next row. If you want to fetch after the last
row, the program will throw an error. When there is more than one row in a cursor we can use loops
along with explicit cursor attributes to fetch all the records.
Points to remember while fetching a row:
· We can fetch the rows in a cursor to a PL/SQL Record or a list of variables created in the PL/SQL
Block.
· If you are fetching a cursor to a PL/SQL Record, the record should have the same structure as the
cursor.
· If you are fetching a cursor to a list of variables, the variables should be listed in the same order in
the fetch statement as the columns are present in the cursor.
General Form of using an explicit cursor is:
DECLARE
variables;
records;
create a cursor;
BEGIN
OPEN cursor;
FETCH cursor;
process the records;
CLOSE cursor;
END;

Explicit Cursor, Lets Look at the example below

Example 1:
1> DECLARE
2> emp_rec emp_tbl%rowtype;
3> CURSOR emp_cur IS
4> SELECT *
5> FROM
6> WHERE salary > 10;
7> BEGIN
8> OPEN emp_cur;
9> FETCH emp_cur INTO emp_rec;
10> dbms_output.put_line (emp_rec.first_name || ' ' || emp_rec.last_name);
11> CLOSE emp_cur;
12> END;
In the above example, first we are creating a record ‘emp_rec’ of the same structure as of table
‘emp_tbl’ in line no 2. We can also create a record with a cursor by replacing the table name with the
cursor name. Second, we are declaring a cursor ‘emp_cur’ from a select query in line no 3 - 6. Third,
we are opening the cursor in the execution section in line no 8. Fourth, we are fetching the cursor to
the record in line no 9. Fifth, we are displaying the first_name and last_name of the employee in the
record emp_rec in line no 10. Sixth, we are closing the cursor in line no 11.
What are Explicit Cursor Attributes?
Oracle provides some attributes known as Explicit Cursor Attributes to control the data processing
while using cursors. We use these attributes to avoid errors while accessing cursors through OPEN,
FETCH and CLOSE Statements.
When does an error occur while accessing an explicit cursor?
a) When we try to open a cursor which is not closed in the previous operation.
b) When we try to fetch a cursor after the last operation.
These are the attributes available to check the status of an explicit cursor.
Attributes Return values Example
%FOUND TRUE, if fetch statement returns at least Cursor_name%FOUND
one row.
FALSE, if fetch statement doesn’t return a
row.
%NOTFOUND TRUE, , if fetch statement doesn’t return a Cursor_name%NOTFOUND
row.
FALSE, if fetch statement returns at least
one row.
%ROWCOUNT The number of rows fetched by the fetch Cursor_name%ROWCOUNT
statement
If no row is returned, the PL/SQL
statement returns an error.
%ISOPEN TRUE, if the cursor is already open in the Cursor_name%ISNAME
program
FALSE, if the cursor is not opened in the
program.

Using Loops with Explicit Cursors:


Oracle provides three types of cursors namely SIMPLE LOOP, WHILE LOOP and FOR LOOP.
These loops can be used to process multiple rows in the cursor. Here I will modify the same example
for each loops to explain how to use loops with cursors.
Cursor with a Simple Loop:
1> DECLARE
2> CURSOR emp_cur IS
3> SELECT first_name, last_name, salary FROM emp_tbl;
4> emp_rec emp_cur%rowtype;
5> BEGIN
6> IF NOT sales_cur%ISOPEN THEN
7> OPEN sales_cur;
8> END IF;
9> LOOP
10> FETCH emp_cur INTO emp_rec;
11> EXIT WHEN emp_cur%NOTFOUND;
12> dbms_output.put_line(emp_cur.first_name || ' ' ||emp_cur.last_name
13> || ' ' ||emp_cur.salary);
14> END LOOP;
15> END;
16> /
In the above example we are using two cursor attributes %ISOPEN and %NOTFOUND.
In line no 6, we are using the cursor attribute %ISOPEN to check if the cursor is open, if the condition
is true the program does not open the cursor again, it directly moves to line no 9.
In line no 11, we are using the cursor attribute %NOTFOUND to check whether the fetch returned
any row. If there is no rows found the program would exit, a condition which exists when you fetch
the cursor after the last row, if there is a row found the program continues.
We can use %FOUND in place of %NOTFOUND and vice versa. If we do so, we need to reverse the
logic of the program. So use these attributes in appropriate instances.
Cursor with a While Loop:
Lets modify the above program to use while loop.
1> DECLARE
2> CURSOR emp_cur IS
3> SELECT first_name, last_name, salary FROM emp_tbl;
4> emp_rec emp_cur%rowtype;
5> BEGIN
6> IF NOT sales_cur%ISOPEN THEN
7> OPEN sales_cur;
8> END IF;
9> FETCH sales_cur INTO sales_rec;
10> WHILE sales_cur%FOUND THEN
11> LOOP
12> dbms_output.put_line(emp_cur.first_name || ' ' ||emp_cur.last_name
13> || ' ' ||emp_cur.salary);
15> FETCH sales_cur INTO sales_rec;
16> END LOOP;
17> END;
18> /
In the above example, in line no 10 we are using %FOUND to evaluate if the first fetch statement in
line no 9 returned a row, if true the program moves into the while loop. In the loop we use fetch
statement again (line no 15) to process the next row. If the fetch statement is not executed once before
the while loop the while condition will return false in the first instance and the while loop is skipped.
In the loop, before fetching the record again, always process the record retrieved by the first fetch
statement, else you will skip the first row.
Cursor with a FOR Loop:
When using FOR LOOP you need not declare a record or variables to store the cursor values, need not
open, fetch and close the cursor. These functions are accomplished by the FOR LOOP automatically.
General Syntax for using FOR LOOP:
FOR record_name IN cusror_name
LOOP
process the row...
END LOOP;
Let’s use the above example to learn how to use for loops in cursors.
1> DECLARE
2> CURSOR emp_cur IS
3> SELECT first_name, last_name, salary FROM emp_tbl;
4> emp_rec emp_cur%rowtype;
5> BEGIN
6> FOR emp_rec in sales_cur
7> LOOP
8> dbms_output.put_line(emp_cur.first_name || ' ' ||emp_cur.last_name
9> || ' ' ||emp_cur.salary);
10> END LOOP;
11>END;
12> /
In the above example, when the FOR loop is processed a record ‘emp_rec’of structure ‘emp_cur’ gets
created, the cursor is opened, the rows are fetched to the record ‘emp_rec’ and the cursor is closed
after the last row is processed. By using FOR Loop in your program, you can reduce the number of
lines in the program.
NOTE: In the examples given above, we are using backward slash ‘/’ at the end of the program. This
indicates the oracle engine that the PL/SQL program has ended and it can begin processing the
statements.
Stored Procedures

What is a Stored Procedure?


A stored procedure or in simple a proc is a named PL/SQL block which performs one or more specific
task. This is similar to a procedure in other programming languages.
A procedure has a header and a body. The header consists of the name of the procedure and the parameters
or variables passed to the procedure. The body consists or declaration section, execution section and
exception section similar to a general PL/SQL Block.
A procedure is similar to an anonymous PL/SQL Block but it is named for repeated usage.
Procedures: Passing Parameters
We can pass parameters to procedures in three ways.
1) IN-parameters
2) OUT-parameters
3) IN OUT-parameters
A procedure may or may not return any value.

General Syntax to create a procedure is:


CREATE [OR REPLACE] PROCEDURE proc_name [list of parameters]
IS
Declaration section
BEGIN
Execution section
EXCEPTION
Exception section
END;
IS - marks the beginning of the body of the procedure and is similar to DECLARE in anonymous
PL/SQL Blocks. The code between IS and BEGIN forms the Declaration section.
The syntax within the brackets [ ] indicate they are optional. By using CREATE OR REPLACE
together the procedure is created if no other procedure with the same name exists or the existing
procedure is replaced with the current code.
Procedures: Example
The below example creates a procedure ‘employer_details’ which gives the details of the employee.
1> CREATE OR REPLACE PROCEDURE employer_details
2> IS
3> CURSOR emp_cur IS
4> SELECT first_name, last_name, salary FROM emp_tbl;
5> emp_rec emp_cur%rowtype;
6> BEGIN
7> FOR emp_rec in sales_cur
8> LOOP
9> dbms_output.put_line(emp_cur.first_name || ' ' ||emp_cur.last_name
10> || ' ' ||emp_cur.salary);
11> END LOOP;
12>END;
13> /
How to execute a Stored Procedure?
There are two ways to execute a procedure.
1) From the SQL prompt.
EXECUTE [or EXEC] procedure_name;
2) Within another procedure – simply use the procedure name.
procedure_name;
NOTE: In the examples given above, we are using backward slash ‘/’ at the end of the program. This
indicates the oracle engine that the PL/SQL program has ended and it can begin processing the
statements.
PL/SQL Functions

What is a Function in PL/SQL?


A function is a named PL/SQL Block which is similar to a procedure. The major difference between a
procedure and a function is, a function must always return a value, but a procedure may or may not return a
value.
General Syntax to create a function is
CREATE [OR REPLACE] FUNCTION function_name [parameters]
RETURN return_datatype;
IS
Declaration_section
BEGIN
Execution_section
Return return_variable;
EXCEPTION
exception section
Return return_variable;
END;
1) Return Type: The header section defines the return type of the function. The return datatype can
be any of the oracle datatype like varchar, number etc.
2) The execution and exception section both should return a value which is of the datatype defined in
the header section.
For example, let’s create a frunction called ''employer_details_func' similar to the one created in
stored proc
1> CREATE OR REPLACE FUNCTION employer_details_func
2> RETURN VARCHAR(20);
3> IS
5> emp_name VARCHAR(20);
6> BEGIN
7> SELECT first_name INTO emp_name
8> FROM emp_tbl WHERE empID = '100';
9> RETURN emp_name;
10> END;
11> /
In the example we are retrieving the ‘first_name’ of employee with empID 100 to variable
‘emp_name’.
The return type of the function is VARCHAR which is declared in line no 2.
The function returns the 'emp_name' which is of type VARCHAR as the return value in line no 9.
How to execute a PL/SQL Function?
A function can be executed in the following ways.
1) Since a function returns a value we can assign it to a variable.
employee_name := employer_details_func;
If ‘employee_name’ is of datatype varchar we can store the name of the employee by assigning the
return type of the function to it.
2) As a part of a SELECT statement
SELECT employer_details_func FROM dual;
3) In a PL/SQL Statements like,
dbms_output.put_line(employer_details_func);
This line displays the value returned by the function.
Parameters in Procedure and Functions

How to pass parameters to Procedures and Functions in PL/SQL?


In PL/SQL, we can pass parameters to procedures and functions in three ways.
1) IN type parameter: These types of parameters are used to send values to stored procedures.
2) OUT type parameter: These types of parameters are used to get values from stored procedures. This is
similar to a return type in functions.
3) IN OUT parameter: These types of parameters are used to send values and get values from stored
procedures.
NOTE: If a parameter is not explicitly defined a parameter type, then by default it is an IN type parameter.

1) IN parameter:
This is similar to passing parameters in programming languages. We can pass values to the stored procedure
through these parameters or variables. This type of parameter is a read only parameter. We can assign the
value of IN type parameter to a variable or use it in a query, but we cannot change its value inside the
procedure.
General syntax to pass a IN parameter is
CREATE [OR REPLACE] PROCEDURE procedure_name (
param_name1 IN datatype, param_name12 IN datatype ... )
 param_name1, •param_name2... are unique parameter names.
 datatype - defines the datatype of the variable.
 IN - is optional, by default it is a IN type parameter.

2) OUT Parameter:
The OUT parameters are used to send the OUTPUT from a procedure or a function. This is a write-
only parameter i.e, we cannot pass values to OUT paramters while executing the stored procedure, but
we can assign values to OUT parameter inside the stored procedure and the calling program can
recieve this output value.
The General syntax to create an OUT parameter is
CREATE [OR REPLACE] PROCEDURE proc2 (param_name OUT datatype)
The parameter should be explicity declared as OUT parameter.

3) IN OUT Parameter:
The IN OUT parameter allows us to pass values into a procedure and get output values from the
procedure. This parameter is used if the value of the IN parameter can be changed in the calling
program.
By using IN OUT parameter we can pass values into a parameter and return a value to the calling
program using the same parameter. But this is possible only if the value passed to the procedure and
output value have a same datatype. This parameter is used if the value of the parameter will be
changed in the procedure.
The General syntax to create an IN OUT parameter is
CREATE [OR REPLACE] PROCEDURE proc3 (param_name IN OUT datatype)

You might also like