PL/SQL procedure for deleting rows

We have to delete rows from a table by initiating parallel processes depending on no of connections, and also variable commit frequency. The procedure has to start by itself in case of failure of 1 or more parallel processes, by identifying the position where it stopped. Please some one help me what would be th elogic needed to write the [rocedure.
Thanks in Advance
Edited by: 864979 on Jun 9, 2011 10:02 PM

Be careful of how this is designed and coded. It is very easy to do it horribly wrong, causing contention and problems.
Have a look at DBMS_PARALLE_EXECUTE.
If the package is not available on your Oracle version, then look at {message:id=1534900} for a manual approach.

Similar Messages

  • Better approach for deleting rows using trigger or procedure

    Hi,
    Please suggest which option is better for deleting rows from table trigger or procedure and why?
    In datawarehousing and OLTP DB's.
    Edited by: user6040008 on Nov 2, 2012 4:51 AM

    Hi,
    Please suggest which option is better for deleting rows from table trigger or procedure and why?
    In datawarehousing and OLTP DB's.
    Edited by: user6040008 on Nov 2, 2012 4:51 AM

  • Procedure for deleting a role which is already in Production

    Hi,
    can any one explain me the procedure for deleting a role which is already in production
    i want to know procedure for deletion of
    1.single role
    2.composite role
    3.derived role
    4.parent role
    thanks,
    SSSS

    Hi,
    Role deletion must be done in development box and the deletion must be transported to quality and productuion
    For single and derrived roles create the transport request and delete the role and transport the deletion.
    For Deletion of parent role: you cannot delete the parent role unless all the derrived roles within it are deleted.
    To avoid the transport of user assignment make sure PRGN_CUST is set to 'NO' value for the parameter USER_REL_IMPORT.
    Rakesh

  • What is the keyboard shortcut for "delete row" in a table?

    What is the keyboard shortcut for "delete row" in a table within a pages document?

    Click on the row number to select the entire row. Right-click, and select Delete Row from the menu. There is no keyboard shortcut.

  • Calling a stored procedure for each row returned

    I need to call a stored procedure for each row returned by a repeating frame. I called the stored procedure from the repeating frame format trigger, but that did not work( it did no populated the tables populated by the stored procedure)
    How can I call a stored procedure for each row returned by a repeating frame.
    Thank you

    Include it as a formula column in your data model.

  • Writing a store procedure  for deleting records

    how can i write a store procedure for deleting records from a table.
    i have a table called employees
    empid
    empname
    deptid
    and table department
    deptid
    dept
    floor
    how can i write a store procedure which would delete records of employees from employees table for particular department when i delete that department from department table.
    thanks

    872959 wrote:
    how can i write a store procedure for deleting records from a table.
    i have a table called employees
    empid
    empname
    deptid
    and table department
    deptid
    dept
    floor
    how can i write a store procedure which would delete records of employees from employees table for particular department when i delete that department from department table.
    thanksDoes not seem to be a sound design, to me.
    Employees do not go missing when organization change is made & department is eliminated.
    If you insist such nonsense, write TRIGGER to issue desired DML

  • Need to wite pl sql procedure for dynamic select statement

    Need pl sql procedure for a Dynamic select statement which will drop tables older than 45 days
    select 'Drop table'||' ' ||STG_TBL_NAME||'_DTL_STG;' from IG_SESSION_LOG where substr(DTTM_STAMP, 1, 9) < current_date - 45 and INTF_STATUS=0 order by DTTM_STAMP desc;

    I used this to subtract any data older than 2 years, adjustments can be made so that it fits for forty five days, you can see how I changed it from the originaln dd-mon-yyyy to a "monyy", this way it doesn't become confused with the Static data in the in Oracle, and call back to the previous year when unnecessary:
    TO_NUMBER(TO_CHAR(A.MV_DATE,'YYMM')) >= TO_NUMBER(TO_CHAR(SYSDATE - 365, 'YYMM'))

  • [Excel] Running a SQL Query to delete rows

    Hello Experts,
    Background: I am attempting to use a dba of my companies time keeping system and implement it with Power BI tools. Given the file size restrictions within Power Bi itself I need to lower my file size by removing all time logs from
    inactive employees.
    I have a question regarding whether or not you can use a sql query to delete rows in excel. I have roughly 200,000+ rows in my excel spreadsheet. I am attempting to delete all rows where an employee equals inactive. I have attempted to
    delete these rows by sorting them and doing a bulk delete and clear contents, but it seems to crash my excel every time.  My thought process is that using a query that does a timed delete might put less of a burden on deleting the massive amount of data.
    I would like to use this: DELETE * FROM [Table_(...)_Actual$] WHERE [Current] = "Inactive" (Will add more once I know it is possible to use sql queries in Excel.
    Any information on whether or not this is possible would be appreciated.
    Regards,
    Link

    Running SQL Query in Excel is possible, however, the delete query is not supported in Excel.
    You are more restricted in deleting Excel data than   data from a relational data source. In a relational database, "row" has no   meaning or existence apart from "record"; in an Excel worksheet, this is not   true. You can delete values
    in fields (cells). Please see:http://support.microsoft.com/kb/257819/en-us
    One workaround : Use update query to set the rows as null, then use select query.
    e.g. 
    SQL = "update [sheet2$A1:B5] set name=null,age=null where name='andy'"
    cnn.Execute SQL
    SQL = "select name,age from [sheet2$A1:B5] where name is not null"
    Wind Zhang
    TechNet Community Support

  • Using cron-job to call the PL/SQL procedure for every 5 min

    Hi All,
    i wrote one procedure. using cron-job to call this PL/SQL procedure for every 5 min. i don't have any idea about cron job & what is thescript file formate .where can i place that script file. what are the details we placed in that script

    Really appreciate you. I like this approach .
    please give me advice for the below thing
    job_action =>an i give my procedure name under this?
    BEGIN
    -- Job defined entirely by the CREATE JOB procedure.
    DBMS_SCHEDULER.create_job (
    job_name => 'Job_schedule_update',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN Schedule_update; END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'FREQ=HOURLY;BYMINUTE=5',
    end_date => NULL,
    enabled => TRUE,
    comments => 'Job defined entirely by the CREATE JOB procedure.');
    END;

  • SQL Procedures for dimension maintenance?

    I can't seem to find any stored procedures for refreshing dimensions & measures in 10.2. Looking at version 10.1 of the OLAP reference lists procedures such as:
    execute dbms_awm.refresh_awdimension ('MYSCHEMA', 'MYAW', 'AW_PROD');Is there an equivalent in 10.2.0.3? The OLAP reference docs have changed quite significantly from 10.1 to 10.2, so I'd assume so too has the database and the methods it uses to refresh structure. Docs for 10.2 don't appear to mention refreshing structure anywhere.
    Can anyone point me in the right direction? We're essentially looking for the same functionality as is provided in AWM's Maintain Dimension/Measure wizards, only called from our own application.
    Thanks,
    Aaron

    Hi,
    Have you tried having AWM creating a maintenance script for you?
    In the end of the maintenance wizard theres an option for selecting "create to script" or something similar.
    This will generate an anonymous PL/SQL block you can put into whatever procedure or application you want as long as it can run PL/SQL.
    Ragnar

  • SQL Command for deleting T-Code for roles

    Hi Experts
    I want to delete the transaction from the role name by using SQL Command in MS-SQL Server  instead of going to /npfcg -> zwa_xyz (role name for user) and transaction code is CR01,CR01,CA01 Etc.,
    I have so many transaction code which is taking time to delete one by one.
    So is there any SQL Statement to delete the t-code for that rolename
    Delete from tablename where t-code=xyz and rolename in ('zwa_xyz',zwa_123')
    regards

    Hey,
    SAP does not support executing update/insert/delete SQLs on their tables,
    (the only SQL they support are select, and updates that they publish in their official site, such as notes in service.sap.com/notes)
    is is probably due to the fact that sap contains about 30,000 of table,
    and sometimes SAP uses cluster tables (which are difficult to handle in DB)
    in addition, each and every SP adds/remove table or changes existing tables.
    For example, you probably don't know that changing rule, would
    create a change document (cluster table - CDHDR, CDPOS and etc),
    If you want, it is very easy to get the full list of the table (and the sql) that are updated
    (as I mentioned before, it is not recommended to run this sql, because it is not supported!!!)
    just run transaction ST05 while deleting transaction from role,
    when you display the list, press shift+F8 (or summerized trace from the menu),
    and they search (Ctrl+F) the words: update or insert or delete.
    You can use standard API such as BAPIs (such as BAPI_USER_*)/IDOCs(such as USERCHANGE),
    and execute them from the portal and any other place (even in EXCEL or OS->meaning command line).
    Here more information on executing RFCs:
    1. in order to execute an RFC from excel, you should install SAP gui on the client that would execute the RFCs to the SAP, and you would have to write VBA code.
    2. in order to execute an RFC from command line, this is a little bit more difficult,
    sap provide RFC sdk (in service.sap.com/SWDC)
    3. in order to execute an RFC from .net you can use the .net connector,
    more information is here:
    NW RFC SDK - is there a guide somewhere?
    4. You can also, execute an RFC using Web service,
    by creating web-service from the RFC in SE37.
    I guess It will take more time to develop this they just executing the SQL.
    If you need more information in executing an RFC,
    please decide which option is your favorite,
    and I would add information...

  • Query for deleting rows older than 25?

    Am trying to delete rows older than 25... How would the query for this be like? I tried this "DELETE FROM DB LIMIT 25,100" But getting errors...

    what is older than 25? Does it mean with id greater then 25?
    then you should have a query like
    DELETE FROM tableName WHERE id > 25

  • Procedure for inserting rows

    dear members,
    i have a table with some missing numbers in a col1.
    how can i add rows containing missing numbers.
    starting and ending number is given in the procedure.
    let us say starting from 1 to 10.
    table
    id col1
    1 2
    2 3
    3 4
    4 9
    Required Result after running the procedure.
    table
    id col1
    1 2
    2 3
    3 4
    4 9
    5 1
    6 5
    7 6
    8 7
    9 8
    10 10
    can i have that procedure.
    regards
    teefu.
    Edited by: user_teefu on Aug 23, 2010 2:19 PM

    Hi,
    I would do something like that :create or replace procedure t_addrows(
            p_min integer,
            p_max integer)
    as
            l_inserted integer;
    begin
            insert into t (id, col1)
            select
                    idstart+rownum id,
                    col1
            from (
                    select idstart, p_min+level-1 as col1
                    from (
                            select nvl(max(id),0) idstart
                            from t
                    connect by level <= p_max-p_min+1
            ) n    
            where not exists (
                    select null
                    from t
                    where t.col1=n.col1
            l_inserted := SQL%ROWCOUNT;
            dbms_output.put_line('inserted : '||l_inserted);
    end;
    /It gets the max(id) from the table to generate "following" ids.
    it uses the connect by level to generate integers between min and max parameters provided.
    it does a NOT EXISTS to avoid primary key errors.
    Example :Scott@my10g SQL>select * from t;
            ID       COL1
             1          2
             2          3
             3          4
             4          9
    Scott@my10g SQL>begin
      2  t_addrows(1,10);
      3  end;
      4  /
    inserted : 6
    PL/SQL procedure successfully completed.
    Scott@my10g SQL>select * from t;
            ID       COL1
             1          2
             2          3
             3          4
             4          9
             5          5
             6          8
             7          1
             8         10
             9          6
            10          7
    10 rows selected.
    NB :_ I didn't include a COMMIT in the procedure. You decide wheither it should be there or not.

  • Can't catch the matrix row for Deleting Rows

    Hi,
    I've already read related topics but couldn't solve the problem.
    I catch the Delete Row menu event 1293, but then I can't save the deleted row in an array since it's no longer listed as a selected row.
    All the matrix rows return
    oMatrix.IsRowSelected(i) = False after catching that 1293 event.  
    Trying BeforeAction True or false didn't solve that problem.
    What am I missing ?

    it sounds like a bug.
    here is workaround: in oMatrix-itempress event try to store selected rowIndex in your variable - so, when you catch 1293-menuEvent you'll know which row you should save - it'll be value of your variable.

  • Update button in sql report for each row can only get the report value

    I have to added Update for each row of records like:
    select a.*,'Update' button from (
    select c.*,d.login from country c,champ d
    where c.champ_id=d.champ_id(+)
    order by c.name) a
    then go to the report->edit button ->Column Link
    I added some items P40_REGION, P40_CHAMPID,P40_ACTIVE,P40_CODE and assign the value like #region#,#active# ,#code# to these item, but when I click the update button in the report I found the values such as #region#,#active# ,#code# is the report value not the select list selected value(the region, active column are displayed as select list lov).
    Can anyone tell me how to sort this knid of problem?
    Thanks a lot!

    Sorry, it doesn't work. I also tried apex_application.g_f01(i), but not everytime I can get the value or get the incorrect value. If you have time you can try to create it like what I have described. Our team use two days now but still can not sort this problem.

Maybe you are looking for

  • Using iWeb to develop a existing Domain name and linking to non .Mac hosts

    I am new to iWeb [disclaimer]. I already have a business .com domain name as well as a host already. How can I post my iWeb generated webpages to this non .Mac site?? Thanks in advance GBI

  • Some games in pogo will not fully load

    certain games look like they are loading but then the game screen will not come up but yet i can play some games i have look at every thing and not sure how to fix it

  • Demand Planning : Event import

    Hello, Is-it possible to import Events through interface into Demand Planning ? In MSD scheme, there are some staging tables for Events, but I found no documentation on how to fill these tables (MSD_ST_EVENTS ...). Thanks in advance.

  • Photo editor 4.0 (3.1.A.0.46) update, different than in my z3c

    anybody tried to install it? what happen, will there be 2 photo editor? my current photo editor version is 23.0.1.A.0.1, and when i opened the file, it asks to install as new app, instead of an upgrade

  • Unmapped GL Group

    Hi, I am running the ZFRP report for Cost Center 14230000 / Profit Center 4230. However,  the output shows some amount under head "<Un-mapped FRP GL Group Credit>"...... I checked the FSV in OB58......it is correct. How is it that certain expenses re