Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Using CTE in Stored Procedure

User_J7CQLJan 28 2021 — edited Jan 28 2021

HI ALl,

I am trying to ceate a stored procedure where I need to make use of CTE as well. I am providing a skeleton below.

CREATE OR REPLACE PROCEDURE "MY_TEST"
BEGIN
WITH CTE1 AS
(
.........................
),
CTE2 AS
(
........ -- Using CTE1 here
),
CTE3 AS
(
..... -- Using CTE1 and CTE2 here
)

Update Statement1 --using CTE3 and CTE1
Update Statement2 --using CTE3 here
Update Statement3 --using CTE3 here

I am running into an issue with error "AN INTO CLAUSE IS EXPECTED IN SELECT". I am not sure how should I make use of INTO clause in this scenario.

Comments

Post Details

Added on Jan 28 2021
2 comments
1,155 views