DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Strange Procedural record count over db_link

Threaded View

  1. #2
    Join Date
    Nov 2001
    Location
    Sheffield, England, UK
    Posts
    78
    Here's a quick example of what I'm looking at:

    SQL*Plus: Release 11.1.0.6.0 - Production on Fri Sep 3 10:17:14 2010

    Copyright (c) 1982, 2007, Oracle. All rights reserved.


    Connected to:
    Oracle Database 11g Release 11.1.0.6.0 - 64bit Production

    SQL> set serverout on
    SQL> declare
    v_sql varchar2(32767);
    type t_order_no is table of varchar2(10) index by simple_integer;
    v_order_no t_order_no;

    begin
    execute immediate
    'select order_no from cs3sys.opheadm@cliff where status in (''C'',''I'',''9'',''8'')'
    bulk collect into v_order_no;
    dbms_output.put_line(v_order_no.count);
    end;
    /

    589823

    PL/SQL procedure successfully completed.

    SQL> SELECT COUNT(*) FROM CS3SYS.OPHEADM@CLIFF WHERE STATUS IN ('C','I','9','8');

    COUNT(*)
    ----------
    617929

    SQL> declare
    v_sql varchar2(32767);
    type t_order_no is table of varchar2(10) index by simple_integer;
    v_order_no t_order_no;
    begin
    execute immediate
    'select order_no from cs3sys.opheadm@cliff where status in (''C'',''I'',''9'',''8'')'
    bulk collect into v_order_no;
    dbms_output.put_line(v_order_no.count);
    end;
    /

    65535

    PL/SQL procedure successfully completed.

    SQL>
    Last edited by AJW_ID01; 09-03-2010 at 04:22 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
  •  


Click Here to Expand Forum to Full Width