Insert and delete

I want to clarify the situation.

1 create table t1 select * from t2.
2. removal of t1.

Why the second statement is several times slower to insert if she moves just the same amount of data in chunks of cancellation?

just a DBA wrote:

Dave Rabone wrote:
... and this is at first glance paradoxical because the reverse argument should apply to do it again, until you recognize that undo is also protected by redo.

Sorry, not clear. For example, "Insert" inserts 100 MB for data segments. "Delete" moving just data in return. Why again is so different?

There is an optimization of Oracle can be used on the insert that it does not use the button Delete.
Imagine that you insert 80 000 lines of 100 bytes each - for a total of about 80 MB of raw data, with 80 lines per block, 1 000 blocks.

On the insert Oracle can optimize cancel it and redo size by creating "table according to" defeats records and vectors of roll forward, so the overhead costs amounted to about 200 or so bytes per block in the table.

The button Delete this optimization does not - apply to overhead costs amounted to about 200 or so bytes per line.

If you check your numbers, you will probably see that the difference in roll forward is about 200 to 250 bytes per inserted row.

Concerning
Jonathan Lewis

Tags: Database

Similar Questions

  • How can I insert and delete pages from a pdf with acrobat 10 X?

    How can I insert and delete pages from a pdf with acrobat 10 X?

    Otherwise, don't forget that your page thumbnails Panel is open and click the icon highlighted in this image, just under the title.

    You will see a drop-down list with the options you need.

  • Using insert and delete at the same time

    Good afternoon

    I want to do an insert on the table A in table B, while at the same time do a delete on table a.

    and I want to do with the procedures.

    Here is the script I came up with.

    INSERT the table_a (select * from table_b where status = was ') REMOVE from table_b where status = has '

    but I get an error ORA-00933.

    Got any ideas on how I can do this?

    Thank you

    try to:

    BEGIN

    Insert into table_b (select * from table_a where status = has ');

    remove from table_a where status = ';

    END;

    In addition, to create a procedure and see if you can only call this:

    some_procedure

    in some cases, for example (type ODBC connection)

    {call some_procedure ;}

    MK

  • problem with the locking insert and delete between two linked tables help please.

    Hi guys I have a problem with a table of locking in Oracle forms, but when I try in SQL happens here too many users. I was wondering if anyone can shed some light on this?

    I created two scenerios one that works and is not based on the primary key and foreign key constraints (but one that works is not possible for us because it would mean change design table that we can not do).

    I've hardcoded in 1127,1128 number to make it easier (in reality it is a sequence)

    OK scenerio one (our scenerio)

    two tables
     CREATE TABLE testSFLABPR 
       (     LABP_REF_IRN VARCHAR2(25 BYTE), 
         LABP_REF_REF VARCHAR2(30 BYTE), 
         LABP_REF_SL NUMBER(8,0), 
         LABP_CONFIG_ID NUMBER(8,0),
          CONSTRAINT PK_testLABPR_IRN_SL PRIMARY KEY (LABP_REF_IRN,LABP_REF_SL)
       ) ;
    
     CREATE TABLE testSFLABP 
       (     LABP_IRN VARCHAR2(25 BYTE), 
         LABP_OPNO NUMBER(3,0), 
         labp_no NUMBER(8,0),
          CONSTRAINT PK_testSFLABP PRIMARY KEY (LABP_IRN, LABP_OPNO, LABP_NO) ENABLE, 
          CONSTRAINT testFK_SFLABP_SFLABPR FOREIGN KEY (LABP_IRN,labp_no)
           REFERENCES TESTSFLABPR (LABP_REF_IRN,LABP_REF_SL) ENABLE
       ) ;
    OK now session is done the following
    DELETE FROM      testSFLABPR     WHERE   LABP_CONFIG_ID            = 1127;          
                   
    INSERT INTO testSFLABPR(
            LABP_REF_IRN,
            LABP_REF_SL,
            LABP_REF_REF,
            LABP_CONFIG_ID
            )
            VALUES
            (
            'SOPENSHELVING',
            1127,
            1127||'CF Route',
            1127
            );
            
    INSERT INTO testSFLABP
          (
          LABP_IRN,
          LABP_OPNO,
          LABP_NO)
    VALUES (
    'SOPENSHELVING',
    1,
    1127);
    session one remains in this State.

    second session now does the following
    DELETE     FROM testSFLABPR     WHERE   LABP_CONFIG_ID            = 1128;     
    second session is now locked until a commit or rollback occurs.

    If I run the exact scenerio even with only a primary key on the table without locks held
     CREATE TABLE testSFLABPR 
       (     LABP_REF_IRN VARCHAR2(25 BYTE), 
         LABP_REF_REF VARCHAR2(30 BYTE), 
         LABP_CONFIG_ID NUMBER(8,0),
          CONSTRAINT PK_testLABPR_IRN_SL PRIMARY KEY (LABP_REF_IRN)
       ) ;
    
     CREATE TABLE testSFLABP 
       (     LABP_IRN VARCHAR2(25 BYTE), 
         LABP_OPNO NUMBER(3,0), 
         labp_no NUMBER(8,0),
          CONSTRAINT PK_testSFLABP PRIMARY KEY (LABP_IRN, LABP_OPNO, LABP_NO) ENABLE, 
          CONSTRAINT testFK_SFLABP_SFLABPR FOREIGN KEY (LABP_IRN)
           REFERENCES TESTSFLABPR (LABP_REF_IRN) ENABLE
       ) ;
    INSERT INTO testSFLABPR(
            LABP_REF_IRN,
            LABP_REF_REF,
            LABP_CONFIG_ID
            )
            VALUES
            (
            'SOPENSHELVING',
            1127||'CF Route',
            1127
            );
            
    INSERT INTO testSFLABP
          (
          LABP_IRN,
          LABP_OPNO,
          LABP_NO)
    VALUES (
    'SOPENSHELVING',
    1,
    1127);
    DELETE     FROM testSFLABPR     WHERE   LABP_CONFIG_ID            = 1128;
    I hope I posted all the information that is relevant... version of DB were is Oracle Database 10g Release 10.2.0.3.0 - Production

    Any help is appreciated...

    Creating indexes on columns of the FK. Something like:

    CREATE INDEX testFK_SFLABP_SFLABPR_IDX
    ON testSFLABP(LABP_IRN,labp_no)
    /
    

    SY.

  • CAPTURE THE OUTPUT IN INSERT INTO SELECT AND DELETE

    Hi all


    INSERT into employee_history_arch select * from employee_history where employee_status = 'CP' and action_dt < (sysdate-32);
    commit;

    delete from employee_history where employee_status = 'CP' and action_dt < (sysdate-32);
    commit;

    I must capture both the output of the insert and delete the sql query and compare the two values for validation. I shouldn't use select count (*) before the delete statement. I shud exactly capture the output... How to do? Please help me

    We will have ' 30 deleted rows' or ' 30 inserted rows"in our tool... I need to capture that 'put out' in a variable and validate against the other

    This should be easy.

    SQL> set serverout on
    SQL> DECLARE
      2    v_rows_inserted PLS_INTEGER;
      3    v_rows_deleted  PLS_INTEGER;
      4  BEGIN
      5    INSERT INTO emp_temp
      6      SELECT * FROM emp WHERE deptno = 20;
      7    v_rows_inserted := SQL%ROWCOUNT;
      8    dbms_output.put_line('Rows Inserted: ' || v_rows_inserted);
      9    DELETE FROM EMP WHERE deptno = 20;
     10    v_rows_deleted := SQL%ROWCOUNT;
     11    dbms_output.put_line('Rows Deleted: ' || v_rows_deleted);
     12    IF v_rows_inserted = v_rows_deleted THEN
     13      dbms_output.put_line('They are same!');
     14    ELSE
     15      dbms_output.put_line('They are NOT same!');
     16    END IF;
     17  END;
     18  /
    Rows Inserted: 7
    Rows Deleted: 7
    They are same!
    
    PL/SQL procedure successfully completed.
    
  • What happens when you insert/modify/delete a row in a table - concepts

    I am trying to understand the below concepts regarding the internal concepts (for example, undo and redo)

    (1) what is happening in the database when you insert a row in a table?

    (2) what is happening in the database when you update a row in a table?

    (3) what is happening in the database when you remove one line in the table?

    I have read the oracle documentation and mistook the redo and undo behavior. It would be great if someone explains the concept in a simple way.  I'm a novice programmer to understand database concepts. Any help would be much appreciated.

    INSERTIONS and deletions are handled the same way.  The cancellation of an INSERT is a DELETE.   The cancellation of a REMOVAL is an INSERT.

    Therefore, the generation 'Cancel' for INSERTION is less than that of a DELETION (because the cancellation of a DELETION is to reinsert the line - the value of each column in the row must be captured in the undo).

    If restore you an INSERT, then Oracle executes effectively a DELETE tablename WHERE rowid =... rowid_that_was_inserted.  A cancellation for an INSERTION is 'rapid '.

    If restore you a DELETION, then Oracle executes effectively an INSERT tablename values (col1, col2, coln).  The cancellation of a DELETION takes more time because Oracle would have to re-enter the values.

    Remember that Oracle also captures the redo to undo it (and do it again for the price drop if you do a restore).

    Hemant K Chitae

  • Can I use shrink for an asset (perform insert very-delete operations) table

    Hello guys,.

    I have a very simple question. According to an article (link: http://www.dba-oracle.com/t_automatic_segment_space_management.htm) the following quote is written
    Beware:  Using ASSM can hinder database DML performance, and most Oracle experts will use manual freelists and freelist groups.  Click here for details on automatic segment space management internals.
    
    Using automatic segment space management is great for almost all Oracle applications, with the exception being super-high update tablespaces, which would use traditional freelists with multiple freelist groups.
    I just want to use shrink my table in order to reclaim the unused space. However, I play a lot insert and delete operations on the table (not update, insert and delete). So, I wonder, if I use shrink, my table will affect seriously? Because I insert and remove thousands of rows in this table every day.


    And my second question is how can I know that my table is in SAMS (automatic segment space management) to use retractable? Because I was told that my table shoul be in SAMS to use retractable?
    select * from v$version;
    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE 11.2.0.1.0 Production."
    AMT for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    best regards
    Charlie

    970992 wrote:
    I just want to use shrink my table in order to reclaim the unused space.

    Ok. You are sure that there is some unused space and that Oracle will not reuse space automatically? If you are constantly inserting and removing a table, unless you remove constantly more data that you insert or you use direct-path inserts to prevent Oracle to reuse the space freed by deletions, there is no reason to believe that there is unused space in the table.

    However, I play a lot insert and delete operations on the table (not update, insert and delete). So, I wonder, if I use shrink, my table will affect seriously? Because I insert and remove thousands of rows in this table every day.

    Thousands of lines is enough little activity.

    If you want to shrink the table, you generally want to do while there is little or no activity on the table since you will need to at least briefly to acquire a lock on the table. If you do only a few thousand a day race DML operations, it shouldn't be difficult to find a window where the shrink will not be a significant impact on DML.

    But, back to my first point, I would tend to wait that you don't need to shrink the table in the first place.

    And my second question is how can I know that my table is in SAMS (automatic segment space management) to use retractable? Because I was told that my table shoul be in SAMS to use retractable?

    Assuming that you know what the table tablespace is in

    SELECT segment_space_management
      FROM dba_tablespaces
     WHERE tablespace_name = <>
    

    Justin

  • approximate number of inserts, updates and deletions

    Hello
    in 10 g with STATISTICS_LEVEL = TYPICAL
    How to see the approximate number of inserts, updates, and deletes for a specific table?

    Thank you.

    This table has been abandoned - but segment still exists – and 'strange' name comes from the management of the recyclebin.

    Nicolas.

  • ALTER TABLE RETRACTABLE and DELETE are same as far as space is concerned. Right?

    DB version: 11.2.0.4

    OS: Oracle Linux 6.5

    In my shop, we want to do a data cleanup (purge) so that we don't have to buy additional storage.

    As far as I know, that when you can do a manual resizing of the data file, you can release space back to the system of files/Diskgroup.

    SHRINK and DELETE free space for the data file, but it will create empty blocks for future insertions/changes.

    Imagine a tablespace with a single file data (32GB) and 1 single segment. This segment can be created anywhere in a data file. In this 32 GB datafile oracle may place this segment in the 25 GB. So even if the total space used in the data file is 10 MB, you can resize only to 25 GB!  The solution for this is to move the debate and then run an ALTER DATABASE DATAFILE... RESIZE the control.

    But this 'moving segment' approach is not practical when want to deal with a lot of data with a lot of segments in her files.

    Back to my original question about SHRINK and DELETE; If SHRINK and DELETE can free space in a data file, there is virtually no difference between SHRINK and REMOVE what little space is. Right?

    Thus, the only advantage of SHRINK on delete, I can think of is that SHRINK will lower the HWM to the level of the segment so that Oracle does not have to scan all blocks (a lot of blocks empty sometimes) under the HWM of the segment.

    My assumptions are correct?

    I see no link between SHRINK and REMOVE.

    However, your understanding of SPACE SHRINK is defective. Unless you explicitly use the COMPACT clause, a therapist will indeed free degrees and therefore make space available in the data file.

  • Import and delete the photos from the camera

    The link you gave is not useful. I don't want to use the application Windows 8 photos. All I want to do is to plug my camera and have pictures, transfer in a folder of my title and delete the photo from my camera. It's an ability that were available in Windows 7 and not available in Windows 8. I am currently using Dropbox and it is slow and uses tons of data to my hotspot.

    Thank you!

    Split from: https://answers.microsoft.com/en-us/windows/forum/windows_8-pictures/importing-and-erasing-photos-from-camera/d8ad55da-66e7-46d5-b54e-3ef0bf45e986

    Hello Joe,

    Thanks for posting your query in Microsoft Community.

    I understand that you have questions, import and delete the photos from the camera. We are happy to help you in the matter of fixing.

    You can check the below link to import photos from the camera.

    1. First, connect your digital camera, and press the Power On button. Windows 8, which will detect the camera and will install the appropriate drivers.
    2. After the driver installation is complete, the AutoPlay menu appears.
    3. Select the option import pictures using Windows.
    4. In the lower right corner of the screen, a small window asking if you want to mark photos will appear. You can type a general images you want to import. Tags can be very useful to organize and find your photos.
    5. If you do not want to insert a tag just leave this space empty and click Import.
    6. If you want to customize the import settings, click the Options button. Now you can change the following settings: where pictures import them (the default folder is pictures - if you want another folder, click Browse and select or create this folder), the name of the folder (by default the name of the folder will be the date when the images are imported over the tag you entered) and the file naming convention.
    7. When you are finished, click the OK button. These settings apply to all the photos you want to import in the future.
    8. After you click import, Windows 8 starts to move all your photos.  If you want the pictures to be removed from your camera once the import process is completed, click the Delete after import check box.
    9. Once the process is complete, start Windows Photo Gallery and you will be able to see all the photos that have been imported.
    10. Now, turn your unit off and unplug the cable to connect to your PC.

    If this does not help then, try the steps below to get the images from the camera.

    1. Go in computer.
    2. You will find the camera under portable device or removable devices.
    3. Double-click on this unit and you can copy and paste from this location and import it onto your computer.

    I hope this helps. Otherwise, feel free to write us back for assistance.

  • You want to capture update dates, with trigger on a view to refresh quickly materialized. But trigger on MV consider inserting and updates are inserts only.

    Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production

    PL/SQL Release 11.2.0.4.0 - Production

    CORE Production 11.2.0.4.0

    AMT for Linux: Version 11.2.0.4.0 - Production

    NLSRTL Version 11.2.0.4.0 - Production

    I create the structure of the table like that.

    create table test1 (a primary key, b (2) char number, date c, d varchar2 (10), date of e);

    create table test2 (number of ab, cd (2) tank, date of the ef, gh varchar2 (10), date of the ij, kl varchar2 (100));

    Create materialized view log on test1;

    create materialized view fast refresh test1_v on commit in select * from test1;

    I have create a trigger of the sample

    CREATE OR REPLACE TRIGGER test1_trig

    AFTER INSERT OR UPDATE OR DELETE

    ON test1_v

    FOR EACH LINE

    DECLARE

    lr_test2 test2% ROWTYPE;

    lv_error VARCHAR2 (4000);

    BEGIN

    lr_test2. AB: =: NEW.a;

    lr_test2. CD: =: NEW.b;

    lr_test2. GH: =: NEW.d;

    IF THE INSERTION

    THEN

    lr_test2. EF: = SYSDATE;

    lr_test2.IJ: = SYSDATE;

    lr_test2.KL: = 'INSERT ';

    INSERT INTO test2

    VALUES lr_test2;

    ELSIF UPDATE

    THEN

    lr_test2.IJ: = SYSDATE;

    lr_test2.KL: = 'UPDATE ';

    UPDATE test2 = lr_test2 ab WHERE = LINE: OLD.a;

    ELSIF REMOVAL

    THEN

    DELETE FROM test2

    AB = WHERE: old.a;

    END IF;

    EXCEPTION

    WHILE OTHERS

    THEN

    lv_error: = SQLERRM;

    INSERT INTO XXDOMINO_FG_DATA_LOAD_ERROR

    VALUES ('test1_trig',

    : OLD.a,.

    "test1_trig,"

    LV_ERROR,

    SYSDATE);

    COMMIT;

    END test1_trig;

    /

    So, if check you my code,.

    When I insert EF = SYSDATE, IJ = SYSDATE.

    Update EF is not changed, IJ = SYSDATE.

    So I like to capture their insertion and update dates.

    But if updates or insert arrives on the materialized table. The trigger themselves as an INSERT only.

    So how do you capture the updates?

    I use the statemnet with out merger with performance and also able to capture the update dates.

    CREATE OR REPLACE TRIGGER test1_trig_merge

    AFTER INSERT OR UPDATE OR DELETE

    ON test1_v

    FOR EACH LINE

    DECLARE

    lr_test2 test2% ROWTYPE;

    lv_error VARCHAR2 (4000);

    BEGIN

    IF THE REMOVAL

    THEN

    DELETE FROM test2

        AB = WHERE: old.a;

    ELSIF INSERTION

    THEN

    MERGE INTO test2 one

    B using (SELECT 1 FROM DUAL)

    WE (ab =: new.a)

    WHEN MATCHED

    THEN

    UPDATE the VALUE ab =: NEW.a.

    CD =: NEW.b,

    GH =: NEW.c

    IJ = SYSDATE,

    KL = "Update"

    AB WHERE =: old.a

    WHEN NOT MATCHED

    THEN

    INSERTING VALUES (: NEW.a,)

    : NEW.b,.

    : NEW.c.

    : NEW.d,.

    : NEW.e,.

    "INSERT");

    END IF;

    EXCEPTION

    WHILE OTHERS

    THEN

    lv_error: = SQLERRM;

    INSERT INTO XXDOMINO_FG_DATA_LOAD_ERROR

    VALUES ('test1_trig',

    : OLD.a,.

    "test1_trig,"

    LV_ERROR,

    SYSDATE);

    END test1_trig_merge;

    /

    DISPLAY ERRORS;

  • Help with excel import and delete the page script

    Hello. I will try to make it as simple as possible. I have some data from excel (saved as delimited by tabs) that I need to import in a 5 PDF page. I use the script below to import, and it works fine. All import fields and records the individual (one for each record) PDF. However, I need to extend this functionality by removing some pages before it saves the document by looking at the different boxes. The code below is what I use to import the records.

    // specify the filename of the data file
    var fileName = "/Users/MacMike/Desktop/Test.txt";  // the tab delimited text file containing the data
    var outputDir = "/Users/MacMike/Desktop/Dump/";    // make sure this ends with a '/'
    
    var err = 0;
    var idx = 0;
    while (err == 0) {
        err = this.importTextData(fileName, idx);    // imports the next record
    
        if (err == -1)
            app.alert("Error: Cannot Open File");
        else if (err == -2) 
            app.alert("Error: Cannot Load Data");
        else if (err == 1)
            app.alert("Warning: Missing Data");
        else if (err == 2)
            app.alert("Warning: User Cancelled Row Select");
        else if (err == 3)
            app.alert("Warning: User Cancelled File Select");
        else if (err == 0) {
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf"); // saves the file
            idx++;
        }
    }
    

    As I said before you import works surprisingly well.

    My PDF consists of 5 pages (info-registration, p1 = Dir-contract = p0, p2 = contract ndarp-brand, p3 = takes-contract, p4 = agreement must be brand). My idea is that on the import of data, the script will look at a few check boxes and determine which contracts to remove on the PDF and then save. I wrote the syntax of which, in my view, what it should look like. I'm not a programmer and know just a little bit. I looked through the documentation and this is what I came with. I don't know how to combine to work. Here's the code I came up with that.

    var dir = this.getField("Associate Director"); // checkbox
    var aldir = this.getField("Alumni Director"); // checkbox
    
    var fac = this.getField("Facilitator"); // checkbox
    var alfac = this.getField("Alumni Facilitator"); // checkbox
    
    var oyb = this.getField("Optimize Your Brain"); //checkbox
    var poyb = this.getField("DVD and Workbook Previously Purchased"); // checkbox
    
    // Below are all the possible training options.
    if (dir.value=="Checked" || aldir.value=="" || fac.value=="" || alfac.value=="" || oyb.value=="" || poyb.value=="") {
        this.deletePages({nStart:3, nEnd:4})
    }
    else if (dir.value=="" || aldir.value=="Checked" || fac.value=="" || alfac.value=="" || oyb.value=="" || poyb.value=="") {
        this.deletePages({nStart:3, nEnd:4})
    }
    
    else if (dir.value=="" || aldir.value=="" || fac.value=="Checked" || alfac.value=="" || oyb.value=="" || poyb.value=="") {
        this.deletePages({nStart:2, nEnd:4})
    }
    else if (dir.value=="" || aldir.value=="" || fac.value=="" || alfac.value=="Checked" || oyb.value=="" || poyb.value=="") {
        this.deletePages({nStart:2, nEnd:4})
    }
    
    else if (dir.value=="" || aldir.value=="" || fac.value=="Checked" || alfac.value=="" || oyb.value=="Checked" || poyb.value=="") {
        this.deletePages({nStart:2, nEnd:2})
    }
    else if (dir.value=="" || aldir.value=="" || fac.value=="" || alfac.value=="Checked" || oyb.value=="Checked" || poyb.value=="") {
        this.deletePages({nStart:2, nEnd:2})
    }
    else if (dir.value=="" || aldir.value=="" || fac.value=="Checked" || alfac.value=="" || oyb.value=="" || poyb.value=="Checked") {
        this.deletePages({nStart:2, nEnd:2})
    }
    else if (dir.value=="" || aldir.value=="" || fac.value=="" || alfac.value=="Checked" || oyb.value=="" || poyb.value=="Checked") {
        this.deletePages({nStart:2, nEnd:2})
    }
    
    else if (dir.value=="Checked" || aldir.value=="" || fac.value=="" || alfac.value=="" || oyb.value=="Checked" || poyb.value=="") {
        this.deletePages(none) // I realize this is incorrect. Just showing that this option results in no deleted pages.
    }
    else if (dir.value=="" || aldir.value=="Checked" || fac.value=="" || alfac.value=="" || oyb.value=="Checked" || poyb.value=="") {
        this.deletePages(none) // I realize this is incorrect. Just showing that this option results in no deleted pages.
    }
    else if (dir.value=="Checked" || aldir.value=="" || fac.value=="" || alfac.value=="" || oyb.value=="" || poyb.value=="Checked") {
        this.deletePages(none) // I realize this is incorrect. Just showing that this option results in no deleted pages.
    }
    else if (dir.value=="" || aldir.value=="Checked" || fac.value=="" || alfac.value=="" || oyb.value=="" || poyb.value=="Checked") {
        this.deletePages(none) // I realize this is incorrect. Just showing that this option results in no deleted pages.
    }
    
    else if (dir.value=="" || aldir.value=="" || fac.value=="" || alfac.value=="" || oyb.value=="Checked" || poyb.value=="") {
        this.deletePages({nStart:1, nEnd:2})
    }
    else (dir.value=="" || aldir.value=="" || fac.value=="" || alfac.value=="" || oyb.value=="" || poyb.value=="Checked") {
        this.deletePages({nStart:1, nEnd:2})
    }
    

    How to combine these two so that I can create a document temp import my data, check the boxes to check off and delete the appropriate pages and save the file and then go to the next record? I got the first part done. It imports large and has the right, but I don't know what to do next. Thanks for any help!

    Or y at - it another way to do this?


    Michael

    Wow. Ok. I had it works beautifully. There was a lot of trial and error. Because the script as it was would have, would open the original PDF, delete the pages needed, then save the file. While it would be to go to the next record is missing pages in PDF and bomb to open. I hunted and searched for a way to do this. I found "this.insertPages" in the documentation. Finally, what worked was so move the "save under" in the service and put it under every variation of check. So now when checking the boxes, he performs the check, removes the mandatory pages, stops, insertions of back in deleted pages from the original file, leave the service and finally goes to the next record.

    Here is my final script:

    // This code looks at an excel (tab delimited) file, imports the records into a PDF form 10 Pages long.
    // Then checks a series of checkboxes and deletes the pages that aren't associated with first page.
    // After it deletes these pages it reinserts the deleted pages so it can do the checks for the next record in the (tab delimited) file.
    
    // variables for importing excel data
    var err = 0;
    var idx = 0;
    var fileName = "/Users/MacMike/Desktop/Test.txt";  // the tab delimited text
    var outputDir = "/Users/MacMike/Desktop/Dump/";    // make sure this ends with a '/'
    
    //Checking a bank of 6 checkboxes and determine which pages need to be deleted, save the file, and the insearch the deleted pages again.
    function seekandDestroy() {
        if (dir.value=="Checked" && aldir.value=="Off" && fac.value=="Off" && alfac.value=="Off" && oyb.value=="Off" && poyb.value=="Off") {
            this.deletePages({nStart:6, nEnd:9})
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
            this.insertPages({nPage:5, cPath:"/Users/MacMike/Desktop/TT Reg & Contracts.pdf", nStart:6, nEnd:9 });
        }
        else if (dir.value=="Off" && aldir.value=="Checked" && fac.value=="Off" && alfac.value=="Off" && oyb.value=="Off" && poyb.value=="Off") {
            this.deletePages({nStart:6, nEnd:9})
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
            this.insertPages({nPage:5, cPath:"/Users/MacMike/Desktop/TT Reg & Contracts.pdf", nStart:6, nEnd:9 });
        }
    
        else if (dir.value=="Off" && aldir.value=="Off" && fac.value=="Checked" && alfac.value=="Off" && oyb.value=="Off" && poyb.value=="Off") {
            this.deletePages({nStart:3, nEnd:9})
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
            this.insertPages({nPage:2, cPath:"/Users/MacMike/Desktop/TT Reg & Contracts.pdf", nStart:3, nEnd:9 });
        }
        else if (dir.value=="Off" && aldir.value=="Off" && fac.value=="Off" && alfac.value=="Checked" && oyb.value=="Off" && poyb.value=="Off") {
            this.deletePages({nStart:3, nEnd:9})
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
            this.insertPages({nPage:2, cPath:"/Users/MacMike/Desktop/TT Reg & Contracts.pdf", nStart:3, nEnd:9 });
        }
    
        else if (dir.value=="Off" && aldir.value=="Off" && fac.value=="Checked" && alfac.value=="Off" && oyb.value=="Checked" && poyb.value=="Off") {
            this.deletePages({nStart:3, nEnd:5})
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
            this.insertPages({nPage:2, cPath:"/Users/MacMike/Desktop/TT Reg & Contracts.pdf", nStart:3, nEnd:5 });
        }
        else if (dir.value=="Off" && aldir.value=="Off" && fac.value=="Off" && alfac.value=="Checked" && oyb.value=="Checked" && poyb.value=="Off") {
            this.deletePages({nStart:3, nEnd:5})
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
            this.insertPages({nPage:2, cPath:"/Users/MacMike/Desktop/TT Reg & Contracts.pdf", nStart:3, nEnd:5 });
        }
        else if (dir.value=="Off" && aldir.value=="Off" && fac.value=="Checked" && alfac.value=="Off" && oyb.value=="Off" && poyb.value=="Checked") {
            this.deletePages({nStart:3, nEnd:5})
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
            this.insertPages({nPage:2, cPath:"/Users/MacMike/Desktop/TT Reg & Contracts.pdf", nStart:3, nEnd:5 });
        }
        else if (dir.value=="Off" && aldir.value=="Off" && fac.value=="Off" && alfac.value=="Checked" && oyb.value=="Off" && poyb.value=="Checked") {
            this.deletePages({nStart:3, nEnd:5})
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
            this.insertPages({nPage:2, cPath:"/Users/MacMike/Desktop/TT Reg & Contracts.pdf", nStart:3, nEnd:5 });
        }
    
        else if (dir.value=="Off" && aldir.value=="Off" && fac.value=="Off" && alfac.value=="Off" && oyb.value=="Checked" && poyb.value=="Off") {
            this.deletePages({nStart:1, nEnd:5})
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
            this.insertPages({nPage:0, cPath:"/Users/MacMike/Desktop/TT Reg & Contracts.pdf", nStart:1, nEnd:5 });
        }
        else if (dir.value=="Off" && aldir.value=="Off" && fac.value=="Off" && alfac.value=="Off" && oyb.value=="Off" && poyb.value=="Checked") {
            this.deletePages({nStart:1, nEnd:5})
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
            this.insertPages({nPage:0, cPath:"/Users/MacMike/Desktop/TT Reg & Contracts.pdf", nStart:1, nEnd:5 });
        }
        else if (dir.value=="Checked" && aldir.value=="Off" && fac.value=="Off" && alfac.value=="Off" && oyb.value=="Checked" && poyb.value=="Off") {
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
        }
        else if (dir.value=="Checked" && aldir.value=="Off" && fac.value=="Off" && alfac.value=="Off" && oyb.value=="Off" && poyb.value=="Checked") {
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
        }
        else if (dir.value=="Off" && aldir.value=="Checked" && fac.value=="Off" && alfac.value=="Off" && oyb.value=="Checked" && poyb.value=="Off") {
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
        }
        else if (dir.value=="Off" && aldir.value=="Checked" && fac.value=="Off" && alfac.value=="Off" && oyb.value=="Off" && poyb.value=="Checked") {
            this.saveAs(outputDir + this.getField("Full Name (First Last)").value + "-" + this.getField("Event Title").value + ".pdf")
        }
    }
    
    // Imports records does the above function then go the next record, all the while doing error reporting.
    while (err == 0) {
        err = this.importTextData(fileName, idx);    // imports the next record
    
        if (err == -1)
            app.alert("Error: Cannot Open File");
        else if (err == -2)
            app.alert("Error: Cannot Load Data");
        else if (err == 1)
            app.alert("Warning: Missing Data");
        else if (err == 2)
            app.alert("Warning: User Cancelled Row Select");
        else if (err == 3)
            app.alert("Warning: User Cancelled File Select");
        else if (err == 0) {
            var dir = this.getField("Associate Director"); // checkbox
            var aldir = this.getField("Alumni Associate Director"); // checkbox
            var fac = this.getField("Facilitator"); // checkbox
            var alfac = this.getField("Alumni Facilitator"); // checkbox
            var oyb = this.getField("Optimize Your Brain Site Coordinator"); //checkbox
            var poyb = this.getField("DVD and Workbook Previously Purchased"); // checkbox
            seekandDestroy(dir, aldir, fac, alfac, oyb, poyb); //performs the above function
            idx++; //goes to next record
        }
    }
    
  • Creation of update and delete triggers

    Hello

    I want to create 'update' and 'delete' a table 'T1_shadow' triggers that

    capture record during delete and Update Table 'T1 '.

    Kindly help

    You can use this:

    If the UPDATE can

    INSERT INTO T1_SHADOW

    values

    ('UPDATE',: old.customer_id,: old.customer_name,: old.city, sysdate, fnd_global.user_id);

    elsif DELETION then

    INSERT INTO T1_SHADOW

    values

    (' DELETE',:old.customer_id,: old.customer_name,: old.city, sysdate, fnd_global.user_id ");

    end if;

    end;

  • I just got DC and cannot not work my PDFs like before as insert and extract ideas what I might be missing

    Anyone know how I can get the old version of acorbat reader rather then MS that I can not understand how to insert and extract a pdf file

    If you could insert and extract pages before, you were not using the free player, you must use Acrobat. Make sure you open your files in Acrobat format (which I hope you have not deleted) and try again.

  • ONLY INSERT OR DELETE THE PRIVILEGE TO THE DATABASE LINK

    Hi all

    Version of DB 11.2.0.1

    RedHat 5.5 operating system

    I created a link to private database by following the path

    create database link test_link

    connect to Scott identified by tiger

    using

    '(DESCRIPTION =)

    (ADDRESS = (PROTOCOL = TCP) (HOST = 10.194.180.45)(PORT = 1521))

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = prod)

    )

    )'

    The link is created successfully and I am able to perform all the DML operations on it.

    The Question is there a way by which we can give only insert or delete or privilege is not to remove from the table at this link.

    For operations select only, I know that by creating a view I can restrict the remote user, but is there a way by which I can give only insert or remove remove link of database.

    You can not grant any privilege to a link. Can you and your team identify a location in the documentation, if required?

    By default, a remote session will get the same privilege as the user to which it connects.

    BTW:

    • do not use a database link tnsnames.ora makes your hard to maintain link
    • using addresses IP hard in a database link makes your link even more difficult to maintain
    • by specifying a hardcoded password in a database link is a breach of security.

    -------------

    Sybrand Bakker

    Senior Oracle DBA

Maybe you are looking for

  • How do I alphabetize my favorites in one list in the bookmarks file?

    I have 40-50 favorite Web sites in my favorites and would like to have a list in alphabetical order from A to Z by organizing these sites of 40-50. How can I do this?

  • HP Envy Rove

    I have a PC desktop to envy of wick. The display shows points as he is affected in several places AGAIN. This happened just as the previous edition of nowhere. It sits right on a table and I bring it with me (don't have also any children that might b

  • Domain Services Active Directory could not create the ntds object due to dns settings look for failure on the specific domain controller

    Forest consist of 1 DC server 2003 with all fsmo and 2000 1 domain controller roles. Completed all questions of adprep and when I tried to promote server 2008 standard edition to a domain controller, had the error message stating that Active Director

  • My games Xp works on Vista?

    I'm an adult old & play on a site that is the largest area FPS TOURNAMENT for BF2... no one does use Vista because of all the probs and we have 1000 members from all over the world. We play at battles of 12 hours each weekend from noon until midnight

  • New area, the new PIP

    Hello all and thanks in advance for any help forthcoming.  This is my fist post so I'll try to be as concise as possible. We have lack of public IP addresses in the range assigned to the WAN.  Our ISP gave us another 29 subnet.  I ran through the ste