Fetching Records by Records

I have table of 1 crore records and i want to insert the records into another table for back up.I am selecting 10,000 records
each time and inserting into backup table.
I am selecting records using rownum. After inserting first 10,000 records How can i select next 10,000 records?.
Declare
type t1 is ref cursor;
emp_old t1;
x emp%rowtype;
begin
open emp_old for select * from emp where rownum<10000;
loop
fetch emp_old into x;
exit when emp_old%notfound;
insert into emp_backup values(x.empno,x.ename,x.sal);
end loop;
close emp_old;
end;

Please use English terms when you post. The term 'crore' is inappropriate for the forums.
>
I have table of 1 crore records and i want to insert the records into another table for back up.I am selecting 10,000 records
each time and inserting into backup table.
I am selecting records using rownum. After inserting first 10,000 records How can i select next 10,000 records?.
>
Why? Just query the rows and insert them. There is no concept of 'next row' in an Oracle table. Rows in a table are like balls in a basket; there is no first or last or any order associated with them.
The easiest and quickest way is to create the table at the same time
CREATE TABLE myBackup NOLOGGING as SELECT * FROM myTable;

Similar Messages

  • Unable to fetch 50,000 records from SQL using Orchestrator

    Hi Team,
    I have a table in MS SQL which is having more than 50,000 records. I am trying to fetch 50,000 records using orchestrator, but unable to fetch the records..
    There is no problem with the SQL query because I can able to get 40,000 records..
    I am using SCORCH DEV - SQL Integration Pack.
    Regards,
    Soundarajan.

    Hi,
    Thanks for your query.
    I have also used timeout parameter but it is not working.. As you said I also tried with Query database Activity which is out of the box...
    Now i can able to fetch more than 80,000 records but the output what i am getting is not in the format which we are looking for..
    Attached the output...
    How to edit this..?
    I tried to write the output in excel but all the data sits in the first column itself..
    Regards,
    Soundarajan.

  • How to fetch all the records from ztable

    Hi 
    My program is outbound program.
    According to the requirement i have to fetch all the records from ztable which are not tranmitted before to the third party and once the records are extracted and written to output file they will be marked as 'X' in the "status" field of that ztable for the next days run.
    How to fetch the records.Please suggest me.
    Thanks,
    Neelima

    HI,
    Fetch all the records whose status is equal to 'X' as whatever data is sent to third party system is marked as 'X' in status field of table after sending.
    You need to first fetch the data into internal table using the select statement where status EQ space. You get the data which is not yet transmitted to third part. And later in the program after trasmitting the data to third party modify the Records in the DB table which are transmitted with Staus eq 'X'.

  • Form Error 40507: unable to fetch next query record

    Hi there folks,
    I have a Form (10g) where I have a Master Block and a Detail block. However, the other day, there was an Error reported:
    ORACLE error: unable to fetch next query record
    When we do capture Errors, we also capture the Last Query run. From that, it says that the last record that was queried was in the Detail block (Which is multi-record block) in tabular form. I looked at the Error Message but there is not much information on this Error.
    So, it's just a base table block and it has a drop down list which has two values. Any ideas what could have happened?
    Thanks!

    The Block is based on a a table. As a mattr of fact, there are 3 blocks in the form and they are all based on tables. Now, it migth be wrong for me to assume that the detail block in the one that caused the problem just because the Last Query was based on the detail block.
    Block 1 is a single record block -- Master Block
    Block 2 is a tabular block -- Detail Block
    Block 3 is a tabular block -- Detail Block
    There are two relations:
    Block 1 and Block 2
    Block 1 and Block 3

  • Fetching 3 laks records from the database

    Hi All,
    I have a requirement that if we are fetchin 3 lakks records from the database, can we fetch the records in a single span of time ,if yes then how?
    If no, then we have to fetch the recods multiple times but since for the first time it is fetching 1 lakh records and for the next time how the bpel engine know that it has to fetch 1000001 record.
    Can anybody came this type of scenario. Please guide me on this.
    Regards,
    Ch

    There are some options given here @ http://myexperienceswithsoa.blogspot.com/2010/06/db-adapter-polling-tricks.html
    Check them out.
    But if you reading so much of data at once, you better have the necessary infrastructure to handle the load like memory, jvm tuning, etc ...
    If there is a limitation, you will need to assess your polling record count to be may 10K or so to strike a balance on the performance.
    Hope this helps.
    Thanks,
    Patrick

  • FRM 40507 Unable to fetch next query record ??

    I am working on forms/oracle 10G
    there is this form which has a Combo Box list item.
    data in this list is fetched from a table 'A'.
    while saving data the value in the list item is saved in
    another table 'B'
    Now when i try to query the form using F11 and Ctrl + F11
    it gives me an error :
    FRM: frm 40507 UNABLE TO FETCH NEXT QUERY RECORD
    please guide what should i do ?? ...
    regards

    Details of the FORM :
    a) there is only one table
    b) we are using 2 datablocks . parent and child. This is because the child is
    displaying about 5 records. No parent child relation is set in the datablocks yet or in the table. can we do this in a single table ?
    c) now the user shall select a value from the activity list ( combo box ) . The date and time are auto populated in when new form instance. User then enters data for the child records and clicks save.
    d) data is save correctly.
    e) but while querying data that is saved it errors out saying that : FRM 40507 Unable to fetch next query record
    Will we have to define a parent child relation in the single table or in the datablocks ?
    i m really confused ??
    Regards

  • Problem in fetching 7 million record

    Hello all,
    I need to fetch data from a external database (Oracle 11g) and insert into local database (Oracle 11g) using db link. The query is simple..
    >> Select * from table_name where column_name = date.
    Can i use cursor with bulk collect and bulk insert concept using LIMIT option?
    I tried with above mehod. But sometime am geting "*ORA-04030: out of process memory when trying to allocate 16408 bytes* " but not always.
    The Fetchable record is always not less than 6 milion. This process need to happen daily. We have onyl limited access to external DB. Just Select permission for a table.
    Regards
    Natarajan M

    Relational databases are about processing sets, not about processing records.
    If you use a procedural approach, this will be many magnitudes slower.
    Why? Because Oracle will have to fetch the data to your PGA. The statement posted earlier fetches 0 records. You fetch 7 million records.
    Sybrand Bakker
    Senior Oracle DBA

  • How to fetch the distict records from xcelsius excel column

    i have brought the datas from database using webservice
    from this data i want to fetch the distinct records in another column
    how to do this without using third party tool like "Centigon filtered summary"
    plz help me.
    Regards
    Ram.G
    Edited by: g.ram84 on Dec 1, 2009 6:57 AM

    Hi Ram,
    This can be achieved using functionalities within excel of the Xcelsius.
    Please try the steps below:
    1) From the excel menu choose Data | Filter | advaced Filter.
    2) choose your entire range.
    3) choose location to copy.
    4) choose Unique records only
    and only unique records will be copied.
    Hope this helps...
    Regards,
    Ankeet

  • Question on SFSF Adapter : Delta sync to fetch only changed records.

    Hi All ,
    As per the SAP Document on SFSF Communication channel, one of the feature supported by SP00 release of the connectivity add-on 1.0 is :-
    1. Delta sync to fetch only changed records
    SFSF Adapter: Delta Sync
    The delta sync features enables you to fetch only the records that were modified after the last successful data fetch from the SuccessFactors system.
    This increases the efficiency of query operation.
    So below are my question accross Successfull run date feature :
    Is it SAP PI Connector internally maintains this last successful run date ?
    what would be Time-Zone of Successful run date : Is it where SF DC is located or where PI Box is Located ?
    what is it mean from successful run date ? - is it process successful run date or is it just communication channel successful run date ?
    For Delta extraction - This Successful Run Date - Is it maintained internally for  Interface wise or Communication Channel wise ?
    eg. If i have 5 Delta Interface - will SAP PI maintain 5 Successfull run dates w.r.t to each connector or w.r.t each Process ?
    for more information please open below URL.
    http://help.sap.com/saphelp_nw-connectivity-addon100/helpdata/en/1e/22aaf0780d4b78b6f889157f6a8035/frameset.htm
    Regards
    Prabhat Sharma

    Hello all,
    I have the same question : in the "official" documentation (SuccessFactors (SFSF) Adapter for SAP NetWeaver Process Integration) is mentioned this :
    Delta Sync - The delta sync features enables you to fetch only the records that were modified after the last successful data fetch from the SuccessFactors system. This increases the efficiency of the query operation.
    Anyway I cant find any specification on how to use this feature. Do you have any suggestion on how to implement it or any reference to an existing documentation?
    Do I need to write you an email to get the info?
    Regards

  • How to fetch all the records

    Hello everybody,
    I am currently working on SQL Developer for the couple of weeks. I have specific need to check, how much time one query take to fetch all the records. Currently it can fetch only 50 records and when scroll then next 50 records and so on.
    Can anybody tell me, how to set this to fetch full records
    Regards,
    Martand M Joshi

    Martand,
    There's no setting to fetch all records. You wouldn't like SQL Developer to fetch for minutes on big tables anyway.
    If, for 1 specific table, you want to fetch all records, you can do Control-End in the results pane to go to the last record. You could time the fetching time yourself, but that will vary on the network speed and congestion, the program (SQL*Plus will be quicker than SQL Dev because it's more simple), etc.
    Now, what I think you really want here, is getting the execution time. If you really want to analyze the query's performance, you'd have to use the explain plan, autotrace and tkprof (see the manual for tuning and performance).
    To make us life easier, the makers of SQL Developer included support of the explain plan, and as of v1.1, autotrace!
    I'm sure you've got enough to work things out from here...
    Regards,
    K.

  • Fetching the Effective Record

    Hi all,
           I have to fetch a record from the table T71ADM10, which is eefective. This could be done with the help of the filed EFFDT. Is there any function module to fetch the latest record?
    Regards,
    Bharath Mohan B

    Hello check out FM: HR_ECM_HANDLE_NEW_EFFDT
    reward points if helpful

  • I am having problems syncing recently recorded songs to my iPod. I am using an ion program to record vinyl records to iTunes. The songs are in the iTune library and will play on the computer. When I try to sync they show up but do not play. help

    I am using an ion piece of equipment to record vinyl reccords to my iMac and in turn save them in iTunes. I have recorded many records this way and have never had a problem until yesterday. I recorded three songs from records to iTunes and was successful as they are on the song list and will play on the iMac. When I tried to sync them to my iPod they showed up on the menu but would not play. The iPod just skipped over the new guys. Am I doing something wrong or has my ion program flipped out? Any help would be appreciated by this old man. Thankyou

    This might sound weird, but here's an idea which worked for me re music that was newly added to itunes and showed up in my ipod but wouldn't play - I simply played the tracks in itunes first, just a second of time or so will do it, not the whole track, then connect the ipod and sync again and this time they played - hope this helps.

  • What do I need to hook up a turntable directly to the iPhone 5s in order to record vinyl records?

    What do I need in order to hook up a turntable directly to the iPhone 5s in order to record vinyl records?

    A preamplifier with an RIAA equalised input for a turntable, preferably a USB one,

  • Process multi-record & multi-record-format files using ESB & File Adapter

    I am looking to process/parse an in-bound file with the following make-up and to load into a database table using the File Adapter, ESB and DB Adapter.
    File Make-Up:
    - each line in the file is a record
    - each record is made up of 12 fields
    - there are multiple record types denoted by the first field in the line
    - record types may or may not have common fields
    - where there are common fields, the field may be in different columns
    - each record is to be inserted into a database table
    Sample File:
    3,,"03-0243-0188132-00",.20,26,075,"","000000006026","","","22/04/08",03 1303
    3,,"03-0243-0188132-00",20.00,26,075,"","","","","22/04/08",03 0579
    5,,"03-0243-0188132-00",99.60,,,"OPENING BALA",,,"ACME GROUP","22/04/08",
    6,,"03-0243-0188132-00",99.60,,,"CLOSING BALA",,,"ACME GROUP","22/04/08",
    8,,"03-0243-0188132-00",-346119.05,16,000,"DEBITS",,,,"22/04/08",
    8,,"03-0243-0188132-00",346119.05,349,050,"CREDITS",,,,"22/04/08",
    9,,"03-0243-0188132-00",-346119.05,16,000,"DEBITS",,,,"22/04/08",
    9,,"03-0243-0188132-00",346119.05,349,050,"CREDITS",,,,"22/04/08",
    Record Types and corresponding format:
    3, Corp ID, A/C Number, Trans Amt, Serial Number, Trans Code, Particulars, Analysis Code, Reference, Other Party Name, Transaction Date, Originating Bank
    5, Corp ID, A/C Number, Opening Balance, Serial Number, Trans Code, Particulars, Analysis Code, Reference, Other Party Name, Transaction Date, Originating Bank
    6, Corp ID, A/C Number, Closing Balance, Serial Number, Trans Code, Particulars, Analysis Code, Reference, Other Party Name, Transaction Date, Originating Bank
    8, Corp ID, A/C Number, Amount, Number, 000, “DEBITS”, Analysis Code, Reference, Other Party Name, Transaction Date, Originating Bank
    8, Corp ID, A/C Number, Amount, Number, 050, “CREDITS”, Analysis Code, Reference, Other Party Name, Transaction Date, Originating Bank
    9, Corp ID, A/C Number, Amount, Number, 000, “DEBITS”, Analysis Code, Reference, Other Party Name, Transaction Date, Originating Bank
    9, Corp ID, A/C Number, Amount, Number, 050, “CREDITS”, Analysis Code, Reference, Other Party Name, Transaction Date, Originating Bank
    Please note that record types 8 and 9 have 2 fixed fields.
    I have tried playing around with the File Adapter and the ESB but not having much luck. Can someone provide any suggestions on how I can handle this?

    James,
    Thanks for your prompt response. I have come across your post previously.
    Please excuse my in-experience (very new to SOA and Oracle SOA Suite) but i have not understood how your post regarding the manual creation of an XSD will assist with my problem. Could you possibly further elaborate on the overall approach i should be taking?
    Regards,
    Simon

  • CS6 stamp tool doesn't work with action / record ( tool record is enabled ) other tools works

    CS6 stamp tool doesn't work with action / record ( tool record is enabled ) other tools works

    At one time tool  recording was not possible and if you install Adobe Scriptlistener Plug-in Adobe will disable tool recording its never an option.
    I use and record actions all the time and was looking forward to tool recording when Adobe announced it.  However I found what they delivered was  of very limited value because of the restrictions. I do not care that Adobe disables tool recording on my machine.
    The amount of data that gets reordered seems also vary between machines.  I found that Action recorded on fast machine are not usable on slow machine.  Fast machine recorder too much data.
    Documents you use such action on must also have the same size and resolution as the document you recorded the action on. Quite a restriction.
    You problem may also be foxed in CC 2014 sett here Photoshop CS6 - Recording the clone tool in an action gives incorrect results on replay.

  • Some question on IDOC (Control Record/Data Record/Status Record)

    Dear all,
    I am new in this area, and would like to enquire some question on this topic.
    When I view a IDOC via WE02, each of the IDOC record will consist of Control Record/Data Record/Status Record).
    Questions:
    I notice that the data records consists of many segment (i.e. E1EDK01, etc) which are use to store application data.
    1 - My question is do I have to manually create all these segment and do a mapping to my application field one by one (i.e. that is when I want to create a brand new message type from scratch)?
    2 - If question no. 1 is Yes, how to do it, what are the transaction code to create it? can you show me the step by step.
    3 - I don't have to create the Control record and the status record for my new message type right ? because those field value will automatically pull out from partner profile and system status message, am I correct?
    Thanks.
    Tuff

    Hi Tuff,
    As everything in SAP, with IDOCs too there are
    1) Standard IDOCs
    2) Standard IDOCs(Extending - Enhancement to an IDOC, to accomodate for custom values)
    3) Custom IDOCs
    And every IDOC has,
    Control record - EDIDC Structure - This mostly reflects the partner profile information, along with few more details which are used for IDOC extension, Sequencing etc
    Data Records - EDID4 Structure - These records contain the actual business data of the document in concern. So for ORDERS05 it would contain order details, INVOIC02 - Invoice details so on...
    Status Records - These records capture the status of an IDOC from the time it is received/sent from your system and a corresponding business document is created/changed. So this will have messages like "IDOC sent to the port OK" etc which are status from the communication layer(ALE) to application specific messages like "Sales Order XXX created" or "Invalid Material" etc.
    You would have noticed something called as Process code in the partner profile, this is associated with a FM(or work flow task etc) which has the business logic coded in.
    So in case of an Inbound IDOC, the sending system updates the IDOC - Control and Data records, and sends it to the receiving system. On the receiving system the IDOC's control record is validated against the partner profiles set, if an entry is found then using the process code it finds the associated FM which will decode the data from the IDOC data records as per the IDOC type and then use it to post data into SAP (VIA BDC, Batch Input, BAPI etc).
    And all this while the Status records are being updated accordingly.
    So with the above context will try to answer your questions,
    1 - My question is do I have to manually create all these segment and do a mapping to my application field one by one (i.e. that is when I want to create a brand new message type from scratch)?
    In case of a custom IDOC, yes you will have  to.
    In case of a standard IDOC, you wouldn't have you just have set up the necessary configuration (Partner Profile, Process code etc)
    In case of a standard IDOC extended to accommodate for some custom values(for which there are no fields in standard IDOC - Let us say you have added some new fields on VA01) - In this case you can still use the standard Process code and Standard FM associated with it, SAP provides several Function exits in these FM's which you can leverage to add your custom logic.
    2 - If question no. 1 is Yes, how to do it, what are the transaction code to create it? can you show me the step by step.
    There are several documents available on the net and on SDN detailing step by step approach for all the above three cases,
    just search for step by step guide for IDOCS - sap.
    3 - I don't have to create the Control record and the status record for my new message type right ? because those field value will automatically pull out from partner profile and system status message, am I correct?
    Again it depends, in case of using a standard IDOC you wouldn't have to. But in case you have some customizations/enhancements then you might have to.
    For Ex: updating the control record accordingly for indicating that you have extended the standard IDOC. Or append custom messages to the status record as per the business logic.
    Try out the examples you find on the net and post any specific questions you might have.
    Regards,
    Chen

Maybe you are looking for

  • WIFI Problem

    Please help! My wifi just stopped working on my imac. I am getting the message that the wifi has a self- assigned ip address (169.) and will not connect to the internet! Please help..My wifi is working fine with my iphone, ipad and other devices. It

  • What is this?  What am I doing here?

    I get into the application because it says that it's a hosted service. But before I can do anything with it, it tells me I have to have an FTP server to use it. Usually, a hosted solution means that the user doesn't expect to have to buy an FTP serve

  • Help with updating imageIcon in JTable

    Hi All Please I am hoping that some out there will know what is going on with this I am setting a Cell with a ImageIcon with this code         Object[] data = {             rSet.getString(1),             new ImageIcon("imagesTest/" + "check" + rSet.g

  • I have FaceTime, my mother has ichat, can we talk?

    I have FaceTime, can I talk to someone who just has iChat?

  • Alternate Column color

    Is there any  way in a  Webi report to set the color of alternate columns as we can currently do for rows? The option in Java Panel is named as " Alternate Row/Column colors" but this does not work for columns. Thanks.