Note that there are some explanatory texts on larger screens.

plurals
  1. POoracle date conversion error
    primarykey
    data
    text
    <p>I get an error when the input for iv_from_date is given in this format 04/01/2013,it works perfectly when the input is in this format 04/Jan/2013.the nls date format is DD-MON_RR.My input should be in this format 04/01/2013.How do i do this</p> <pre><code>CREATE OR REPLACE procedure Sp_SaveNewTaxPercentage(iv_category_id number, iv_tax_percentage number, iv_from_date varchar2, iv_to_date varchar2 default '12/31/9998', iv_created_date date, ov_err_code out nocopy varchar2, ov_err_msg out nocopy varchar2) is lv_category_id varchar2(25); LV_TO_DATE varchar2(25); lv_cat_id varchar2(12); IV_TAX_ID VARCHAR2(12); lv_tax_percentage varchar(20); begin ov_err_code := 0; SELECT MAX(TAX_ID) INTO IV_TAX_ID FROM TAX_P WHERE CATEGORY_ID IN (iv_category_id); for J in (SELECT CATEGORY_ID, FROM_DATE, tax_percentage FROM TAX_P WHERE TAX_ID = IV_TAX_ID) loop SELECT to_date(iv_from_date, 'dd/mm/yyyy') - 1 INTO LV_TO_DATE FROM DUAL; lv_cat_id := J.CATEGORY_ID; lv_tax_percentage := j.tax_percentage; begin UPDATE TAX_P SET TO_dATE = LV_TO_DATE WHERE TAX_PERCENTAGE = lv_tax_percentage and to_date = iv_to_date; commit; insert into tax_p (TAX_ID, CATEGORY_ID, TAX_PERCENTAGE, FROM_DATE, TO_DATE, CREATE_DATE) values (tax_seq.nextval, iv_category_id, to_char(iv_tax_percentage, '99D99'), iv_from_date, iv_to_Date, sysdate); commit; end; end loop; IF LV_CAT_ID IS NULL THEN insert into tax_p (TAX_ID, CATEGORY_ID, TAX_PERCENTAGE, FROM_DATE, TO_DATE, CREATE_DATE) values (tax_seq.nextval, iv_category_id, to_char(iv_tax_percentage, '99D99'), iv_from_date, IV_TO_DATE, sysdate); END IF; commit; select 'Successfully Saved' into ov_err_msg from dual; commit; Exception when others then rollback; ov_err_code := 1; ov_err_msg := 'Error while saving' || SQLERRM; end Sp_SaveNewTaxPercentage; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload