الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

مشكلة عدم فهم استدعاء Funcation From Packages

Featured Replies

بتاريخ:

الكود هو لباكدج موجوده على برنامج اوراكل بيزنس سيوت : محتاج افهم لما بينادي على فانكشن جوه الباكدج دي وترجع قيمة معينة ... القيمة دي جات منين بالرغم ان الفانكشن فاضية مفيهاش كود

 

call funcation : view_all or show_person

//////////////THE PACKAGE///////////
create or replace PACKAGE HR_SECURITY AUTHID CURRENT_USER AS
/* $Header: hrscsec.pkh 120.2.12010000.2 2009/10/30 08:01:24 rnemani ship $ */
   --
   -- WARNING - ALL FUNCTIONS IN THIS PACKAGE MUST ASSERT AT LEAST WNPS
   -- THIS IS DUE TO RDBMS LIMITATION 519783. The PRAGMA restrictions have
   -- been removed as this is no longer required for Oracle 8i +.
   --
   --
   -- Name
   --   get_hr_security_context
   -- Purpose
   --   Returns the security_profile_id for the current session.
   --   Previously this was stored in the client_info string but
   --   is now stored as a global variable in the hr_security_package.
   --
   --   WARNING:  HR DEVELOPMENT INTERNAL USE ONLY
   --
   -- Arguments
   --   *none*
   --
   FUNCTION get_hr_security_context RETURN NUMBER ;
   --
   -- Name
   --   get_security_profile
   -- Purpose
   --   Returns the security profile for the current user
   --   The value is determined from the current schema as follows :
   --
   --   APPS schema :
   --   An "APPS" schema is either universal,multi-currency or multi-lingual
   --   If set, use security_profile_id set in the package global.
   --   Otherwise use the value 0. This is the default view all security
   --   profile
   --
   --   Read-only schema :
   --   If the current schema is the reporting_oracle_username for an
   --   existing security profile then return its id. If there is no such
   --   profile then raise an error.
   --
   --   Custom schema :
   --   A custom schema is one which not an APPS schema and not
   --   oracle id. The function returns the seeded view all security profile
   --   ie 0.
   --
   -- Arguments
   --   *none*
   --
   FUNCTION get_security_profile RETURN NUMBER ;

   --
   -- Name
   --   globals_need_refreshing
   -- Purpose
   --   Returns TRUE or FALSE depending on whether the HR globals
   --   have become out-of-sync with the FND globals.  This typically
   --   occurs when a user changes responsibility.
   --
   FUNCTION globals_need_refreshing RETURN BOOLEAN;

   --
   -- Returns 'TRUE' if the record in the given table is accessible under
   -- the current security context.
   --
   function show_record
      (p_table_name     in varchar2
      ,p_unique_id      in number
      ,p_val1           in varchar2 default null
      ,p_val2           in varchar2 default null
      ,p_val3           in varchar2 default null
      ,p_val4           in varchar2 default null
      ,p_val5           in varchar2 default null
      )
   return varchar2 ;

   --
   -- (overloaded) show_person function to support npws.
   --
   FUNCTION show_person
      (p_person_id              IN NUMBER
      ,p_current_applicant_flag IN VARCHAR2
      ,p_current_employee_flag  IN VARCHAR2
      ,p_current_npw_flag       IN VARCHAR2
      ,p_employee_number        IN VARCHAR2
      ,p_applicant_number       IN VARCHAR2
      ,p_npw_number             IN VARCHAR2)
    Return VARCHAR2;
   --
   -- Under review
   --
   function view_all return varchar2 ;
   --
   -- Name
   --   Show_BIS_Record
   -- Purpose
   --   Returns 'TRUE' if the record in the given table is accessible
   --   under the current security context.
   -- Arguments
   --   p_org_id        organization to which the record belongs
   --
   FUNCTION Show_BIS_Record
      (p_org_id    IN  NUMBER
      )
   RETURN VARCHAR2;
   --
   --
   -- Name
   --   get_sec_profile_bg_id
   -- Purpose
   --   Returns the business_group_id value forthe current sessions security
   --   profile held in g_context.
   -- Arguments
   --   none
   --
   FUNCTION get_sec_profile_bg_id RETURN NUMBER;
   --
   --
   -- Name
   --   get_person_id
   -- Purpose
   --   Returns the named_person_id value for the current sessions security
   --   profile.
   -- Arguments
   --   none
   --
   FUNCTION get_person_id RETURN NUMBER;
   --
   PROCEDURE add_assignment(p_person_id number, p_assignment_id number);
   --
   PROCEDURE add_person(p_person_id number);
   --
   PROCEDURE remove_person(p_person_id number);
   --
   PROCEDURE add_organization(p_organization_id number,
                              p_security_profile_id  number);
   --
   PROCEDURE add_position(p_position_id number,
                          p_security_profile_id  number);
   --
   PROCEDURE add_payroll(p_payroll_id number);
   --
   FUNCTION restrict_on_individual_asg RETURN BOOLEAN;
   --
   FUNCTION restrict_by_supervisor_flag RETURN VARCHAR2;
   --
   PROCEDURE delete_list_for_bg(p_business_group_id NUMBER);
   --
   PROCEDURE delete_per_from_list(p_person_id  number);
   --
   PROCEDURE delete_org_from_list(p_organization_id   number);
   --
   PROCEDURE delete_pos_from_list(p_position_id     number);
   --
   PROCEDURE delete_payroll_from_list(p_payroll_id     number);
   --
   FUNCTION is_user_rtm return boolean;
   --
END HR_SECURITY;

تم تعديل بواسطة Ahmad.Hasan

بتاريخ:

السلام عليكم

 

الـ Functions ما بترجع قيم غير TRUE or FALSE.

 

   function show_person(
            p_person_id              in number
           ,p_current_applicant_flag in varchar2
           ,p_current_employee_flag  in varchar2
           ,p_current_npw_flag       in varchar2
           ,p_employee_number        in varchar2
           ,p_applicant_number       in varchar2
           ,p_npw_number             in varchar2
           ) return varchar2 is
     --
   begin
     -- if the profile excludes users, prevent the logged on user from seeing
     -- themselves under any circumstances.
     if (p_person_id = g_person_id and exclude_person) then
       --
       return 'FALSE';
       --
     end if;
     -- Return TRUE if the security profile has no person restrictions.
     if (view_all = 'Y' or
        (view_all_employees and view_all_applicants and view_all_cwk and
         view_all_contacts and view_all_candidates)) then
       --
       return 'TRUE';
       --
     end if;
     -- Return TRUE if the security profile has no work structure
     -- restrictions and the person restriction is "Restricted" for this
     -- type of person.
     if (no_restrictions and
        ((p_current_employee_flag = 'Y' and restricted_employees) or
         (p_current_applicant_flag = 'Y' and restricted_applicants) or
         (p_current_npw_flag = 'Y' and restricted_cwk) or
         (p_employee_number is null and p_applicant_number is null and
          p_npw_number is null and restricted_contacts and
          view_all_candidates))) then
       --
       return 'TRUE';
       --
     end if;
     -- Return TRUE if the security profile is view all contacts or you
     -- can see all the other types of people (and so contacts too)
     -- and where this person is a contact.


     -- A condition with view_all_contacts_flag = All and
     -- view_all_candidates_flag = None, will not be taken care in below
     -- IF condition. ie: in such a scenario, its been decided that contacts
     -- will be populated in per_person_list through PERSLM. Thereby this
     -- function (SHOW_PERSON) will return a TRUE through CHECK_PERSON_LIST.


     -- Contacts     Candidates     Contacts cached
     -- ------------------------------------------
     -- All          All            No
     -- All          None           Yes
     -- Restricted   All            Yes
     -- Restricted   None           Yes
     if view_all_contacts and view_all_candidates and
        p_employee_number is null and p_applicant_number is null and
        p_npw_number is null then
       --
       return 'TRUE';
       --
     end if;
     -- Return TRUE if the profile has restrictions but they
     -- are not relevant to this person.


     -- Applicants are treated different: they must be only
     -- an applicant and not an employee / contingent worker
     -- to immediately return TRUE.  This prevents emps or
     -- cwks being visible in an applicant-only security
     -- profile.  Applicants who are also emps and cwks will
     -- have their security determined by listgen so the person
     -- list must be checked in this example.
     if (p_current_employee_flag = 'Y' and view_all_employees) or
        (p_current_npw_flag = 'Y' and view_all_cwk) or
        (p_current_applicant_flag ='Y' and nvl(p_current_npw_flag, 'N') = 'N'
        and nvl(p_current_employee_flag, 'N') = 'N'
        and view_all_applicants) then
       --
       return 'TRUE';
       --
     end if;
     --
     if view_all_applicants and p_applicant_number is not null and
        p_employee_number is null and p_npw_number is null then
        -- Profile is view all applicants, person is or has been an applicant
        -- and they person have not been an employee/cont worker so grant
        -- access.  If the person is/was an Emp/CWK then grant access based
        -- on Emp/CWK criteria i.e. if the person is also an Emp and is
        -- visible then grant access.  This does mean that an Ex-Emp and Apl
        -- will disappear from a view_all_applicants/restricted employees
        -- profile on termination of the application if the terminated Emp
        -- assignment does not allow access to this person for this profile.
        -- i.e. the profile allows access to Emps in "Org 1" but when the
        -- person was an employee they were in "Org 2".


        -- This is slightly inconsistent with behaviour of PERSLM when
        -- granting access to Ex-Emp and Ex-Apl people for profiles which
        -- are restricted_employees and restricted_applicants but is better
        -- than the current situation.


        -- We could/do have similar problems with view_all_emp and
        -- view_all_npw profiles but it's less likely that customers have
        -- view_all_emp/npw profiles.  For now we'll ignore these cases.
       return 'TRUE';
       --
     end if;


     -- code start for bug 7480132
    if ( no_restrictions and view_all_employees) then
     if (( (not view_all_cwk) and nvl(p_current_npw_flag, 'N') = 'Y' )
         or
         ( (not view_all_applicants) and nvl(p_current_applicant_flag, 'N') = 'Y' ))
     then
          NULL;
     else
     if(HR_GENERAL2.is_person_type(p_person_id,'EX_EMP',g_effective_date)) then
       return 'TRUE';
     end if;
     end if;
    end if;
    -- code end for bug 7480132


     -- If security evaluation was deferred at logon, or if the person/
     -- assignment permissions are unknown for some other reason, use
     -- caching on demand to evaluate permissions on the fly.
     if not hr_security_internal.per_access_known then
       -- Passing a value to p_what_to_evaluate avoids evaluating
       -- permissions for irrelevant security criteria.
       hr_security_internal.evaluate_access(
          p_person_id        => g_person_id
         ,p_user_id          => g_user_id
         ,p_effective_date   => g_effective_date
         ,p_sec_prof_rec     => g_context
         ,p_what_to_evaluate => hr_security_internal.g_per_sec_only);
       -- The two sets of person cache are synched.
       --sync_person_cache;  --Fixed for bug 5985232
       --
     end if;
     -- We must check the person list to determine this person's security.
     if check_person_list(p_person_id) then
       --
       return 'TRUE';
       --
     end if;
     -- This person cannot be visible.
     return 'FALSE';
     --
   end show_person;
   --
   -----------------------------------------------------------------------
   --< show_person >--- original called from show_record -----------------
   -----------------------------------------------------------------------
   --
   FUNCTION view_all return varchar2
   IS
   BEGIN


        --
        -- 2876315
        --
        if ( hr_signon.session_context <> fnd_global.session_context )
        then
          hr_signon.initialize_hr_security;
          initialise_globals;
        end if;




        RETURN (NVL(hr_signon.g_hr_security_profile.view_all_flag
                   ,g_context.view_all_flag));




   END view_all;
بتاريخ:
  • كاتب الموضوع

وعليكم السلام

 

انا شاكر ليك جدا على الرد ... بس ماهو دة الي مش واضح بالنسبة ليا

 

انت جبت كود الفانكشن دي منين .. انا بحثت جوه الفاتكشنز او الباكدجز عشان افهم هما عبارة عن اية وملقتش ؟

بتاريخ:
  • كاتب الموضوع

هل هما عبارة عن built in functions in oracle

بتاريخ:
  • كاتب الموضوع

السلام عليكم

 

يجماعة حد يرد عليا

 

معظم الباكدج الي موجودة في اوراكل بيزنس سيوت بنفس الطريقة .. عايز اعرف كود الفانكشنز دي ألاقيها فين.... انا بحثت جوه الفاتكشنز او الباكدجز عشان افهم هما عبارة عن اية وملقتش ؟

بتاريخ:
  • كاتب الموضوع

جزاك الله خيرا ... انا مكنتش واخد بالي من package body in oracle sql developer tool

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.