Skip to Main Content

APEX

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.

cursor is not working

shekhar chandelOct 16 2024

My Automation is only running for first value for c1 and c2 next item are not coming.

I created rest data source using rest api

===============================================================================

DECLARE
l_parameters apex_exec.t_parameters;
l_finder_param VARCHAR2(4000);
l_start_date VARCHAR2(10);
l_end_date VARCHAR2(10);

CURSOR c1 IS
SELECT USERCONVERSIONTYPE FROM GL_DAILY_CONVERSION_TYPES where USERCONVERSIONTYPE in('Corporate','Daily Rate');

CURSOR c2 IS
SELECT
a.Currency_Code AS fromCurrency,
b.Currency_Code AS toCurrency
FROM
FND_CURRENCIES a,
FND_CURRENCIES b
WHERE
a.Enabled_Flag = 'Y'
AND b.Enabled_Flag = 'Y'
AND a.Currency_Code <> b.Currency_Code
And a.Currency_Code in ('USD','INR','HUF')
And b.Currency_Code in ('USD','INR','HUF')

BEGIN
l_start_date := '2022-01-19';
l_end_date := '2023-01-20';

FOR r1 IN c1 LOOP
FOR r2 IN c2 LOOP

      l\_finder\_param :=  'CurrencyRatesFinder;' ||  
                         'fromCurrency=' || r2.fromCurrency || ',' ||  
                         'toCurrency=' || r2.toCurrency || ',' ||  
                         'userConversionType=' || r1.USERCONVERSIONTYPE || ',' ||  
                         'startDate=' || l\_start\_date || ',' ||  
                         'endDate=' || l\_end\_date ;

         
           apex\_exec.add\_parameter(  
               p\_parameters => l\_parameters,  
               p\_name       => 'finder',  
               p\_value      => l\_finder\_param  
           );     
            
   apex\_rest\_source\_sync.dynamic\_synchronize\_data(  
               p\_module\_static\_id => 'gl\_daily\_rates',  
               p\_sync\_static\_id   => 'Dynamic finder',  
               p\_sync\_parameters  => l\_parameters  
           );  
       


   END LOOP;   

END LOOP;

EXCEPTION
WHEN OTHERS THEN
APEX_ERROR.ADD_ERROR(
p_message => 'Error occurred: ' || SQLERRM,
p_display_location => apex_error.c_inline_in_notification,
p_additional_info => 'Error in processing currency rates.'
);
END;

Comments
Post Details
Added on Oct 16 2024
2 comments
158 views