ISSUE IN PROCEDURE

1)Here in procedure in insert statement i want to_timestamp with seconds it should come
2)when ever record is deleted from omniaccountlinkage then the tigger is raised and then the deleted record vlues are passed in to procedure here i want to know osuser (select osuser from v$session ) from which os user that particular record is going to get deleted i want to know how can i know this with this procedure (i want to insert this os user also in emailinfo table ) .how cani do this
PROCEDURE:
create or replace procedure test_proc (p_account varchar2,p_mobile_no varchar2,p_account_type varchar2,p_mas varchar2,p_accountstatus varchar2)
is
  v_mobilenumber reg.REGMOBILENO%type;
  v_accountnumber reg.ACCOUNTNO%type;
  PRAGMA AUTONOMOUS_TRANSACTION;
begin
  select ACCOUNTNO
    INTO v_accountnumber
  FROM reg
    where ACCOUNTNO = p_account
    AND rownum < 2;
exception
  WHEN NO_DATA_FOUND THEN
begin
      select REGMOBILENO
    INTO v_mobilenumber
  FROM reg
    where REGMOBILENO = p_mobile_no
    AND rownum < 2;
exception
  WHEN NO_DATA_FOUND THEN
begin
insert into emailinfo(id,message,sent_date,sent,FROMEMAIL,SUBJECT,TOEMAIL)values(emailseq.nextval,p_account||','||p_mobile_no
||','||p_account_type ||','|| p_mas||','|| p_accountstatus,to_timestamp
(sysdate),'N','[email protected]','MMID_ISSUE',nagendrachallaj@gmail
.co.in');   
commit;
end;
end;
end;
/ TRIGGER:
create or replace trigger test after delete on omniaccountlinkagefor each row
call test_proc (:old.accountno,:old.mobileno,:old.ACCOUNTTYPE,:old.MAS,:old.ACCOUNTSTATUS)
/Edited by: BluShadow on 07-Mar-2012 11:36
added {noformat}{noformat} tags for readbility.  Please read {message:id=9360002} and learn to do this yourself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

After reviewing your code I have to confess I have no idea what you are doing ... or why. Here are some examples:
select ACCOUNTNO
INTO v_accountnumberwhere is v_accountnumber used?
where ACCOUNTNO = p_account
AND rownum < 2;how can this query ever return more than one row?
and finally ... what is this doing that could not be done by the trigger itself or with a MERGE statement?

Similar Messages

  • Performance issue in procedure

    Hi All
    i have a performance issue with below procedure it is taking 10-15 hrs .custom table has 2 lacks record .
    PROCEDURE update_summary_dollar_amounts( p_errbuf OUT VARCHAR2
    ,p_retcode OUT NUMBER) IS
    v_customer_id NUMBER := NULL;
    pymt_count NUMBER := 0;
    rec_count NUMBER := 0;
    v_number_late NUMBER;
    v_number_on_time NUMBER;
    v_days_late NUMBER;
    v_avg_elapsed NUMBER;
    v_avg_elapsed_US NUMBER;
    v_percent_prompt NUMBER;
    v_percent_late NUMBER;
    v_number_open NUMBER;
    v_last_payment_amount NUMBER;
    v_last_payment_date DATE;
    v_prev_payment_amount NUMBER;
    v_prev_payment_date DATE;
    v_last_sale_amount NUMBER;
    v_last_sale_date DATE;
    v_mtd_sales NUMBER;
    v_ytd_sales NUMBER;
    v_prev_year_sales NUMBER;
    v_prev_receipt_num VARCHAR2(30);
    v_last_sale VARCHAR2(50);
    c_current_year VARCHAR2(4);
    c_previous_year VARCHAR2(4);
    c_current_month VARCHAR2(8);
    /* ====================================================================== */
    /* CURSOR Customer Cursor (Main Customer) LOOP */
    /* ====================================================================== */
    CURSOR customer_cursor IS
    SELECT cst.customer_id customer_id
    ,cst.customer_number customer_number
    ,cst.org_id org_id
    FROM zz_ar_customer_summary_all cst
    ORDER by cst.customer_id;
    /* ====================================================================== */
    /* CURSOR Payments Cursor LOOP */
    /* Note: This logic is taken from the Customer Credit Snapshot */
    /* Report - ARXCCS */
    /* ====================================================================== */
    CURSOR payments_cursor IS
    SELECT cr.receipt_number receipt_num
    ,NVL(cr.amount,0) amount
    ,crh.gl_date gl_date
    FROM ar_lookups
    ,ar_cash_receipts_all cr
    ,ar_cash_receipt_history_all crh
    ,ar_receivable_applications_all ra
    ,ra_customer_trx_all ct
    WHERE NVL(cr.type,'CASH') = ar_lookups.lookup_code
    AND ar_lookups.lookup_type = 'PAYMENT_CATEGORY_TYPE'
    AND cr.pay_from_customer = v_customer_id
    AND cr.cash_receipt_id = ra.cash_receipt_id
    AND cr.cash_receipt_id = crh.cash_receipt_id
    AND crh.first_posted_record_flag = 'Y'
    AND ra.applied_customer_trx_id = ct.customer_trx_id(+)
    ORDER BY cr.creation_date DESC
    ,cr.cash_receipt_id DESC
    ,ra.creation_date DESC;
    customer_record customer_cursor%rowtype;
    payments_record payments_cursor%rowtype;
    BEGIN
    p_errbuf := NULL;
    p_retcode := 0;
    c_current_year := TO_CHAR(SYSDATE,'YYYY');
    c_current_month := TO_CHAR(SYSDATE,'YYYYMM');
    c_previous_year := TO_CHAR(TO_NUMBER(c_current_year) - 1);
    FOR customer_record IN customer_cursor LOOP
    /* Get Days Late and Average Elapsed Days */
    /* Note: This logic is taken from the Customer Credit Snapshot */
    /* Report - ARXCCS */
    BEGIN
    v_customer_id := customer_record.customer_id;
    BEGIN
    SELECT DECODE(COUNT(cr.deposit_date), 0, 0, ROUND(SUM(cr.deposit_date - ps.trx_date) / COUNT(cr.deposit_date))) avgdays
    ,DECODE(COUNT(cr.deposit_date), 0, 0, ROUND(SUM(cr.deposit_date - ps.due_date) / COUNT(cr.deposit_date))) avgdayslate
    ,NVL(SUM(DECODE(SIGN(cr.deposit_date - ps.due_date),1, 1, 0)), 0) newlate
    ,NVL(SUM( DECODE(SIGN(cr.deposit_date - ps.due_date),1, 0, 1)), 0) newontime
    INTO v_avg_elapsed
    ,v_days_late
    ,v_number_late
    ,v_number_on_time
    FROM ar_receivable_applications_all ra
    ,ar_cash_receipts_all cr
    ,ar_payment_schedules_all ps
    WHERE ra.cash_receipt_id = cr.cash_receipt_id
    AND ra.applied_payment_schedule_id = ps.payment_schedule_id
    AND ps.customer_id = v_customer_id
    AND ra.apply_date BETWEEN ADD_MONTHS(SYSDATE, -12) AND SYSDATE
    AND ra.status = 'APP'
    AND ra.display = 'Y'
    AND NVL(ps.receipt_confirmed_flag,'Y') = 'Y';
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    v_days_late := NULL;
    v_number_late := NULL;
    v_avg_elapsed := NULL;
    v_number_on_time := NULL;
    END;
    IF (v_number_on_time + v_number_late) > 0
    THEN
    v_percent_prompt := ROUND(v_number_on_time/(v_number_on_time + v_number_late),2) * 100;
    v_percent_late := ROUND(v_number_late/(v_number_on_time + v_number_late),2) * 100;
    ELSE
    v_percent_prompt := 0;
    v_percent_late := 0;
    END IF;
    /* C2# 49827 */
    /* Get new average elapsed days for US use only */
    v_avg_elapsed_us := NULL;
    IF NVL(customer_record.org_id,-999) = 114
    THEN
    v_avg_elapsed_us := 0;
    BEGIN
    SELECT ROUND(SUM(NVL(ra.amount_applied,0) * (cr.deposit_date - ps.trx_date)) / DECODE(SUM(NVL(ra.amount_applied,0)),0,1,SUM(NVL(ra.amount_applied,0)))) avg_elapsed_us
    INTO v_avg_elapsed_us
    FROM ar_receivable_applications_all ra
    ,ar_cash_receipts_all cr
    ,ar_payment_schedules_all ps
    WHERE ra.cash_receipt_id = cr.cash_receipt_id
    AND ra.applied_payment_schedule_id = ps.payment_schedule_id
    AND ps.customer_id = v_customer_id
    AND ra.apply_date BETWEEN ADD_MONTHS(SYSDATE, -06) AND SYSDATE
    AND ps.status = 'CL'
    AND ra.status = 'APP'
    AND ra.display = 'Y'
    AND nvl(ps.receipt_confirmed_flag,'Y') = 'Y'
    AND ra.amount_applied <> 0;
    v_avg_elapsed_us := NVL(v_avg_elapsed_us,0);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    v_avg_elapsed_us := NULL;
    END;
    END IF;
    END;
    /* Get MTD, YTD, Prev Year Sales */
    /* Note: This logic is taken from the Customer Credit Snapshot */
    /* Report - ARXCCS */
    BEGIN
    SELECT NVL(SUM(DECODE(TO_CHAR(ps.trx_date,'YYYYMM'),c_current_month,amount_due_original,0)),0) mtd_sales
    ,NVL(SUM(DECODE(TO_CHAR(ps.trx_date,'YYYY'),c_current_year,amount_due_original,0)),0) ytd_sales
    ,NVL(SUM(DECODE(TO_CHAR(ps.trx_date,'YYYY'),c_previous_year,amount_due_original,0)),0) prev_sales
    ,SUM(DECODE(ps.status,'OP',(DECODE(SIGN(amount_due_original),1,1,0)),0)) number_open
    INTO v_mtd_sales
    ,v_ytd_sales
    ,v_prev_year_sales
    ,v_number_open
    FROM ar_payment_schedules_all ps
    WHERE ps.customer_id = v_customer_id
    AND ps.class != 'PMT';
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    v_mtd_sales := NULL;
    v_ytd_sales := NULL;
    v_prev_year_sales := NULL;
    END;
    /* Get Last and Previous Payments */
    pymt_count := 0;
    v_last_payment_date := NULL;
    v_prev_payment_date := NULL;
    v_last_payment_amount := NULL;
    v_prev_payment_amount := NULL;
    v_prev_receipt_num := NULL;
    FOR payments_record IN payments_cursor LOOP
    BEGIN
    IF payments_record.receipt_num = v_prev_receipt_num
    THEN
    NULL;
    ELSIF pymt_count = 0
    THEN
    v_last_payment_date := payments_record.gl_date;
    v_last_payment_amount := payments_record.amount;
    pymt_count := pymt_count +1;
    v_prev_receipt_num := payments_record.receipt_num;
    ELSIF pymt_count = 1
    THEN
    v_prev_payment_date := payments_record.gl_date;
    v_prev_payment_amount := payments_record.amount;
    EXIT;
    ELSE
    EXIT;
    END IF;
    END;
    END LOOP;
    /* Get Last Sale Date and Amount */
    /* Note: This logic is taken from the Customer Credit Snapshot */
    /* Report - ARXCCS */
    BEGIN
    SELECT MAX(TO_CHAR(ct.trx_date,'YYYYDDD')||ps.amount_due_original)
    INTO v_last_sale
    FROM ra_cust_trx_types_all ctt
    ,ar_payment_schedules_all ps
    ,ra_customer_trx_all ct
    WHERE ps.customer_trx_id = ct.customer_trx_id
    AND ct.cust_trx_type_id = ctt.cust_trx_type_id
    AND ct.bill_to_customer_id = v_customer_id
    AND ps.class || '' = 'INV'
    ORDER BY ct.trx_date DESC
    ,ct.customer_trx_id DESC;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    v_last_sale := NULL;
    END;
    IF v_last_sale IS NOT NULL
    THEN
    v_last_sale_date := TO_DATE(SUBSTR(v_last_sale,1,7),'YYYYDDD');
    v_last_sale_amount := SUBSTR(v_last_sale,8,15);
    ELSE
    v_last_sale_date := NULL;
    v_last_sale_amount := NULL;
    END IF;
    /* Update Values into ZZ_AR_CUSTOMER_SUMMARY_ALL */
    BEGIN
    UPDATE zz_ar_customer_summary_all
    SET sales_last_year = v_prev_year_sales
    ,sales_ytd = v_ytd_sales
    ,sales_mtd = v_mtd_sales
    ,last_sale_date = v_last_sale_date
    ,last_sale_amount = v_last_sale_amount
    ,last_payment_date = v_last_payment_date
    ,last_payment_amount = v_last_payment_amount
    ,previous_payment_date = v_prev_payment_date
    ,previous_payment_amount = v_prev_payment_amount
    ,prompt = v_percent_prompt
    ,late = v_percent_late
    ,avg_elapsed_days = v_avg_elapsed
    ,avg_elapsed_days_us = v_avg_elapsed_us -- C2# 49827
    ,days_late = v_days_late
    ,number_open = v_number_open
    WHERE customer_id = customer_record.customer_id;
    EXCEPTION
    WHEN PROGRAM_ERROR THEN NULL;
    WHEN DUP_VAL_ON_INDEX THEN NULL;
    WHEN STORAGE_ERROR THEN NULL;
    WHEN OTHERS THEN NULL;
    END;
    rec_count := rec_count + 1;
    IF rec_count = 10000
    THEN
    COMMIT;
    rec_count := 0;
    fnd_file.put_line(fnd_file.output,'Commit at customer_id = ' || TO_CHAR(customer_record.customer_id) || ' ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS'));
    fnd_file.new_line(fnd_file.output,1);
    END IF;
    END LOOP;
    COMMIT;
    EXCEPTION
    WHEN others THEN
    ROLLBACK;
    p_retcode := 2;
    p_errbuf := SQLERRM;
    END update_summary_dollar_amounts;
    Thanks,
    Anu

    Based on my initial assessment of the code, it looks like you are utilizing the "slow by slow" method. It is often termed "slow by slow" because it is one of the most INefficient ways of doing data processing. The "slow by slow" method uses CURSOR FOR LOOPs to loop through entire record sets and process them one at a time. In your case it looks like you are using NESTED FOR LOOPs which could exacerbate the problem.
    I recommend you re-think your approach and try and do everything in a single, or a few SQL statements if possible and avoid the procedural logic.
    If you can post your business requirements, and sample data we may be able to help you achieve your goal.
    HTH!

  • Issues with procedures on ODI 11g

    Hello Gurus,
    We have an ODI environment, where we have migrated from ODI 10g to ODI 11g (11.1.1.6) using Upgrade Assistant.
    Issue is that, the Procedures in our migrated packages show executed in Operator (by Green tickmark), but they are actually NOT executing the code. Means we are not able to see Code for the procedure steps, when that step is opened from operator. It does not even show Rows updated or other statistics. It shows 0 for all.
    We do not see any error in ODI studio for those steps. Thats why unable to figure out whats happening.
    Note: There is no issue with the SQL code. Its been tested on SQL Server.
    What could be cause behind this ?
    Please help.
    Thanks,
    Santy

    The issue here is that there is Always Execute option which belongs to each procedure. It must be enabled/checked(need to check manually going through each procedure) in order to have the procedure run after migration to 11g. This was not mandatory in 10g & unfortunately, Upgrade Assistant does not take care on this.
    Regards,
    Santy

  • Goods Issue Approval Procedure

    Hi Experts,
    In Document Approval Procedure on Goods Issue Doc. can i make Approval Procedure for a particular G/L Accout.
    i.e. I select an Item  Code for Goods Issue and selected a particular G/L A/c. as  50102001 - Scrap Account then it should forward to Approval otherwise if that A/c. is not selected in Goods Issue form it should Add directly.
    Awaiting for your helpful reply.
    Regards,
    Ravi

    Hi Ravi....
    Approval Procedure is not possible for Row Level Details...
    It is always possible for Document Level data....
    Regards,
    Rahul

  • Issue with procedure

    Hello,
    I get the first DBMS output statement but nothing else. What is the deal?
    create or replace
    PACKAGE BODY XXGHX_SUCESS_FACTORS
    AS
    * TYPE : PACKAGE BODY
    * NAME : XXGHX_SUCESS_FACTORS
    * PURPOSE : To load Performance Review, Element Entry and Salary componet data. The procedure will atuomate a manual process for HR.
    * Author Date Ver Description
    * Kendell Ellington 05/23/2011 1.0 Created
    /************************* Globals *********************************/
    g_user_id NUMBER(15) := fnd_global.user_id;
    PROCEDURE LOAD_SF_DATA(
    retcode OUT NUMBER,
    errbuf OUT VARCHAR2,
    p_business_group_id IN number)
    AS
    -- DEFINE VAB
    x_performance_review_id NUMBER;
    x_object_version_number_PR NUMBER;
    x_next_review_date_warning BOOLEAN;
    v_status_flag VARCHAR2(1);
    v_error_message VARCHAR2(2000);
    x_critical_error EXCEPTION;
    --- Element Entry Variables
    x_eff_start_date_out DATE;
    x_eff_end_date_out DATE;
    x_element_entry_id_out NUMBER;
    x_ele_object_version_number NUMBER;
    x_create_warn_out BOOLEAN;
    x_eff_start_date_out_award DATE;
    x_eff_end_date_out_award DATE;
    x_element_entry_id_out_award NUMBER;
    x_ele_object_version_number_aw NUMBER;
    x_create_warn_out_award BOOLEAN;
    x_element_link_id_mgr NUMBER;
    x_element_link_id_awd NUMBER;
    x_error_text VARCHAR2(100);
    x_input_value_mgr NUMBER;
    x_input_value_award NUMBER;
    -- DEFINE CURSOR
    -- Salary component varibles
    x_element_entry_id NUMBER;
    x_pay_propsal_id NUMBER;
    x_inv_next_sal_date_warning BOOLEAN;
    x_proposed_salary_warning BOOLEAN;
    x_approved_warning BOOLEAN;
    x_payroll_warning BOOLEAN;
    x_proposal_reason VARCHAR2(100);
    x_object_version_number NUMBER;
    v_component_id NUMBER;
    v_object_version_number1 NUMBER;
    x_proposed_salary NUMBER;
    x_input_value_award_date NUMBER;
    x_input_value_paid_date NUMBER;
    CURSOR C_SF_MAIN
    IS
    SELECT paaf.assignment_id,
    paaf.business_group_id,
    papf.person_id,
    xsf.employee_number,
    xsf.ROWID,
    xsf.FULL_NAME,
    xsf.REVIEW_DATE,
    xsf.REVIEW_RATING,
    xsf.EFFECTIVE_DATE,
    xsf.MANAGER_REC_PERCENT,
    xsf.EFFECTIVE_DATE_MERIT,
    xsf.MERIT_PERCENT,
    xsf.EFFECTIVE_DATE_MKT,
    xsf.MARKET_ADJUSTMENT_PERCENT,
    xsf.EFFECTIVE_DATE_PROMO,
    xsf.PROMOTION_PERCENT,
    xsf.EP_EFFECTIVE_DATE,
    xsf.EP_AWARD_DATE,
    xsf.EP_DATE_PAID,
    xsf.EXCEP_PERF_BONUS
    FROM XXGHX_SUCCESS_FACTORS xsf,
    PER_ALL_PEOPLE_F papf,
    per_all_assignments_f paaf
    WHERE xsf.full_name = papf.full_name
    AND papf.person_id = paaf.person_id
    AND sysdate BETWEEN papf.effective_start_date AND papf.effective_end_date
    AND sysdate BETWEEN papf.effective_start_date AND paaf.effective_end_date;
    ---DEFINE CURSOR FOR ERROR REPORTING
    CURSOR c_iface_after
    IS
    SELECT * FROM XXGHX_SUCCESS_FACTORS XXSF WHERE PROCESS_FLAG = 'E';
    -- Counter Initalization
    v_rec_cnt NUMBER := 0;
    v_err_cnt NUMBER := 0;
    v_suc_cnt NUMBER := 0;
    r_gla c_iface_after %rowtype;
    BEGIN
    DBMS_OUTPUT.PUT_LINE('hr_perf_review_api.create_perf_review');
    --Start of Loop
    FOR c_staging IN c_sf_main
    LOOP
    BEGIN
    DBMS_OUTPUT.PUT_LINE('hr_perf_review_api.create_perf_review');
    -- Parameter Init
    x_performance_review_id := NULL;
    x_object_version_number_PR := NULL;
    x_next_review_date_warning := NULL;
    v_error_message := NULL;
    x_eff_start_date_out := NULL;
    x_eff_end_date_out := NULL;
    x_element_entry_id_out := NULL;
    x_ele_object_version_number := NULL;
    x_create_warn_out := NULL;
    x_element_link_id_mgr := NULL;
    x_element_link_id_awd := NULL;
    x_eff_start_date_out_award := NULL;
    x_eff_end_date_out_award := NULL;
    x_element_entry_id_out_award := NULL;
    x_ele_object_version_number_aw:= NULL;
    x_create_warn_out_award := NULL;
    x_element_entry_id := NULL;
    x_pay_propsal_id := NULL;
    x_inv_next_sal_date_warning := NULL;
    x_proposed_salary_warning := NULL;
    x_approved_warning := NULL;
    x_payroll_warning :=NULL;
    x_proposal_reason :=NULL;
    x_object_version_number :=NULL;
    v_component_id :=NULL;
    v_object_version_number1 :=NULL;
    x_proposed_salary :=NULL;
    x_error_text :=NULL;
    x_input_value_mgr :=NULL;
    x_input_value_award :=NULL;
    x_input_value_award_date :=NULL;
    x_input_value_paid_date :=NULL;
    v_rec_cnt := v_rec_cnt + 1;
    SAVEPOINT s1;
    DBMS_OUTPUT.PUT_LINE('hr_perf_review_api.create_perf_review');
    BEGIN
    DBMS_OUTPUT.PUT_LINE('hr_perf_review_api.create_perf_review');
    hr_perf_review_api.create_perf_review ( p_validate => TRUE,
    p_performance_review_id => x_performance_review_id,
    p_person_id => c_staging.PERSON_ID,
    p_event_id => NULL,
    p_review_date =>c_staging.REVIEW_DATE,
    p_performance_rating => c_staging.REVIEW_RATING,
    p_next_perf_review_date => NULL,
    p_attribute_category => NULL,
    p_attribute1 => NULL,
    p_attribute2 => NULL,
    p_attribute3 => NULL,
    p_attribute4 => NULL,
    p_attribute5 => NULL,
    p_attribute6 => NULL,
    p_attribute7 => NULL,
    p_attribute8 => NULL,
    p_attribute9 => NULL,
    p_attribute10 => NULL,
    p_attribute11 => NULL,
    p_attribute12 => NULL,
    p_attribute13 => NULL,
    p_attribute14 => NULL,
    p_attribute15 => NULL,
    p_attribute16 => NULL,
    p_attribute17 => NULL,
    p_attribute18 => NULL,
    p_attribute19 => NULL,
    p_attribute20 => NULL,
    p_attribute21 => NULL,
    p_attribute22 => NULL,
    p_attribute23 => NULL,
    p_attribute24 => NULL,
    p_attribute25 => NULL,
    p_attribute26 => NULL,
    p_attribute27 => NULL,
    p_attribute28 => NULL,
    p_attribute29 => NULL,
    p_attribute30 => NULL,
    p_object_version_number => x_object_version_number_PR,
    p_next_review_date_warning => x_next_review_date_warning);
    DBMS_OUTPUT.PUT_LINE('record created for : ' ||c_staging.person_id|| 'ID '|| x_performance_review_id);
    EXCEPTION
    WHEN OTHERS THEN
    --ROLLBACK TO s1;
    v_error_message := ' Error in hr_perf_review_api.insert_perf_review ' || SUBSTR(sqlerrm, 1, 2000);
    DBMS_OUTPUT.PUT_LINE('Error occurred : ' || v_error_message);
    RAISE x_critical_error;
    END;
    -- If an error has occurred then put 'E' in status flag and insert error message into table.
    ----------End of Profromance review processing
    if v_error_message is NULL THEN
    UPDATE XXGHX_SUCCESS_FACTORS
    SET process_flag = 'S',
    LAST_UPDATED_BY = fnd_global.user_id,
    LAST_UPDATE_DATE = sysdate,
    ERROR_MESSAGE = SUBSTR(v_error_message, 1, 2000)
    WHERE rowid = c_staging.rowid;
    v_suc_cnt := v_suc_cnt + 1;
    COMMIT;
    end if;
    -- If an error has occurred then put 'E' in status flag and insert error message into table.
    EXCEPTION
    WHEN x_critical_error THEN
    ROLLBACK TO s1;
    UPDATE XXGHX_SUCCESS_FACTORS
    SET process_flag = 'E',
    LAST_UPDATED_BY = fnd_global.user_id,
    LAST_UPDATE_DATE = sysdate,
    ERROR_MESSAGE = SUBSTR(v_error_message, 1, 2000)
    WHERE rowid = c_staging.rowid;
    v_err_cnt := v_err_cnt + 1;
    COMMIT;
    END;
    END LOOP;
    -- Display summary report for
    fnd_file.PUT_LINE(fnd_file.OUTPUT, ' Success Factors Load Program Summary');
    fnd_file.PUT_LINE(fnd_file.OUTPUT, '');
    fnd_file.PUT_LINE(fnd_file.OUTPUT, '*************************************************************************************** ');
    fnd_file.PUT_LINE(fnd_file.OUTPUT, 'The Number of total records process is : ' || v_rec_cnt);
    fnd_file.PUT_LINE(fnd_file.OUTPUT, 'The Number of error records is : ' || v_err_cnt);
    fnd_file.PUT_LINE(fnd_file.OUTPUT, 'The Number of successful records is : ' || v_suc_cnt);
    fnd_file.PUT_LINE(fnd_file.OUTPUT, '***************************************************************************************** ');
    fnd_file.PUT_LINE(fnd_file.OUTPUT, '');
    fnd_file.PUT_LINE(fnd_file.OUTPUT, '');
    fnd_file.PUT_LINE(fnd_file.OUTPUT, '');
    fnd_file.PUT_LINE(fnd_file.OUTPUT, '***************************************************************************************** ');
    fnd_file.PUT_LINE(fnd_file.OUTPUT, ' Below is a list of records that erorred and why :');
    fnd_file.PUT_LINE(fnd_file.OUTPUT, '***************************************************************************************** ');
    fnd_file.PUT_LINE(fnd_file.OUTPUT, 'Employee Number Error message ');
    FOR r_gla IN c_iface_after
    LOOP
    BEGIN
    fnd_file.PUT_LINE(fnd_file.OUTPUT, r_gla.employee_number||' '||r_gla.error_message); -- Waiting for employee ID or some kind of ID for the file.
    END;
    END LOOP;
    fnd_file.PUT_LINE(fnd_file.OUTPUT, '***************************************************************************************** ');
    IF v_err_cnt > 0 THEN
    ROLLBACK;
    errbuf := 'Errors have occured!';
    retcode := -2;
    ELSE
    errbuf := ' ';
    retcode := 0;
    END IF;
    END LOAD_SF_DATA;
    END XXGHX_SUCESS_FACTORS;

    If your cursor c_sf_main is not finding any data, you will not enter loop, and the other print statements will not be reached. Check your SQL statement.
    Your query appears to be an eBS query - be sure that your context is set appropriately, sometimes data is not returned (even if it exists) if you're environment is not right.

  • Strange Output issue of Procedure

    Hi,
    I have a Procedure with Two Out parameter of table type. I am using DB Adapter to fetch these two out parameter. One out is for Header rows and other out is for detail rows. The strange thing is that when I test this composite using SOA server i only get data from header table but no data from detail table. My Procedure is fine when i run in SQL developer. It gives data for both tables. One another thing that i already created same composite for two other master and detail tables and that is working really fine. I tried every trick but could not get any success in this composite. Kindly help me to point out any error.
    Thanks a lot
    Nasir

    Thanks Vijay for respond..
    I am not using any transformation or Mapping. I configured a DB Adapter first. Then make a BPEL Process having input and output according to DB Adapter XSD file. then i just invoked and copied the output of procedure to output of payload.
    Thanks
    Nasir

  • Migration Issues--Stored Procedure

    Hi,
    After migrating sql server procedures into oracle using SQL DEVELOPER tool, I observed following things.
    In sql server procedure was having follo. syntax at the end to denote its completion
    select "ENDED dbo.s_p_fund_aff_ins_pers_seq_no : " , getdate()
    return
    This got converted into following,
    OPEN cv_2 FOR
    SELECT 'ENDED dbo.s_p_fund_aff_ins_pers_seq_no : ',
    SYSDATE
    FROM DUAL WHERE ROWNUM <= 1;
    RETURN;
    cv_2 is IN OUT SYS_REFCURSOR.
    My question is
    1) Is it ok to keep the converted code as it is?
    2) Do I need to close the cursor?

    It's all to do with scope - when a cursor* goes out of scope, then it will be closed automatically. So, your cursors defined within a procedure will automatically close when you exit that procedure and therefore you don't need to explicitly close them.
    Ref cursors have scope outside the procedure / package though, so they must be closed explicitly when the process that's using them no longer needs them. (That's how I think of it, anyway!)
    Edited by: Boneist on 07-Apr-2009 11:40
    * actually, this applies to other things, such as variables, parameters, etc; once they've gone out of scope, they are trashed as they can't be accessed any more.

  • Issues handling procedure

    Hi friends,
    Can anybody tell me how the issues or tickets are handled with an appropriate example or scenario in any specfic module.
    plz let me also know if there is any site helpful in that regard.
    Thanks & Regards
    Sai

    Hi,
    Based on the priority High, Medium, Low, the issue has to be closed within a certain period of time.
    That means, we have to solve the issue within the stipulated time.
    Good Luck
    Om
    Reward points, if u feel helpful.

  • S10-3S: BIOS Update issue - Recovery procedure possible ?

    Dear all,
    yesterday i flash the new Bios  "LM30_0128 / 38CN11WW" into my S10-3S (Memory compatibility Bios)
    under Windows 7-Home 32Bit.
    The Bios routine runs and after a while, the Ideapad booting self. But now, i only see a black screen after
    PowerSwitch on. No Bios beep. No Infos. Nothing ! Only the 3left LEDs are white ! The Screen is death !
    So i research the Lenovo Forums about to fixing this.
    I found a lot of Informations about the BIOS Recovery Procedure and try different versions about that.
    I create the "Crisis" Emergency Floppy /USB Stick with the Files inside the "LM30_0128.exe". No Problems !
    I try USB Floppy and USB Stick but nothing happens if i press the different Keyboard Combinations:
    FN+F, FN+R, FN+ESC, FN+B, Windows+F, Windows+R, Windows+ESC, Windows+B . No access
    to floppy or USB Stick ! No Boot Process. Nothing !
    Knows anybody the Keyboard Code to go inside the Bios Recovery Process ?
    Thanks you very much
    SkyHawk

    Hi did you try this from  Ideapad Knowledge Base ...
    if that doesnt help , please give a bit time , so we can look for a solution in case of bricked s10-3s..
    Meanwhile dont update to new BIOS for S10-3s.
    if isnt clear whats going on with S10-3s.
    Sorry for this awkwardness 
    sincerely KalvinKlein
    Thinkies 2x X200s/X301 8GB 256GB SSD @ Win 7 64
    Ideas Centre A520 ,Yoga 2 256GB SSD,Yoga 2 tablet @ Win 8.1

  • LaTeX - package gensymb issue: control procedures not being defined?!

    I want to use the gensymb package in my LaTeX file. Most commands work fine, but for the following two I get an error:
    Package gensymb Warning: Not defining \perthousand.
    Package gensymb Warning: Not defining \micro.
    For me this is rather bad as I want to use \micro :
    ! Undefined control sequence.
    l.109 In \micro
    the first part of the experimant the experimental setup was
    What shall I do?

    bender02 wrote:
    Well, let me tell you how did I find it (I don't use that package at all):
    I went to CTAN, looked for that package, downloaded the .zip, unpacked. With most packages, you end up with a bunch of files, the important ones have suffix .ins and .dtx (eg. gensymb.dtx and gensymb.ins). Gensymb.dtx is the "source", which contains both the style file and the documentation. To get a .sty file out of it, you can run "latex gensymb.ins" (as in 'ins'tall), and it should load gensymb.dtx and produce at least gensymb.sty - that's the file you include in your latex files. Now to get documentation, just process the file gensymb.dtx itself with latex, and you end up with a .dvi.
    All in all, I just looked at that gensymb.dvi and it was there.
    Sometimes packages have an extra manual with them, you just need to look at the unzipped stuff from CTAN.
    After installing gensymb at the appropiate places a "texdoc gensymb" opens the documentation.

  • MM-SUS Scenario - Issue in vendor replication

    Hi Gurus,
    We are implementing MM-SUS scenario on SRM 7.0 interacting with a system R/3 4.6C and NW PI 7.0.
    Now we are workking on the vendor replication from R/3 by mean tx BD14. So we performed all neccesary configuration and functional steps on R/3 system and on SRM to be able to execute BD14
    After execution we obtain messages about succesfully IDoc creation for vendor data transmission and we see in tx WE02 that everything was OK, current status=03 (data passed to port OK).
    But when we login on SRM, we dont' found the correspondent business partner in tx. BP and neither his connection with central vendor group in tx PPOMV_BBP and user/password generation to be sended by automatic email to supplier.
    Can anybody help me with this issue?.Thanks in advance.
    Regards,
    Horacio

    Hi,
    We have been investigated the issue and for some similar issues the procedure to
    delete the entried in VENMAP table and after to do the replication again
    have solved the issue.
    The steps to delete the entry from VENMAP:
    - Goto to transaction SE16
    - Open 'VENMAP' table
    - Type in the vendor number under 'VENDOR_NO' field, which you
       need to delete.
    - Select the record and open in display mode (or just double
       click on the record)
    - In the 'Table VENMAP Display' screen, on the transaction bar,
       type '/h' and press enter.
    - Click on the screen and press enter.
    - You will be in the debug mode. Change the 'code' value to 'DELE'.
    - Press F8 and execute the program. Now you will find a 'Delete Entry'
       button.
    - Click on the 'Delete Entry' button and remove the entry from VENMAP.
    Once this is done, run BBPGETVD transaction and unset 'Address
    Comparison to Identify Duplicates'.
    We can do other test, Would it be possible to you enter the supplier
    data to the BUT000 table manually for the currupted business Partener ?
    Partner GUID, Partner can be taken from the VENMAP table.
    Please test both procedure and update me if it solve the issue for
    the Partner.
    Please check the note 548862 FAQ: EBP user administration, topics 2
    and 3 about how you can check all EBP users and about BUP_BUPA_DELETE.
    We hope this information can help you.
    Kind Regards,
    Edel.

  • Create Procedure - How to Detect Compilation Errors

    Hi,
    I am working on an application where users will be able to type in their own stored procedures. I perform some basic parsing of the function spec, to make sure it is well-formed, but that's all the parsing I do. I assumed an SQLException would be thrown by the executeUpdate() call which creates the procedure if the procedure is malformed. This is not the case. executeUpdate() returns 0, whether or not the procedure was created with compilation errors.
    After they type it in, I would like to be able to tell the user whether or not their procedure is syntactically correct. Given that writing a complete PL/SQL parser in Java is obviously out of the question, how can I do this? There must be a way.
    Thanks in advance for any and all help,
    James

    Note that there is a USER_ERRORS table.
    You could DELETE FROM USER_ERRORS before issuing the procedure declaration and then SELECT ... FROM USER_ERRORS to see if errors have occured and if so to print them out.

  • How to execute private procedures in a package

    Hi
    I have created private procedures in a package.
    now i want to execute the private procedure. how to execute the private one

    Hi;
    Pelase see below which could be helpful for your issue:
    Private procedures in a package
    http://stackoverflow.com/questions/924490/how-do-i-execute-private-procedures-in-an-oracle-package
    Regard
    Helios

  • The procedure entry point EncodePointer could not be located in dynamic link library KERNEL32.dll

    Every time I open a program to update to service pack 1 I get the following message. (The procedure entry point EncodePointer could not be located in dynamic link library KERNEL32.dll)
    Any sugestions?

    I cannot download microsoft security essentials onto my computer because I received this error message, "he procedure entry point EncodePointer could not be located in the dynamic link library KERNEL32.dll."  Can you help me correct this problem?
    Hi Nick1943,
    Welcome to MSDN forum.
    Please check the workarounds in the following links to fix this issue:
    The
    Procedure entry point EncodePointer could not be located in the dynamic link library KERNAL32.dll
    ErrMsg: Procedure Entry Point Could Not Be Located
    Targeting Windows XP with C++ in Visual Studio 2012
    By the way,this forum is mainly to discuss and ask questions about
    Visual Studio Extensibility (VSX), using the Extension Manager, building VSIX containers for deployment, the Visual Studio SDK, Text Templates (T4), add-ins, macros, and more.
    I will move this peoblem to Off Topic.
    Thanks for your understanding.
    Best Regards,
    Jane.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • A Procedure doesn't update some rows in pre-prod while it does in dev box.

    Hi All,
    There are some data rows in a master table STG_CON in both environments(DEV and PRE_PROD). Making changes to any of these rows should be reflected in the CON table after the procedure is run, however it only seems to work reliably in DEV, but failes to update some rows in PRE-PROD.
    Our oracle stored procedure: USP_APPLY_CON which we have to deploy over production, but before that, I am afraid, it should not fail to update some rows in CON table alike pre-prod.
    Please suggest what could be problem, why all rows are getting updated in DEV but fails in PRE-PROD, though everything looks same.

    Here is my procedure: USP_APPLY_CONTACT, which should insert the data from STG_CONTACT to CONTACT table, all required columns are present in CONTACT table. Please have a look over it, I don't guess there is any issue with procedure.
    CREATE OR REPLACE PROCEDURE "COPILOTFIREPR2_ADMIN"."USP_APPLY_CONTACT" AS
    -- This stored procedure is used to copy data from staging table to "contact" ta
    ble.
    -- Update if record exists, insert otherwise.
    -- When error occurs, record get throw away.
    BEGIN
    DECLARE CURSOR cur IS
    SELECT *
    FROM stg_CONTACT;
    rcdcnt NUMBER(10, 0) := 0;
    errMsg varchar2(255);
    BEGIN
    FOR rec IN cur
    LOOP
    SELECT COUNT(*)
    INTO rcdcnt
    FROM CONTACT
    WHERE CONTACTNO = rec.CONTACTNO;
    BEGIN
    IF rcdcnt = 0 THEN
    INSERT INTO CONTACT (
    ID, LOCATIONCODE, CONTRACTNO, CUSTOMERNO, CONTACTNO,
    FIRSTNAME, LASTNAME, TITLE, ADDRESSID, DECISIONMAKER, PRCCONTACT, ACTIVE)
    VALUES (CONTACT_ID_SEQ.NextVal, rec.LOCATIONCODE,
    rec.CONTRACTNO,
    rec.CUSTOMERNO,
    rec.CONTACTNO,
    rec.FIRSTNAME,
    rec.LASTNAME,
    rec.TITLE,
    rec.ADDRESSID,
    rec.DECISIONMAKER,
    rec.PRCCONTACT,
    rec.active);
    ELSE
    UPDATE CONTACT SET
    ACTIVE=rec.active, FIRSTNAME=rec.FIRSTNAME, LASTNAME=rec.LASTNAME, TITLE=rec.TI
    TLE, ADDRESSID=rec.ADDRESSID,
    DECISIONMAKER=rec.DECISIONMAKER, PRCCONTACT=rec.PRCCONTACT, LOCATIONCODE=rec.LO
    CATIONCODE,
    CONTRACTNO=rec.CONTRACTNO, CUSTOMERNO=rec.CUSTOMERNO
    WHERE CONTACTNO=rec.CONTACTNO;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    errMsg := SQLERRM;
    insert into errorlog("ID", "USERNAME", "APPDOMAIN", "MESSAGE", "FORMATTEDMESSAG
    E", "EXCEPTIONTYPE", "SERVERNAME" )
    values ( ERRORLOG_ID_SEQ.NEXTVAL, 'COPILOTFIRE_ADMIN.USP_APPLY_CONTACT', 2,
    'KEY is '||to_char(rec.CONTACTNO), errMsg, '','');
    END;
    END LOOP;
    END;

Maybe you are looking for

  • Why doesnt my app store work

    my app store isnt working i've reset my phone so many times. i cant download or update apps im so frustrated and tired of this! somebody please help me

  • Passing a list into a sql procedure via a unix shell.

    9.2.0.6 for some dumb reason we cannot use java to do this task. anyways I need to build a list of all file in a particular directory. The list could be zero to very very long. I would like to be able to pass that list to a PL/SQL procedure. this is

  • Need answer for this thread

    I have a standard report.. RM06BA00 when i run this report it is runing properly, the fileds are displaying properly My requirment  is when i run a new zreport based on that old report... I have created a zreport... I need to get a additional field "

  • Gmail won't open since I updated firefox-gmail says bouser my be problem

    firefox said I needed to upgrade for security reasons ..and it would cause problems with Realplayer ...and it would come out with a fix...so I updated firefox sure enough it messed up Realplayer ..but it also messed up my gmail ..it will not load and

  • Calling one WAD Report from another WAD Report

    Hi All,           I want to Call one WAD report from another WAD Report and I want to show that Report in a Container of the Calling Report Itself. Kindly give the Solution. Thanks for your support in advance. Thanks & Regards Shiva