Wednesday, 24 June 2020

sample function

CREATE OR REPLACE FUNCTION APPS.GRCPCG_TWOGLPER
--   v_period_name IN VARCHAR2)
   RETURN NUMBER
IS
   v_period_cnt   NUMBER;
BEGIN
   SELECT COUNT (*)
     INTO v_period_cnt
     FROM (SELECT RPAD (
                     fat.application_name,
                       (20 - LENGTH (fat.application_name))
                     + LENGTH (fat.application_name),
                     ' ')
                     application_name,
                  gps.show_status,
                  gps.period_name
             FROM gl_period_statuses_v gps,
                  fnd_application_tl fat,
                  gl_sets_of_books gsb
            WHERE     1 = 1
                  --AND gps.period_name = v_period_name
                  AND fat.application_id = gps.application_id
                  AND gps.set_of_books_id = gsb.set_of_books_id
                  AND gps.application_id IN (0000)
                  AND gps.set_of_books_id = 0000) test
    WHERE bmstest.show_status = 'Open';

   IF v_period_cnt > 2
   THEN
      RETURN (v_period_cnt);
   ELSE
      RETURN (0);
   END IF;
END;

------------------------------------------------

GRANT ALL ON apps.GRCPCG_TWOGLPER TO XXLAAPPS

-------------------------------------------------

24 comments:

  1. Hi,

    Please revert on my mail.
    Sudhir D

    ReplyDelete
  2. Himachal Pradesh Board of School Education releases the class 10th model question papers 2021 in the online mode. HP board 10th model papers 2021 plays a very important role in the analysis of a candidate's preparation level. HP Board 10th Model Paper 2021 Presently the board examines 10th class examinations. Annually, 5 lakhs of candidates appear in the examination conducted by the HP board.

    ReplyDelete
  3. Thank you for sharing information with us ! These quadcopters drones may seem like toys, however they're a significant investment, GPS Drone and one in all the best ways that to point out off a brand new location for a travel video or filmmaker's production Quadcopter Drone.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. CopyCat is a great Figma Plugin Development tool to quickly get started with development. It's simple to use and install, and it comes with a wide range of features that make developing for Figma much easier.

    ReplyDelete
  6. This function is really helpful! Can you explain the purpose of RPAD here?
    Pharmacy franchise
    Dust collector in Delhi

    ReplyDelete
  7. Why is v_period_name commented out? Is it optional for this function?
    Cyclone Dust Collector Delhi
    Axial Flow Fans in delhi

    ReplyDelete
  8. Great post! Can this function be used for multi-currency periods in Oracle Financials?
    Industrial Exhaust Fan Manufacturer
    Steel Mezzanine Floor in Delhi

    ReplyDelete
  9. It seems like the RETURN NUMBER is for the count of open periods. Is that correct?
    Warehouse Racking System in delhi
    Modular Mezzanine Floor Jaipur

    ReplyDelete
  10. Thanks for the detailed explanation! I’m trying to understand why the COUNT is necessary.
    long span rack in ahmedabad
    drum storage rack

    ReplyDelete
  11. Can you go over the AND gps.application_id IN (0000) part? Is this specific to your application?
    mezzanine floor gurgaon
    cable tray manufacturer

    ReplyDelete
  12. I noticed RPAD is used to pad application_name — very clever for consistent formatting!
    display rack manufacturer
    industrial mezzanine floor

    ReplyDelete
  13. What exactly does fnd_application_tl contain? Is it Oracle-specific?
    Amazing post! Can this be modified to check statuses other than 'Open'?
    industrial storage rack in ghaziabad
    metal storage system in delhi




    ReplyDelete
  14. Is v_period_cnt checked for any reason other than open periods? Would love more details!
    Franchise Event Delhi
    Distributors

    ReplyDelete
  15. How efficient is this function? Any tips for optimizing Oracle PL/SQL functions?
    Sparsh Bagga
    Automatic web Sealer

    ReplyDelete
  16. Thanks! Can we use this with dynamic parameters for set_of_books_id?
    Pickle Distributorship
    Centrifugal Blowers manufacturers

    ReplyDelete
  17. Thanks! This will help a lot in managing GL periods. Will try it out soon.
    Manual Dust Collector Delhi
    Induced Draft Fan in Delhi

    ReplyDelete
  18. Does GRANT ALL give full access to XXLAAPPS? What does this mean in terms of security?
    Shrink packing delhi
    Sparsh Bagga

    ReplyDelete
  19. I noticed there’s a hardcoded value of 0000 for application_id. Is there a specific reason for that?
    Industrial Storage rack India
    multi tier rack in India

    ReplyDelete