Automatic Procedure execution

Hi All,
I have following two questions. Can anyone help us please?
1. Unlike Unix Cron job(which starts automatically at the specified time), is there any way I can have certain stored procedure executed automatically within Oracle server? Also if any failures in the execution(exceptions) I wold like to be notified by an email?
2. If i have a Oracle DB account as scott/tiger@TEST and has a stored procedure with the name TEST_PROC(i_date date), how can I have this procedure called within a UNIX cron entry so that it gets executed at the specified date and time?
Early reply...(as usual but it really will be highly appriciated since its somthing in production)..
cheers
sandeep

Hi Sandeep
Here is an example for sending email. Include this code in the exception handling part of your proc.
DECLARE
c utl_smtp.connection;
PROCEDURE header(name IN VARCHAR2, header IN VARCHAR2) AS
BEGIN
utl_smtp.write_data(c, name || ': ' || header || utl_tcp.CRLF);
END;
BEGIN
c := utl_smtp.open_connection('www.oracle.com');
utl_smtp.helo(c, 'us.oracle.com');
utl_smtp.mail(c, '[email protected]');
utl_smtp.rcpt(c, '[email protected]');
utl_smtp.open_data(c);
header('From', '"Diwakar Sharma" <[email protected]>');
header('To', '"Sandeep" <[email protected]>');
header('Subject', 'Hello');
utl_smtp.write_data(c, utl_tcp.crlf || 'Hello,' || utl_tcp.CRLF ||
utl_tcp.CRLF ||
'This is a test message.' || utl_tcp.CRLF || 'Diwakar');
utl_smtp.close_data(c);
utl_smtp.quit(c);
END;
Hope this helps
Diwakar

Similar Messages

  • Function and procedure execution

    hi all,
    i have question in procedure execution and function execution oracle database.
    i want know that which is faster in execution procedure or function.
    can i see the time taken by procedure and select query
    i want to see only time not cpu cost or anything else.
    i am waiting for your responses...

    There is no difference in cost between whether something is a function or a procedure.
    The decision making should reflect usage only. For example you can not use a procedure in SQL.
    If you wish to break things down further focus on 10046 and 10053 tracing.
    Seeing time only is roughly equivalent to cutting off all of your fingers to see how something feels to your thumb.
    Timing is only one very small part of what you should be watching.

  • Disable text while procedure execution

    Hi,
    oracle9i
    How to disable the below text while procedure execution ?
    old  15: Procedure_name(&var1);
    new  15: Procedure_name(&var2);
    Regards

    Use SET VERIFY OFF.
    It won't make any difference in the output that you get, but its just for you to see which variable is getting replaced by which value.

  • How can i check the procedure execution time..?

    Hi All,
    Can any one of you tell me how can i check the procedure execution time..?
    Thanks in advance.

    if running it from SQL*Plus,
    SQL> set timing on
    Or from PL/SQL, use DBMS_UTILITY.GET_TIME before and after the call and calclate the difference.

  • Automatic program execution in the destination system.

    SAP allows to include "special objects" into a transport
    request which cause automatic program execution in the destinationsystem.
    Can anybody let me know how can I do that?

    Hi,
    Do you mean installing/executing some program automatically
    on user machine i.e. presentation system.
    If yes, then following link will help you, see last section Installing the control
    in which one setup file which is already uploaded to SAP Web Repository is downloded to presentation system and then executed on user machine to install the program.
    Using .Net Windows Controls in the ABAP Control Framework
    Regards,
    Vishal

  • Please help me how to maintain log for procedure execution

    Hi Experts,
    How to maintain the log for procedure execution
    I want to maintain the log for procedures as below.
    Once the procedure starts it should show status as RUNNING and PROC_END_TIME should be NULL.
    Once the procedure completes it should show status as COMPLETED and shold show the PROC_END_TIME.
    Once the MAIN_PROC completes then only the status of that procedure should show COMPLETED.
    STEP_ID RECORDS_INS_UPD  RECORDS_DELETED PROC_NAME PROC_START_TIME                PROC_END_TIME              JOB_STATUS ERROR_MSG
    1 500             0  MAIN_PROC 1/4/2014 5:47:38.000000 AM                         RUNNING
    2 100             0  SUB_PROC1 1/4/2014 5:49:30.000000 AM                         RUNNING
    3  0             0  SUB_PROC2 1/4/2014 5:47:38.000000 AM 1/4/2014 5:47:38.000000 AM COMPLETED
    I have tried the below code but it's not working properly.
    CREATE OR REPLACE PROCEDURE procedures_log
       p_seq                NUMBER,
       p_rec_ins_upd        NUMBER,
       p_rec_deleted        NUMBER,
       p_proc_name          VARCHAR2,
       p_start_time         TIMESTAMP,
       p_end_time           TIMESTAMP,
       p_job_status         VARCHAR2,
       p_error_msg          VARCHAR2
    IS
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
        IF p_seq = 0 THEN
            INSERT INTO proc_log
                STEP_ID,
                ORG_ID,
                TABLENAME,
                RECORDS_INS_UPD,
                RECORDS_DELETED,
                JOB_NAME,
                PROC_NAME,
                JOB_START_TIME,
                JOB_END_TIME,
                JOB_STATUS,
                ERROR_MSG
            VALUES
                p_seq,
                p_rec_ins_upd,
                p_rec_deleted,
                p_proc_name,
                p_start_time,
                p_end_time,
                p_job_status,
                p_error_msg
        ELSE
            UPDATE proc_log
            SET
                RECORDS_INS_UPD = p_rec_ins_upd,
                RECORDS_DELETED = p_rec_deleted,
                JOB_END_TIME = p_end_time,
                JOB_STATUS = p_job_status,
                STEP_ID = p_seq,
                ERROR_MSG = p_error_msg
            WHERE UPPER(TRIM(PROC_NAME)) = UPPER(TRIM(p_proc_name))
            AND STEP_ID = 0
            AND JOB_STATUS = 'RUNNING';
        END IF;
        COMMIT;
        EXCEPTION
            WHEN OTHERS
            THEN NULL;
    END;
    Please help me.
    Thanks.

    ramya_162 wrote:
    Hi,
    I don't want to maintain multiple records for one procedure.
    The log table will grow huge.
    Please help me.
    Thanks.
    You have two options.
    Either a running log, from which you periodically delete old records, or maintain a standing record  for each process you are tracking.
    Ok, let's take the second, since that seems to be your preferred method.
    Going back to your original post, you gave us code and said "I have tried the below code but it's not working properly."
    Please define "not working".  That statement is totally devoid of actionable or diagnostic information. 

  • Pricing procedure execution...

    Hi Folks,
    How SAP reads the pricing procedure..
    Example
    Con.Type      Requirement        Routine
    ZSAA            601                     901
    ZSAB            602                     902
    Doubt 1: -Is system reads this pricing procedure line by line or coulmn by column?, In the debug we noticed it goes column by colmun? why?
    Doubt 2: - I want to know the value found for ZSAA during the execution of 602 requirement. Example scenario is if ZSAA is more than 100$ don't execute ZSAB.

    Pricing Procedure:
    Determination of Pricing Procedure:
    In SD, Pricing Procedure is determined based on Sales Area (Sales Organization + Distribution Centre + Division) + Customer Pricing Procedure + Document Pricing Procedure through T.Code: OVKK. Sales Area is determined in Sales Order Header Level. Customer Pricing Procedure is determined from Customer Master. Document Pricing Procedure is determined from Sales Document Type / Billing Type (if configured). Once the pricing procedure is determined, Condition records are fetched. If appropriate condition records are found, the price is determined. If Mandatory pricing condition is missing, system will through an error message.
    Configuration of Pricing Procedure:
    Step 1:
    Condition table (T.Code: V/04): If existing condition table meets the requirement, we need not create a new condition table. Considering the requirement for new condition table, the configuration will be done in spro as follows: IMG --> Sales & Distribution --> Basic Function --> Pricing Control --> Condition Table (select the required fields combination, which will store condition record).
    Step 2:
    Access Sequence (T.Code: V/07): If existing access sequence meets the requirement, we need not create a new access sequence. Considering the requirement for new sequence, the configuration will be done in spro as follows: IMG --> Sales & Distribution --> Basic Function --> Pricing Control --> Access Sequence (Access sequence is made up of Accesses (Tables) & the order of priority in which it is to be accessed. Here we assign the condition table to access sequence.
    Step 3:
    Condition Type (T.Code: V/06): If existing condition type meets the requirement, we need not create a new condition type. Considering the requirement for new condition type, the configuration will be done in spro as follows: IMG --> Sales & Distribution --> Basic Function --> Pricing Control --> Condition Type. It is always recommended to copy an existing similar condition type & make the neccessary changes. Here we assign Access sequence to Condition type.
    Step 4:
    a. Pricing Procedure (T.Code: V/08):  It is recommended to copy a similar pricing procedure & make the neccesary changes in new pricing procedure. Pricing Procedure is a set of condition type & arranged in the sequence in which it has to perform the calculation. Considering the requirement for new Pricing Procedure, the configuration will be done in spro as follows: IMG --> Sales & Distribution --> Basic Function --> Pricing Control --> Pricing Procedure --> Maintain Pricing Procedure.
    b. Pricing Procedure (T.Code: VOK0): After maintaining the pricing procedure the next step will be determination of pricing procedure. Configuration for determining pricing procedure in SPRO is as follows: IMG --> Sales & Distribution --> Basic Function --> Pricing Control --> Pricing Procedure --> Determine Pricing Procedure.
    5. Condition record (T.Code: VK11 / VK12): Condition record is a master data, which is required to be maintained by Core team / person responsible from the client. During new implementation, the condition records can be uploaded using tools like SCAT, LSMW, etc. Condition Record is maintained in T.Code: VK11 / VK12, which are captured in Sales Order & Billing.
    Also check document pricing procedure in Sales Document Type (T.Code: VOV8 - Sales order Type, VOFA: Billing Type (If Required)), customer pricing procedure in Customer Master Data (T.Code: XD02), ... are in place.
    Regards,
    Rajesh Banka
    Reward suitable points.

  • Procedure execution time difference in Oacle 9i and Oracle 10g

    Hi,
    My procedure is taking time on
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 is 14 min.
    same procedure is taking time on oracle Release 9.2.0.1.0 is 1 min.
    1) Data is same in both environment.
    2) Number of records are same 485 rows for cursor select statement.
    3)Please guide me how to reduce the time in oracle 10g for procedure?
    i have checked the explain plan for that cursor query it is different in both enviroment.
    so i have analysis that procedure is taking time on cursor fetch into statement in oracle 10g.
    example:-
    create or replace procedure myproc
    CURSOR cur_list
    IS select num
    from tbl
    where exist(select.......
    EXECUTE IMMEDIATE 'ALTER SESSION SET SQL_TRACE = TRUE';
    EXECUTE IMMEDIATE 'ALTER SESSION SET TIMED_STATISTICS = TRUE';
    OPEN cur_list;
    LOOP
    FETCH cur_list INTO cur_list; -----My procedure is taking time in this statement only for some list number. there are 485 list number.
    end loop;
    TRACE file for oracle 10g is look like this:-
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.37 0.46 0 2 0 0
    Fetch 486 747.07 730.14 1340 56500700 0 485
    total 488 747.45 730.60 1340 56500702 0 485
    ORACLE 9i EXPLAIN PLAN FOR cursor query:-
    Plan
    SELECT STATEMENT CHOOSECost: 2 Bytes: 144 Cardinality: 12                                         
         18 INDEX RANGE SCAN UNIQUE LISL.LISL_LIST_PK Cost: 2 Bytes: 144 Cardinality: 12                                    
              17 UNION-ALL                               
                   2 FILTER                          
                        1 TABLE ACCESS FULL SLD.P Cost: 12 Bytes: 36 Cardinality: 1                     
                   16 NESTED LOOPS Cost: 171 Bytes: 141 Cardinality: 1                          
                        11 NESTED LOOPS Cost: 169 Bytes: 94 Cardinality: 1                     
                             8 NESTED LOOPS Cost: 168 Bytes: 78 Cardinality: 1                
                                  6 NESTED LOOPS Cost: 168 Bytes: 62 Cardinality: 1           
                                       4 TABLE ACCESS BY INDEX ROWID SLD.L Cost: 168 Bytes: 49 Cardinality: 1      
                                            3 INDEX RANGE SCAN UNIQUE SLD.PK_L Cost: 162 Cardinality: 9
                                       5 INDEX UNIQUE SCAN UNIQUE SLD.SYS_C0025717 Bytes: 45,760 Cardinality: 3,520      
                                  7 INDEX UNIQUE SCAN UNIQUE SLD.PRP Bytes: 63,904 Cardinality: 3,994           
                             10 TABLE ACCESS BY INDEX ROWID SLD.P Cost: 1 Bytes: 10,480 Cardinality: 655                
                                  9 INDEX UNIQUE SCAN UNIQUE SLD.PK_P Cardinality: 9           
                        15 TABLE ACCESS BY INDEX ROWID SLD.GRP_E Cost: 2 Bytes: 9,447 Cardinality: 201                     
                             14 INDEX UNIQUE SCAN UNIQUE SLD.PRP_E Cost: 1 Cardinality: 29                
                                  13 TABLE ACCESS BY INDEX ROWID SLD.E Cost: 2 Bytes: 16 Cardinality: 1           
                                       12 INDEX UNIQUE SCAN UNIQUE SLD.SYS_C0025717 Cost: 1 Cardinality: 14,078      
    ORACLE 10G EXPLAIN PLAN FOR cursor query:-                                   
         SELECT STATEMENT ALL_ROWSCost: 206,103 Bytes: 12 Cardinality: 1                                         
         18 FILTER                                    
              1 INDEX FAST FULL SCAN INDEX (UNIQUE) LISL.LISL_LIST_PK Cost: 2 Bytes: 8,232 Cardinality: 686                               
              17 UNION-ALL                               
                   3 FILTER                          
                        2 TABLE ACCESS FULL TABLE SLD.P Cost: 26 Bytes: 72 Cardinality: 2                     
                   16 NESTED LOOPS Cost: 574 Bytes: 157 Cardinality: 1                          
                        14 NESTED LOOPS Cost: 574 Bytes: 141 Cardinality: 1                     
                             12 NESTED LOOPS Cost: 574 Bytes: 128 Cardinality: 1                
                                  9 NESTED LOOPS Cost: 573 Bytes: 112 Cardinality: 1           
                                       6 HASH JOIN RIGHT SEMI Cost: 563 Bytes: 315 Cardinality: 5      
                                            4 TABLE ACCESS FULL TABLE SLD.E Cost: 80 Bytes: 223,120 Cardinality: 13,945
                                            5 TABLE ACCESS FULL TABLE SLD.GRP_E Cost: 481 Bytes: 3,238,582 Cardinality: 68,906
                                       8 TABLE ACCESS BY INDEX ROWID TABLE SLD.L Cost: 2 Bytes: 49 Cardinality: 1      
                                            7 INDEX UNIQUE SCAN INDEX (UNIQUE) SLD.PK_L Cost: 1 Cardinality: 1
                                  11 TABLE ACCESS BY INDEX ROWID TABLE SLD.P Cost: 1 Bytes: 16 Cardinality: 1           
                                       10 INDEX UNIQUE SCAN INDEX (UNIQUE) SLD.PK_P Cost: 0 Cardinality: 1      
                             13 INDEX UNIQUE SCAN INDEX (UNIQUE) SLD.SYS_C0011870 Cost: 0 Bytes: 13 Cardinality: 1                
                        15 INDEX UNIQUE SCAN INDEX (UNIQUE) SLD.PRP Cost: 0 Bytes: 16 Cardinality: 1      
    so Please guide me how to reduce the time in oracle 10g for procedure?
    1) Is this envrionment setting parameter?
    2) I have to tune the query? but which is executing fine on oracle 9i?
    so how to decrease the execution time?
    Thanks in advance.

    SELECT l_nr
    FROM x.ls b
    WHERE b.cd = '01'
    AND b.co_code = '001'
    AND EXISTS (
    SELECT T_L
    FROM g.C
    WHERE C_cd = '01'
    AND C_co_code = '001'
    AND C_flg = 'A'
    AND C_eff_dt <= sysdate
    AND C_end_dt >=
    sysdate
    AND C_type_code <> 1
    AND C_type_code <> 1
    AND targt_ls_type = 'C'
    AND T_L <> 9999
    AND T_L = b.l_nr
    UNION ALL
    SELECT l.T_L
    FROM g.C C,
    g.ep_e B,
    g.ep ep,
    g.e A,
    g.lk_in l
    WHERE l.cd = '01'
    AND l.co_code = '001'
    AND l.cd = C.C_cd
    AND l.co_code = C.C_co_code
    AND l.C_nbr = C.C_nbr
    AND l.targt_ls_type = 'C'
    AND lk_in_eff_dt <=
    sysdate
    AND lk_in_end_dt >=
    ( sysdate
    + 1
    AND ( (logic_delte_flg = '0')
    OR ( logic_delte_flg IN ('1', '3')
    AND lk_in_eff_dt <> lk_in_end_dt
    AND l.cd = ep.C_cd
    AND l.co_code = ep.C_co_code
    AND l.C_nbr = ep.C_nbr
    AND l.ep_nbr = ep.ep_nbr
    AND l.cd = A.e_cd
    AND l.co_code = A.e_co_code
    AND l.e_nbr = A.e_nbr
    AND l.cd = B.cd
    AND l.co_code = B.co_code
    AND l.C_nbr = B.C_nbr
    AND l.ep_nbr = B.ep_nbr
    AND l.e_nbr = B.e_nbr
    AND l.ep_e_rev_nbr = B.ep_e_rev_nbr
    AND B.flg = 'A'
    AND EXISTS (
    SELECT A.e_nbr
    FROM g.e A
    WHERE A.e_cd = B.cd
    AND A.e_co_code = B.co_code
    AND A.e_nbr = B.e_nbr
    AND A.e_type_code ^= 8)
    AND C_type_code <> 10
    AND C.C_type_code <> 13
    AND l.T_L = b.l_nr)
    --yes index is same                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to know child procedure Execution time with in parent procedure

    Hi Team,
    I've a requirement in which I need to get the execution time of a child procedure while its running in a parent procedure in PLSQL. While the child process is running, I want to know its execution time so that if it execution time exceeds more than 5 seconds than I want to through an error. Please let me know by what means this can be achieved in plsql.
    Regards,
    Tech D.

    TechD wrote:
    Hi Team,
    I've a requirement in which I need to get the execution time of a child procedure while its running in a parent procedure in PLSQL. While the child process is running, I want to know its execution time so that if it execution time exceeds more than 5 seconds than I want to through an error. Please let me know by what means this can be achieved in plsql.
    Regards,
    Tech D.PL/SQL is NOT a Real Time programming language.
    The procedure that invokes the child procedure is effectively dormant while the child runs.
    Plus there is no easy way to know when 5 seconds has elapsed.

  • Measure procedure execution time..

    Hi,
    Is there any possibility to measure how long each of a procedure in database take?? Is that possible for Oracle's V$ views or by performance report like AWR? On the other hand, is that possible to measure execution time for SQL statements, but without using "set timing on".
    Best,
    tutus

    This is just an add-on to Satish's reply. You may want to chck this link to see how Profiler works,
    http://www.oracle-base.com/articles/9i/DBMS_PROFILER.php
    HTH
    Aman....

  • Recurring Doc Posting Procedure & Execution

    Hi Experts,
    Kindly inform the Procedure for Recurring Doc Posting  & Execution ( Is helpful in real time)
    Thk & Reg
    Vasu

    Hi,
    There are following steps for recurring entry posting
    1. Create Recurring Document in FBD1 and can display document in FBD3
    2. Create Posting documents from recurring document F.14
    3. Run Batch input session in SM35
    You can see accounting document in log.
    if helpful, Please assign points.
    For any query Please let me know.
    Regards
    Pawan Gupta

  • Resume procedure execution after Exception Handler

    Hi -- Can anyone tell me how to resume execution of my procedure if and when I fall into the Exception Handler?
    I'm in a for/loop and i want to move to the next record after falling into the exception handler.
    Thanks,
    ~Christine

    It's just a scoping issue...
    BEGIN
        FOR r IN ( SELECT ... FROM whatever ) LOOP
           BEGIN
               --  do stuff
           EXCEPTION
                 WHEN others THEN
                      log_error(SQLERRM);
           END;
         END LOOP;
    END;
    /If you're using BULK processing you may want to check out %BULK_EXCEPTIONS.
    Cheers, APC

  • Long procedure execution time

    Hello,
    I hav a procedure which consists of select and insert statements(includes Union, Minus, DataType conversions etc.). Three tables of around 27 fields each, are involved in procedure. Table has around 87-90 lakhs of records. This procedure is taking around 7-8 hours for execution.
    There is another almost exactly same procedure with tables of almost same fields, takes less than 5 minutes for execution. How can I optimize the previous procedure so that execution time is reduced.
    Thanks.

    Table has around 87-90 lakhs of records. 1 lakh is 100,000 records.
    How can I optimize the previous procedure so that execution time is reduced.Without even knowing how the procedure looks, we can't comment or even able to help you. Apart from the number of columns and rows, we don't have any other information regarding your procedure or data or index.
    Please elaborate so that anyone can help you.
    Cheers
    Sarma.

  • SQL stored procedure execution takes 5x as long using PS 3.0

    I have a stored procedure that populates some reporting table, does not return any results, and is very expensive.  However it completes in 5 minutes when executed using SSMS.  When the same stored procedure is executed though PS 3.0 it runs in
    almost 25 minutes.  The condensed code is shown below.  The $Connection is defined elsewhere and is already open at this point.
    $Command = New-Object Data.OleDb.OleDbCommand
    $Command.CommandTimeout = 600
    $Command.CommandText = "dbo.usp_extract_exact_target_user @in_all_flg = 1"
    $Command.Connection = $Connection
    $Command.ExecuteNonQuery()
    Can anyone tell me where I'm going wrong, or what could be causing the 5x execution times?
    Thanks in advance for help; you can offer.

    Not Powershell.  Powershell does nothing but hand the command to the database server.
    Why are you using OldDB? You should be using the SQLClient.
    system.data.sqlclient.sqlconnection
    system.data.sqlclient.sqlcommand
    Everything else should be the same.
    You should also prep and bind your arguments.
    ¯\_(ツ)_/¯

  • Procedure execution error

    Hi ,
    The below procedure giving execution error When pass pv_lsrc,ctry and tbl_name input parameters ,the procedure will delete records from recpective table
    Ex:If pv_lsrc=BIT
    ctry=IND
    tbl_name =XX1
    It will delete records from xx1 ,If pass yy1 as table ,it will delete records from yy1.
    create or replace procedure p1( pv_lsrc in varchar2,ctry in varchar2,tbl_name in varchar2)
    v_tbl_name varchar2(20)"=' '
    v_cnt number(7):=0;
    v_tot number(7):=0;
    cursor c1 is select rowid from xx1 where src=pv_lsrc;
    cursor c2 is select rowid from yy1 where src=pv_lsrc;
    begin
    if(v_tbl_name=tbl_name) then
    for rec in c1 loop
    delete from xx1 where rowid=rec.rowid;
    v_tot:=v_tot+1;
    v_cnt:=v_cnt+1;
    if mod(v_cnt,5000)=0 then --commit for every 5000 records
    commit;
    dbms_output.put_line('Total records deleted from xx1:'||v_tot||' and commted');
    elsif
    delete from yy1 where rowid=rec.rowid;
    v_tot:=v_tot+1;
    v_cnt:=v_cnt+1;
    if mod(v_cnt,5000)=0 then --commit for every 5000 records
    end loop;
    commit;
    dbms_output.put_line('Total records deleted from yy1:'||v_tot||' and commted');
    end if;
    end;
    Thanksinadvance
    MR

    I was getting the below error when executing the below procedure
    LINE/COL ERROR
    18/1 PLS-00103: Encountered the symbol "DELETE" when expecting one of
    the following:
    ( - + case mod new not null <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    19/1 PLS-00103: Encountered the symbol "V_TOT"
    19/15 PLS-00103: Encountered the symbol ";" when expecting one of the
    LINE/COL ERROR
    following:
    ) , * & = - + < / > at in is mod not rem <an exponent (**)>
    <> or != or ~= >= <= <> and or like between ||
    22/1 PLS-00103: Encountered the symbol "END" when expecting one of the
    following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge
    LINE/COL ERROR
    <a single-quoted SQL string> pipe
    create or replace procedure p1( pv_lsrc in varchar2,ctry
    in varchar2,tbl_name in varchar2) IS
    v_tbl_name varchar2(20):=' ';
    v_cnt number(7):=0;
    v_tot number(7):=0;
    cursor c1 is select rowid from xx1 where src=pv_lsrc;
    cursor c2 is select rowid from yy1 where src=pv_lsrc;
    begin
    if(v_tbl_name=tbl_name) then
    for rec in c1 loop
    delete xx1 where rowid=rec.rowid;
    v_tot:=v_tot+1;
    v_cnt:=v_cnt+1;
    if mod(v_cnt,5000)=0 then --commit for every 5000 records
    commit;
    dbms_output.put_line('Total records deleted from xx1:'||v_tot||' and commted');
    elsif
    delete yy1 where rowid=rec.rowid;
    v_tot:=v_tot+1;
    v_cnt:=v_cnt+1;
    if mod(v_cnt,5000)=0 then --commit for every 5000 records
    end loop;
    commit;
    dbms_output.put_line('Total records deleted from yy1:'||v_tot||' and commted');
    end if;
    end;

Maybe you are looking for

  • How to configure release procedure for rate contracts release

    Dear all, How to configure release procedure for rate  contract following are the requirements they are two release codes c1 & c2 <=100000,>=100000                 if  c1 is not there c2 has to be approved      Change in the value of the rate contrac

  • How to reduce size of image while uploading it in livecycle pdf.

    Hi, I have created a pdf with Image field using live cycle designer. I have selected "Sizing: Scale Image to fit Rectangle". Now the problem is the pdf which i have created is 1.5MB and if i import or upload a 2.5MB image in image field then the size

  • Can't see folder in Dreamweaver

    Hi, I've got a site that was developed in Dreamweaver using templates.  Those pages based off the templates are edited by users using Contribute.  Things have been going smoothly for months.  They are still working, however a sub-folder in the site d

  • KONDP-PACKNR to be passed in PACKKP-POBJID

    I need to select data from PACKKP by passing the value of KONDP-PACKNR (Packking Instruction) into PACKKP-POBJID (Packing Object). But because these are 2 different data types, (PACKNR is 22 char and POBJID is 20 char), I thought matching the first 2

  • RFC, IDOC, ALE, BAPI

    HI everybody, anybody can tell me 1.what is RFC and its use? 2.What is IDOC and its purpose? 3.What ie ALE and BAPI? please tell me their functions. points will be rewared.