Parametric query in oracle
Posted on 2016-10-25
I would like to parameterize a query in Oracle. I have setup as the following but that doesn't seem to be working.
DECLARE paramQtr varchar(6)
SET paramQtr := '2011Q1'
select S.dept_ID, S.dept_name, s.actualsales, s.quarter, s.expectedsales
from (select distinct f.*, t.quarter
from yearly_sales f left join smry_expectations t
on f.dept_id = t.dept_id where Quarter = :paramQtr) S
Please help. Thanks