Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to include variable PARAM_EFFECTIVE_DATE in a WHILE LOOP (using SQL in OTBI)?

I want to include the effective date parameter into a loop, but I keep getting an error.

The loop looks like the example below. Thanks for any help



DECLARE

   PARAM_EFFECTIVE_DATE DATE := TO_DATE('2022-01-01', 'YYYY-MM-DD');

COUNTER INT = 1;

BEGIN

WHILE COUNTER < 10

LOOP (SELECT

 abc."Field1" s_1,

 abc."Field2" s_2

FROM (

SELECT 

  "Subject Area"."Folder1"."Field1",

  "Subject Area"."Folder2"."Field2" 

FROM "Subject Area"

) abc

; COUNTER = COUNTER +1

; PARAM_EFFECTIVE_DATE = PARAM_EFFECTIVE_DATE +1

)

; END LOOP

; END

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!