Results 1 to 4 of 4

Thread: Wont compile

  1. #1
    Join Date
    Jul 2008
    Location
    Ireland
    Posts
    11

    Unanswered: Wont compile

    procedure get_stats ( p_cpu_used out nocopy number ,
    p_physical_reads out nocopy number ,
    p_redo_size out nocopy number ) is
    Begin
    for i in ( select m.sid,m.STATISTIC#, n.name, m.value
    from v$mystat m, v$statname n
    where m.statistic#=n.statistic#
    and name in('CPU used by this session','physical reads','redo size')
    order by m.statistic# )
    Loop

    if i.name = 'CPU used by this session' then
    p_cpu_used := i.value;
    End if;

    if i.name = 'physical reads' then
    p_physical_reads := i.value;
    End if;

    if i.name = 'redo size' then
    p_redo_size := i.value;
    End if;

    End loop;

    End get_stats;


    Hi,
    Everytime I try to compile a package I get an error pointing to the above procedure. The error states
    'P_CPU_USED' is not a valid integer value.
    However I have looked at this a few times and for the life of me, cant figure out whats wrong with it.
    Can anyone shed any light on it for me?

    Thanks.
    Last edited by GerardMcL_1; 07-10-08 at 06:58.

  2. #2
    Join Date
    Dec 2007
    Posts
    253
    Well, the procedure compiles and executes as a standalone. 'Fraid I can't say any more than that.
    Does the package compile without this procedure?

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    The same goes here; as a standalone procedure, it works fine on
    Code:
    SQL> select banner from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    
    SQL>
    Which version do you use? Could that make the difference?

  4. #4
    Join Date
    Jul 2008
    Location
    Ireland
    Posts
    11

    Belated Thanks

    Guys thanks for the help and advice offered.
    Unfortunately, as is always the case, work are ensuring I dont have the time to work on this particular piece of code at the moment but I will get back to you when I have a chance.

    Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •