Sei sulla pagina 1di 2

Home > Blog >

Submitting Future Requests Via Package fnd_request.submit_request


posted Feb 26, 2014, 4:00 PM by Jay Tracewell [ u pdated Feb 26, 2014, 4:05 PM ]

There are many blogs on using fnd_request.submit_request to create a concurrent job, but there aren't very many on how the package handles or expects the "start_date" parameter to be handled and Oracle's documentation is unclear. If you create a procedure where you declare a date variable, populate it and call the package like is shown below: d e c l a r e d _ r e q u e s t _ s t a r t _ d a t eD A T E ; . . . d _ r e q u e s t _ s t a r t _ d a t e: =t o _ d a t e( ' 0 2 2 7 2 0 1 42 0 5 5 ' ,' M M D D Y Y Y YH H 2 4 M I ' ); . . . n _ r e q u e s t _ i d: =f n d _ r e q u e s t . s u b m i t _ r e q u e s t ( a p p l i c a t i o n= >' W S H ' , p r o g r a m= >' W S H P S R S ' , s t a r t _ t i m e= >d _ r e q u e s t _ s t a r t _ d a t e . . . You will successfully create a concurrent request in your system, but the start of that concurrent request will be 27Feb-2014 at 00:00:00 - the d_request_start_date has failed to properly capture the time you assigned to this (20:55). The DATE variable only captures the date (no timestamp); timestamp is only captured for DATE datatypes when stored in a table column. fnd_request.submit_request will, however, accept varchar text as input for start_date (the input parameter is declared as varchar) and will cast this as a date and time. Thus, if you send properly formatted text in this field, you'll receive a request with both the date and time that you require. A full example of a working procedure is below that starts a request on a specific day and time and repeats it every week at that time: s e ts e r v e r o u t p u to n d e c l a r e n _ r e q u e s t _ i dn u m b e r: =0; v _ r e q u e s t _ s t a r t _ d a t ev a r c h a r ( 3 0 ) ; v _ r e l e a s e _ r u l e _ n a m ev a r c h a r ( 3 0 0 ) ; v _ b a t c h _ p r e f i xv a r c h a r ( 3 0 ) : =N U L L; n _ d e b u g _ l e v e ln u m b e r: =0; n _ s h i p _ c o n f i r m _ r u l e _ i dn u m b e r: =N U L L; d _ a c t u a l _ d e p a r t u r e _ d a t ed a t e: =N U L L; n _ c h i l d _ r e q u e s t sn u m b e r: =N U L L; b _ s e t _ i n t e r v a lb o o l e a n: =f a l s e; b _ s e t _ n l sb o o l e a n: =f a l s e; b _ s e t _ m o d eb o o l e a n: =f a l s e; b e g i n / *S e tg l o b a lo p t i o n s* / a p p s . f n d _ g l o b a l . a p p s _ i n i t i a l i z e ( 2 3 1 5 ,2 1 6 2 3 ,6 6 0 ) ; -C Mu s e r ,O MS u p e r U s e rr e s p ,O N T a p p l i c a t i o n b _ S e t _ N L S : =a p p s . f n d _ s u b m i t . s e t _ n l s _ o p t i o n s ( ' A M E R I C A N ' ) ; b _ S e t _ M o d e : =a p p s . f n d _ s u b m i t . s e t _ m o d e( f a l s e ) ; -O n l ys e tt ot r u ei fc a l l e df r o m d a t a b a s et r i g g e r / *A M WS t dS c hI n tM o n|W E E K L YT H U R S D A Y8 5 5P M* / d b m s _ o u t p u t . p u t _ l i n e ( ' S t a r tS t dS c hI n t|W E E K L YT H U R S D A Y8 5 5P M ' ) ; s e l e c tp i c k i n g _ r u l e _ i di n t ov _ r e l e a s e _ r u l e _ n a m ef r o mW S H . W S H _ P I C K I N G _ R U L E Sw h e r en a m e= ' S t dS c hI n t l '; v _ r e q u e s t _ s t a r t _ d a t e: =t o _ c h a r ( t o _ d a t e ( ' 0 2 2 7 2 0 1 4 ' ,' M M D D Y Y Y Y ' ) )| |''| |' 2 0 : 5 5 : 0 0 '; b _ s e t _ i n t e r v a l: =f n d _ r e q u e s t . s e t _ r e p e a t _ o p t i o n s (

r e p e a t _ t i m e= >N U L L , r e p e a t _ i n t e r v a l= >7 , r e p e a t _ u n i t= >' D A Y S ' , r e p e a t _ t y p e= >' S T A R T ' , r e p e a t _ e n d _ t i m e= >N U L L ); n _ r e q u e s t _ i d: =f n d _ r e q u e s t . s u b m i t _ r e q u e s t ( a p p l i c a t i o n= >' W S H ' , p r o g r a m= >' W S H P S R S ' , s t a r t _ t i m e= >v _ r e q u e s t _ s t a r t _ d a t e , s u b _ r e q u e s t= >f a l s e , a r g u m e n t 1= >v _ r e l e a s e _ r u l e _ n a m e , a r g u m e n t 2= >v _ b a t c h _ p r e f i x

, a r g u m e n t 5= >d _ a c t u a l _ d e p a r t u r e _ d a t e , a r g u m e n t 6= >n _ c h i l d _ r e q u e s t s ); i fn _ r e q u e s t _ i d< >0t h e n d b m s _ o u t p u t . p u t _ l i n e ( ' S U C C E S SM WS t dS c hI n tM o n|W E E K L YT H U R S D A Y8 5 5P M ' ) ; e l s e d b m s _ o u t p u t . p u t _ l i n e ( ' F A I L M WS t dS c hI n tM o n|W E E K L YT H U R S D A Y8 5 5P M ' ) ; e n di f ; e n d ; /

, a r g u m e n t 3= >n _ d e b u g _ l e v e l , a r g u m e n t 4= >n _ s h i p _ c o n f i r m _ r u l e _ i d

Potrebbero piacerti anche