#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    178
    Rep Power
    28

    Inline pragma before cursor


    Hi,

    I have a stored proc that calls a user-defined function "fun" like this (greatly simplified):

    Code:
    procedure foo(p_cursor out ref cursor)
    begin
      open p_cursor for
      select a.*
      from a
      where fun(a.b) = 1
    end foo;
    I want to call fun with "pragma inline(fun, 'YES')".
    According to the Oracle documentation, the inline pragma will affect only the following statements if placed right before them:

    Code:
    Assignment 	CASE 	EXIT-WHEN
    Call 	CONTINUE-WHEN 	LOOP
    Conditional 	EXECUTE IMMEDIATE 	RETURN
    So, in my case, where should I put the pragma? I do have a call, but it's wrapped in the SQL within a cursor definition.
    What is the right way (if this is feasible at all)?

    Thanks.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Location
    spaceBAR Central
    Posts
    229
    Rep Power
    42
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    178
    Rep Power
    28
    Originally Posted by spacebar208

    Thank you for the answer and the links. What I was trying to figure out is whether the inline pragma should be placed within the procedure just before the SQL with the function call, or before calling the procedure itself. I'll keep digging.

IMN logo majestic logo threadwatch logo seochat tools logo