Results 1 to 3 of 3

Thread: Function purity in PL/SQL

  1. #1
    Junior Member
    Join Date
    Apr 2006
    Answers
    12

    Thumbs up Function purity in PL/SQL

    what is the need for using function purity in PL/SQL .


  2. #2
    Junior Member
    Join Date
    Apr 2006
    Answers
    12

    Re: Function purity in PL/SQL

    I found the ans as: any function called from the sql statement have certain side effects on the database tables and package variables.these side effects are specified using purity levels.and diff purity levels r wnds-->write no database state rnds-->read no database state wnps-->write no package state rnps-->read no package state


  3. #3
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074
    use the pragma RESTRICT_REFERENCES for the purpose.

    RESTRICT_REFERENCES Pragma
    ===========================
    This pragma was used to assert to the PL/SQL compiler the purity level of a packaged procedure or function. The RESTRICT_REFERENCES pragma had to be included in the package specification if you were to use that program inside a SQL statement (directly or indirectly).

    This is not required starting with Oracle8i.

    This pragma confirms to Oracle database that the function as the specified side-effects or ensures that it lacks any such side-effects.

    Usage is as follows: pragma restrict_references(function_name, wnds [, wnps] [, rnds], [, rnps])
    wnds: writes no database state. States that the function will not perform any dmls.
    Wnps: writes no package state. States that the function will not modify any package variables.
    Rnds: reads no database state. Analogous to write.
    This pragma affirms that the function will not read any database tables.
    Rnps: reads no package state. Analogous to write.
    This pragma affirms that the function will not read any package variables.

    Last edited by jamesravid; 07-24-2007 at 07:01 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact