Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7921185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:29:30+00:00 2026-06-03T16:29:30+00:00

I have Learnt about PRAGMA INLINE 11g feature , but I am not able

  • 0

I have Learnt about PRAGMA INLINE 11g feature , but I am not able to distinguish how it actually optimize my code.

I have written a piece of code.

create or replace package test12
is 

procedure getdata (p_job    IN emp.job%TYPE
                  ,p_total OUT number);

end test12;
/

create or replace package body  test12
is 

PROCEDURE total(p_empno IN EMP.EMPNO%TYPE
               ,p_total OUT integer)

IS

BEGIN

 select sal into p_total from emp where empno=p_empno;

END total;

procedure getdata (p_job    IN emp.job%TYPE
                  ,p_total OUT number)
IS 

type cur is ref cursor;
v_cur cur;
v_emp emp.empno%TYPE;
v_total integer:=0;
BEGIN

for i in 1..100000 
loop
 open v_cur for select empno from emp where job=p_job;
  loop
  fetch v_cur into v_emp;
  exit when v_cur%notfound;
  --PRAGMA INLINE(total,'YES');
  total(v_emp,v_total);
  p_total:=p_total+v_total;
  end loop;
 close v_cur;
 end loop;
END getdata;                 

end test12;
/


declare
v_total integer;
v_start integer;
v_end integer;
begin
v_start:=DBMS_UTILITY.GET_TIME;
test12.getdata('CLERK',v_total);
v_end :=DBMS_UTILITY.GET_TIME;
v_total:=v_end-v_start;
dbms_output.put_line('time is '||v_total);
end;
/

Now if I run without pragma inline it gives me the following time

First Run : time is 3573
Second Run: time is 3571
Third Run : time is 3554

Now if I run with pragma inline it gives me the following time

First Run : time is 3471
Second Run: time is 3489
Third Run : time is 3482

But here I didn’t see any significant difference between the two. What might be the reason for that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:29:33+00:00Added an answer on June 3, 2026 at 4:29 pm

    The amount of time spent just to call the procedure is almost 0. There’s very little to optimize here. I’m surprised you saw any improvement at all. 99.9% of the execution time is probably spent in SQL, not PL/SQL.

    --Procedure that does almost nothing
    create or replace procedure total(p_empno IN number, p_total OUT integer) is
    begin
        p_total := p_empno + 1;
    end;
    /
    
    --Disable optimiziations
    alter session set PLSQL_OPTIMIZE_LEVEL = 0;
    
    --Only time the procedure calls
    declare
        v_test_out number;
        v_start number;
        v_end number;
    begin
        v_start:=DBMS_UTILITY.GET_TIME;
    
        for i in 1 .. 100000 loop
            total(i, v_test_out);
        end loop;
    
        v_end :=DBMS_UTILITY.GET_TIME;
        dbms_output.put_line('time is '||to_char(v_end-v_start));
    end;
    /
    
    time is 5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

1st of all: I'm not a programmer, never learnt programming/algorithms. Actually I have to
I have learnt Python for about a month as a one year's PHPer.And I
Below I have written a sample program that I have written to learn about
I am programming in Ruby and have wanted to learn about matrices but I
I have just learnt about Django apps. I want to know that within one
I have learnt that word-length is an ISA feature, which has to be implemented
I just learnt the basics of MySQL and I'm wondering about this: I have
im just starting to learn about sockets and i have been given this code,
I have recently learnt about namespaces in PHP, and was wondering, would it be
Firstly: sorry about my pathetic english language skill. Secondly: i have learnt python for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.