How many records are  fetched my query into my internal tables

Hi
I am in the debugger, would like to know, how many records are  fetched my query into my internal tables. How do I  find out ?
thanks
siva

Hi,
Do the following,
Step 1:
  Fill your internal table with select query.
Step 2 : Use DESCRIBE statement with LINE addition to get the no of rows in the internal table.
for further informations, check
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3798358411d1829f0000e829fbfe/content.htm
Regards,
Anirban

Similar Messages

  • ADF: Best way to find out how many rows are fetched?

    Hello,
    I have overridden method executeQueryForCollection of ViewObject in which I execute supper.executeQueryForCollection and after that want to find out how many rows are fetched during the execution.
    If I try to use getFetchedRowCount I always get "0", if using getEstimatedRowCount, query are being re-executed.
    What method is better to use for that?
    Thank you,
    Veniamin Goldin
    Forbis, Ltd.

    I have a 'home-made' view called RBS, whose definition is this:
    create view RBS as
    select /*+ RULE  */ substr(s.username,1,10) oracle,
           substr(case when s.osuser like 'oramt%'
                       then nvl(upper(s.client_info),'client_info not set')
                       else substr(s.machine,instr(s.machine, '\')+1,length(s.machine))||':'||s.osuser
                  end
                  ,1,20) CLIENT
    ,      substr(''''||s.sid||','||s.serial#||''''||decode(s.status,'KILLED','*',''),1,12) kill_id
    ,      lpad(to_char(t.xidusn),4) rbs#
    ,      lpad(to_char(t.used_ublk),4) ublk
    ,      lpad(to_char(t.used_urec),8) urecords
    ,      i.block_gets
    ,      lpad(to_number(round((sysdate - to_date(t.start_time,'MM/DD/YY HH24:MI:SS')) * 60 * 60 * 24)),9) time
    ,      upper(substr(s.program,1,20)) PROGRAM
    ,      to_char(s.LOGON_TIME,'HH24:MI:SS DD-MON') LOGIN_TIME
    from   sys.v_$transaction t
    ,      sys.v_$session s
    ,      sys.v_$sess_io i
    ,      sys.v_$process p
    where  s.saddr = t.ses_addr
    and    i.sid = s.sid
    and    p.addr = s.paddr
    /By monitoring the URECORDS column value of the row that corresponds to my session doing a transaction, I can see how it progresses.
    Toon

  • Extracting the result of a query into a internal table

    Hi,
    Does anyone knows or have an idea how to extract the result of a query into a internal table, is there a function module or BAPI?
    Thanks in advance,
    CK

    So then normally I would use a statment like:
    IFunctionTemplate ftemplate = repository.getFunctionTemplate("<b>BAPI_SALESORDER_GETLIST</b>");
    to call a particluar function, but I tried using
    IFunctionTemplate ftemplate = repository.getFunctionTemplate("<b>BAPI_MDDATAPROVIDERBW_GETCATALOGS</b>");
    and it did not seem to work. I also tried -
    IFunctionTemplate ftemplate = repository.getFunctionTemplate("<b>MDDataProviderBW.GetCatalogs</b>");
    How do I format the function?
    Thanks
    Paul

  • How to extract data from info cube into an internal table using ABAP code

    HI
    Can Anyone plz suggest me
    How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules.
    Thankx in advance
    regds
    AJAY

    HI Dinesh,
    Thankq for ur reply
    but i ahve already tried to use the function module.
    When I try to Use the function module RSDRI_INFOPOV_READ
    I get an information message "ERROR GENERATION TEST FRAME".
    can U plz tell me what could be the problem
    Bye
    AJAY

  • Find out how many records are updated.

    Hello,
    I am executing a Update Statement in a loop from a JSP page this is working good.
    Suppose if there are 10 records and I update 4 records, it gets updated fine.
    What I now need is to find out how many records have been updated. How can I know this?
    Thanks

    statement.executeUpdate() returns the number of records updated.
    Sai Pullabhotla

  • How do we track how many records INSERT/UPDATE/DELETE per day

    Hi All,
    We have around 150 tables in database. so many members/persons can access these table and every one can have rights to do INSERT,DELETE,UPDATE the records. I wanted to know How many records are UPDATED,INSERTED,DELETED for a day. is it possible to find out.
    I have some questions please clarify the doubts.
    1> If we create any table, this table gets store in All_OBJECTS/USER_OBJECTS, tabs/tab/user_tables...... we can find out table name,columns what tables were created in database.
    2> if we enter records/ delete records / update records in a table. we can able to find corresponding table. Apart from corresponding table . is there any way to find out records.
    above i said that if i create any table it will store in objects table.

    Schedule a periodic DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO and query USER_TAB_MODIFICATIONS. This view shows DML activity against each table and is updated when database monitoring info is flushed. The flush is automatic but if you need control over the frequency of updates, you can explicitly call the FLUSH.
    In 9i you have to "ALTER TABLE table_name MONITORING ;" before you can use this method.
    In 10g, this is enabled by default unless STATISTICS_LEVEL is set to BASIC.
    See http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_4465.htm#sthref2375
    and
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tables.htm#ADMIN01508
    Another useful view is V$SEGMENT_STATISTICS (or the faster view V$SEGSTAT) which provides information in the same manner as in the V$SYSTAT / V$SESSTAT views.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • How to know how many records is returned by the query in report

    Hi
    i want to know how many records has been returned by a sql statement in a report.
    can any one help me to solve this problem.
    santosh.

    you need to create a summary column with count function for a column in your select query. then u can print that formula column to know the no of rows selected in a query for a report

  • Re : How many Records that are transfer once I.P is shedule

    Hi
    Once one Info package is schedule what is the database that store how much records are transfer to data targets (Info package ,O.D.S)
    Can any one provide the information on SAP BW Database tables

    Solved

  • GUI Uplaod: How many records can I read into my ITAB?

    HI all,
    Does anybody know the limit for a GUI_UPLOAD from PC into an internal table?
    Probably depends on the length of the record.
    Well, I have to know if I can read 4 million Customer numbers into an ITAB from a flat file on PC.
    Thanks for your answer in advance.
    Thomas

    Hi,
    This is a tricky question. The uploading of  total number of records changes from foreground and background.
    In foreground, you can upload records till the memory is exhausted / time out.
    If it is in background you can do n number of records. But the memory is also a factor which depends on system to system.
    In my case i had easy uploaded an excel sheet of 10000 to 15000 records( around 10 to 12 fields in each row.)
    I hope this answers your question.
    Regards
    Maneesh Chandran

  • How can I set limitations on how many records a report can return

    I have a report on the web using Oracle Reports builder and I have the client enter in date parameters for the report that they want.
    Well with date ranges for different clients a different number of records are returned. Because of time it can take the report to return I want to limit the number of records that report can return.
    How can I go about doing that? I don't want to limit with date parameters because date won't really work for me. I need to limit on how many records can be returned. If it exceeds 10,000 records I want the client to refine the date range of schedule the report to run later. Meaning we will run that report. So I would have two check boxes if the count was over 10,000 do you want to define your date or schedule the job to run later.
    Can any one help me with this? How would I go about this?

    To know if the report is going to return more than 10,000 records, you first have to run the query with a 'select count(1) from ... where ...' (with the same from and where clauses as you normal query). Since this takes about the same time as runnng your report, I wonder if you really gain anything (although formatting may take some time too).
    You may simplify the select count(1) query by omitting all the lookup tables that are only needed for formatting. That way your query may run a lot faster. You can put this in your after parameter form trigger.

  • Is there any limit on how many records a cursor can hold?

    Hi Everyone,
    This is Amit here. I want to know whether there is any limit on how many records a cursor can hold.
    I have a program in which i am creating a cursor and passing it to another procedure as an input parameter. But the count of cursor query is more than 15 Lakhs. The program is running forever.
    Just wanted to know whether the huge data is the problem.
    Thanks ....
    Regards,
    Amit

    user13079404 wrote:
    Just wanted to know whether the huge data is the problem.What do you think? How long does your code typically need to wait for the data to leave the magnetic platter of the harddisk, travel across wires and into the memory buffer of your application - for a single row?
    Now multiply that waiting for I/O time with a million - for a million rows. Or by a billion, for a billion rows.
    Is "+huge data+" a problem? Not really - it simple needs more work to get that amount of data from disk. More work means slower performance. It is that simple.
    Which is why the row-by-row approach used by many developers is wrong. You do not pull a million rows from disk and process it in PL/SQL or Java or .Net. Heck, you do not even pull 10,000 rows like that.
    The correct approach is to think data sets and use SQL to process that for you - and only return the bare minimum of data to the application layer. Maximize SQL. Minimize PL/SQL and Java and .Net.

  • How many records does JDBC adapter can obtain in one polling?

    Hello everybody,
    I need to do an interface between legacy system and SAP ECC, the legacy systems have a DB so i use the jdbc adapter (sender) and receive the information to SAP ECC with proxy, so i need to activate the polling option from my jdbc adapter working as a sender, i read a table with lot of records, and i need to know how many records does jdbc adapter support when the polling is executed, because is necessary read all records from the table and change the status of the processed field.
    Is possible to get all the records from that table in one polling interval (50,000 records aprox)?, or i need to do the polling by blocks of records until finish all records from the table?, the second option, i dont have idea how can i do it.
    Regards,
    Vicman

    Hi again!,
    i still working on that, but i have a question, is possible to handle Store Procedure in jdbc adapter?? is supported?, like PL SQL, because i was working in the next query but i don't know if it works and where do i need to locate the query in the Query SQL Statement or in Update SQL Statement field or both? but how?.
    DECLARE c_cursor CURSOR FOR
    SELECT * FROM tablename
    WHERE processed=0
    OPEN c_cursor
       FETCH NEXT FROM c_cursor
    WHILE @@FETCH_STATUS = 0
    BEGIN
       update tablename set processed=1
       FETCH NEXT FROM c_cursor
    END
    CLOSE c_cursor
    DEALLOCATE c_cursor
    Regards,

  • Report execute time nd how many records will be returned before hitting the "run" option?

    Post Author: Prasad15
    CA Forum: WebIntelligence Reporting
    Is there any way to know how long the report executes and how many records will be returned before hitting the "run" option?
    Regards
    Prasad

    To know if the report is going to return more than 10,000 records, you first have to run the query with a 'select count(1) from ... where ...' (with the same from and where clauses as you normal query). Since this takes about the same time as runnng your report, I wonder if you really gain anything (although formatting may take some time too).
    You may simplify the select count(1) query by omitting all the lookup tables that are only needed for formatting. That way your query may run a lot faster. You can put this in your after parameter form trigger.

  • Having issues finding out how many bytes are sent/recieved from a socket.

    Hello everyone.
    I've searched the forums and also google and it seems I can't find a way to figure out how many bytes are sent from a socket and then how many bytes are read in from a socket.
    My server program accepts a string (an event) and I parse that string up, gathering the relevant information and I need to send it to another server for more processing.
    Inside my server program after receiving the data ( a string) I then open another port and send it off to the other server. But I would like to know how many bytes I send from my server to the other server via the client socket.
    So at the end of the connection I can compare the lengths to make sure, I sent as many bytes as the server on the other end received.
    Here's my run() function in my server program (my server is multi threaded, so on each new client connection it spawns a new thread and does the following):
    NOTE: this line is where it sends the string to the other server:
    //sending the string version of the message object to the
                        //output server
                        out.println(msg.toString());
    //SERVER
    public class MultiThreadServer implements Runnable {
         Socket csocket;
         MultiThreadServer(Socket csocket) {
              this.csocket = csocket;
         public void run() {
              //setting up sockets
              Socket outputServ = null;
              //create a message database to store events
              MessageDB testDB = new MessageDB();
              try {
                   //setting up channel to recieve events from the omnibus server
                   BufferedReader in = new BufferedReader(new InputStreamReader(
                             csocket.getInputStream()));
                   //This socket will be used to send events to the z/OS reciever
                   //we will need a new socket each time because this is a multi-threaded
                   //server thus, the  z/OS reciever (outputServ) will need to be
                   //multi threaded to handle all the output.
                   outputServ = new Socket("localhost", 1234);
                   //Setting up channel to send data to outputserv
                   PrintWriter out = new PrintWriter(new OutputStreamWriter(outputServ
                             .getOutputStream()));
                   String input;
                   //accepting events from omnibus server and storing them
                   //in a string for later processing.
                   while ((input = in.readLine()) != null) {
                        //accepting and printing out events from omnibus server
                        //also printing out connected client information
                        System.out.println("Event from: "
                                  + csocket.getInetAddress().getHostName() + "-> "
                                  + input + "\n");
                        System.out.println("Waiting for data...");
                        //---------putting string into a message object-------------///
                        // creating a scanner to parse
                        Scanner scanner = new Scanner(input);
                        Scanner scannerPop = new Scanner(input);
                        //Creating a new message to hold information
                        Message msg = new Message();                    
                        //place Scanner object here:
                        MessageParser.printTokens(scanner);
                        MessageParser.populateMessage(scannerPop, msg, input);
                        //calculating the length of the message once its populated with data
                        int length = msg.toString().length();
                        msg.SizeOfPacket = length;
                        //Printing test message
                        System.out.println("-------PRINTING MESSAGE BEFORE INSERT IN DB------\n");
                        System.out.println(msg.toString());
                        System.out.println("----------END PRINT----------\n");
                        //adding message to database
                        testDB.add(msg);
                        System.out.println("-------Accessing data from Map----\n");
                        testDB.print();
                        //---------------End of putting string into a message object----//
                        //sending the string version of the message object to the
                        //output server
                        out.println(msg.toString());
                        System.out.println("Waiting for data...");
                        out.flush();
                   //cleaning up
                   System.out.println("Connection closed by client.");
                   in.close();
                   out.close();
                   outputServ.close();
                   csocket.close();
              catch (SocketException e) {
                   System.err.println("Socket error: " + e);
              catch (UnknownHostException e) {
                   System.out.println("Unknown host: " + e);
              } catch (IOException e) {
                   System.out.println("IOException: " + e);
    }Heres the other server that is accepting the string:
    public class MultiThreadServer implements Runnable {
         Socket csocket;
         MultiThreadServer(Socket csocket) {
              this.csocket = csocket;
         public void run() {
              try {
                   //setting up channel to recieve events from the parser server
                   BufferedReader in = new BufferedReader(new InputStreamReader(
                             csocket.getInputStream()));
                   String input;
                   while ((input = in.readLine()) != null) {
                        //accepting and printing out events from omnibus server
                        //also printing out connected client information
                        System.out.println("Event from: "
                                  + csocket.getInetAddress().getHostName() + "-> "
                                  + input + "\n");
    System.out.println("Lenght of the string was: " + input.length());
                        System.out.println("Waiting for data...");
                   //cleaning up
                   System.out.println("Connection closed by client.");
                   in.close();
                   csocket.close();
              } catch (IOException e) {
                   System.out.println(e);
                   e.printStackTrace();
    }Here's an example of the program works right now:
    Someone sends me a string such as this:
    Enter port to run server on:
    5656
    Listening on : ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=5656]
    Waiting for client connection...
    Socket[addr=/127.0.0.1,port=4919,localport=5656] connected.
    hostname: localhost
    Ip address: 127.0.0.1:5656
    Waiting for data...
    Event from: localhost-> UPDATE: "@busch2.raleigh.ibm.com->NmosPingFail1",424,"9.27.132.139","","Omnibus","Precision Monitor Probe","Precision Monitor","@busch2.raleigh.ibm.com->NmosPingFail",5,"Ping fail for 9.27.132.139: ICMP reply timed out",07/05/07 12:29:12,07/03/07 18:02:31,07/05/07 12:29:09,07/05/07 12:29:09,0,1,194,8000,0,"",65534,0,0,0,"NmosPingFail",0,0,0,"","",0,0,"",0,"0",120,1,"9.27.132.139","","","","dyn9027132107.raleigh.ibm.com","","","",0,0,"","","NCOMS",424,""
    Now my program makes it all nice and filters out the junk and resends the new string to the other server running here:
    Enter port to run server on:
    1234
    Listening on : ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=1234]
    Waiting for client connection...
    Socket[addr=/127.0.0.1,port=4920,localport=1234] connected.
    Parser client connected.
    hostname: localhost
    Ip address: 127.0.0.1:1234
    Event from: localhost-> PacketType: UPDATE , SizeOfPacket: 577 , PacketID: 1, Identifer: UPDATE: "@busch2.raleigh.ibm.com->NmosPingFail1" , Serial: 424 , Node: "9.27.132.139" , NodeAlias: "" , Manager: "Omnibus" , Agent: "Precision Monitor Probe" , AlertGroup: "Precision Monitor" , AlertKey: "@busch2.raleigh.ibm.com->NmosPingFail" , Severity: 5 , Summary: "Ping fail for 9.27.132.139: ICMP reply timed out",StateChange: 07/05/07 12:29:12 , FirstOccurance: 07/03/07 18:02:31 , LastOccurance: 07/05/07 12:29:09 , InternalLast: 07/05/07 12:29:09 , EventId: "NmosPingFail" , LocalNodeAlias: "9.27.132.139"
    Lenght of the string was: 579
    The length of the final string I sent is 577 by using the string.length() function, but when I re-read the length after the send 2 more bytes got added, and now the length is 579.
    I tested it for several cases and in all cases its adding 2 extra bytes.
    Anyways, I think this is a bad solution to my problem but is the only one I could think of.
    Any help would be great!

    (a) You are counting characters, not bytes, and you aren't counting the line terminators that are appended by println() and removed by readLine().
    (b) You don't need to do any of this. TCP doesn't lose data. If the receiver manages get as far as reading the line terminator when reading a line, the line will be complete. Otherwise it will get an exception.
    (c) You are assuming that the original input and the result of message.toString() after constructing a Message from 'input' are the same but there is no evidence to this effect in the code you've posted. Clearly this assumption is what is at fault.
    (d) If you really want to count bytes, write yourself a FilterInputStream and a FilterOutputStream and wrap them around the socket streams before decorating them with the readers you are using. Have these classes count the bytes going past.
    (e) Don't use PrintWriter or PrintStream on socket streams unless you like exceptions being ignored. Judging by your desire to count characters, you shouldn't like this at all. Use BufferedWriter's methods to write strings and line terminators.

  • No of records in SAP BI Corresponds to how many records in database

    Dear all
                   If i have 2lakh records in a datasource  then how it  Corresponds to how many records in database.

    For the first time load the datasource , the no of records in the database(source) must be equal to the number of records in the PSA(datasource).
    If you are daily deleting the records in the PSA , and doing a delta load then the no of records in PSA must be equal to the no of records in delta queue RSA7 for the corresponding datasource .
    If the load is a full load everytime or a full repair  ,then the no of  records in PSA  must be equal to the numbers of records in source.

Maybe you are looking for