I am trying to create a stored procedure that will be passed two varchar2(20) variables and return a result set. This is something I can do very easily in MS SQL but I can't seem to get the syntax right in Oracle. I am using Oracle 11.
My select statement is similar to the following.
WITH T AS (
SELECT
PRODUCT_LINE_1
,PRODUCT_LINE_2
,PRODUCT_LINE_3
from Table_Name where formula = @f and version = @v)
SELECT val
FROM T
UNPIVOT INCLUDE NULLS (val FOR ord in(
PRODUCT_LINE_1 AS 7
,PRODUCT_LINE_2 AS 8
,PRODUCT_LINE_3 AS 9
))
ORDER BY ord
Please also provide me the SQL statement I would use to execute it.
Thanks,
Scott