ORA-01843 when db nls_date_format=MM/DD/YYYY
RMAN> backup recovery files;
Generates errors:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_SBT_TAPE_1 channel at 01/27/2009 17:01:52
ORA-01843: not a valid month
In the db the nls_date_format=MM/DD/YYYY
What is causing this error? How do I fix it?
Is there some way to override the nls_date_format during the rman backup?
Hi,
Most of the times this happens when the date and the month value are interchanged for a date field.
Looks like there is some kind of conflict with the date format in your rman session.
As an example:
<sql 'alter session set nls_date_format="DD-MON-YYYY:HH24:MI:SS" ';> will set the date format in rman.
(Out of experience I have seen that a difference between the database character set and the NLS_LANG value of os user could cause undesired date formats.)
Regards,
Tycho
Similar Messages
-
Ora-01843 when Form is based on procedure
I create a page using form based on procedure option. I have a date picker item in the form that corresponds to a date parameter in the procedure.
I select every date format APEX provided from APEX date picker and always got ora-01843(not a valid month) error when I tried to sumbit the form.
I have changed PICK_DATE_FORMAT_MASK to DD/MM/YYYY at application level but cannot solve the problem.
Does anyone using a "Form on Procedure" and happen to have a date column? Do you have similar problem?
ps. this problem only occurs to "Form on Procedure". I have no problem with master details or many other form options. I am using APEX 3.1.Hello user3003555,
I have created forms based on procedure and used date pickers on them but don't recall encountering the date format error ORA-1843. I used "Date Picker (DD-MON-YYYY)" which corresponds to my application date format. I'm not sure what else I can tell you. Have you tried picking a date where the month and day are interchangeable to confirm that it is a formatting issue?
- Alwyn -
ORA-01843 and ORA-02291 when installing AIA 2.0 on Linux server
Hello,
When installing AIA 2.0 on a RHEL 4.7 Linux server, even if OUI does say the installion is successful, the installActions log are not that good...
We've got some ORA-01843 and ORA-02291 errors when running the createDiagnosticsCAVSData.sql.
[exec] createBSRIntegScenarioTables:
[exec] [echo] ----Creating createCAVSTables--------------
[exec] [sql] Executing resource: /exec/applis/tbaia/products/AIA/seeddata/DatabaseObjects/createBSRIntegScenarioTables.sql
[exec] [sql] 152 of 152 SQL statements executed successfully
[exec]
[exec] createDiagnosticsCAVSData:
[exec] [echo] ----Creating createCAVSTables--------------
[exec] [sql] Executing resource: /exec/applis/tbaia/products/AIA/seeddata/DatabaseObjects/createDiagnosticsCAVSData.sql
[exec] [sql] Failed to execute: Insert into CAVS_DEFINITIONS (DEFINITION_ID,TYPE,DESCRIPTION,STATE,SERVICE_TYPE,URL_WSDL,URL_ENDPOINT,SOAP_ACTION,SOAP_TRANSPORT_TYPE,MESSAGE_REQUEST,MESSAGE_RESPONSE,DELAY,VERSION,PROJECT_NAME,PROJECT_VERSION,EBS_NAME,EBS_VERSION,PROCESS_NAME,PROCESS_VERSION,SERVICE_NAME,SERVICE_VERSION,MESSAGE_NAME,MESSAGE_VERSION,PIP_NAME,PIP_VERSION,APPLICATION_NAME,APPLICATION_VERSION,TEST_PRIORITY,REFERENCE_ID_EXTERNAL,AUDITED_ON,AUDITED_BY) values (501,'Test','BPEL Transformation Diagnostics','Unlocked','Synchronous',null,'http://dvedvb40:7777/orabpel/default/AIADiagnosticsTransformBpelProcess/1.0','process','HTTP','<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body xmlns:ns1="http://xmlns.oracle.com/BRM/schemas/BusinessOpcodes"> <ns1:PCM_OP_BILL_DEBIT_inputFlist> <ns1:BAL_GRP_OBJ>Test</ns1:BAL_GRP_OBJ> <ns1:DEBIT elem="523"> <ns1:BAL_OPERAND>1000</ns1:BAL_OPERAND> <ns1:TYPE>881</ns1:TYPE> </ns1:DEBIT> <ns1:DESCR>Sample Input</ns1:DESCR> <ns1:END_T>2007-07-31T12:00:00.000+5:30</ns1:END_T> <ns1:POID>A123</ns1:POID> <ns1:PROGRAM_NAME>100</ns1:PROGRAM_NAME> <ns1:SERVICE_OBJ>NA</ns1:SERVICE_OBJ> <ns1:SESSION_OBJ>NA</ns1:SESSION_OBJ> <ns1:START_T>2007-07-31T11:00:00.000+5:30</ns1:START_T> <ns1:STR_VERSION>527</ns1:STR_VERSION> <ns1:STRING_ID>528</ns1:STRING_ID> <ns1:SUB_BALANCES elem="530"> <ns1:CONTRIBUTOR_STR>Diagnostics</ns1:CONTRIBUTOR_STR> <ns1:ROLLOVER_DATA>1</ns1:ROLLOVER_DATA> <ns1:VALID_FROM>2007-07-31T11:00:00.000+5:30</ns1:VALID_FROM> <ns1:VALID_TO>2007-07-31T11:00:00.000+5:30</ns1:VALID_TO> </ns1:SUB_BALANCES> </ns1:PCM_OP_BILL_DEBIT_inputFlist> </soap:Body> </soap:Envelope>','<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Header/> <env:Body> <PCM_OP_BILL_DEBIT_outputFlist xmlns:ns0="http://xmlns.oracle.com/BRM/schemas/BusinessOpcodes" xmlns="http://xmlns.oracle.com/BRM/schemas/BusinessOpcodes"> <ns0:POID>Transformed POID value : A123</ns0:POID> <ns0:RESULTS elem="Transformed Element value : 523"/> </PCM_OP_BILL_DEBIT_outputFlist> </env:Body> </env:Envelope>',null,0,null,null,null,null,'Diagnostics Transformation',null,'DiagTransformationBPEL','1.0',null,null,'AIA Diagnostics',null,null,null,null,null,to_date('01-OCT-07','DD-MON-RR'),'oc4jadmin')
[exec] [sql] java.sql.SQLException: ORA-01843: not a valid month
[exec] [sql] Failed to execute: Insert into CAVS_DEFINITION_NSXPATHS (DEFINITION_ID,NAMESPACE_ALIAS,NAMESPACE) values (501,'env','http://schemas.xmlsoap.org/soap/envelope/')
[exec] [sql] java.sql.SQLException: ORA-02291: integrity constraint (AIA.DEFINITION_NSXPATHS_D_FK) violated - parent key not found
[exec] [sql] *1 of 43 SQL statements executed successfully*
Any advice to solve this issue?
Thanks in advance.
Regards,
K.
Edited by: KaRiNe_Fr on 3 juin 2009 01:55 createDiagnosticsCAVSData.sql instead of createBSRIntegScenarioTables.sql...Hello,
me again...
Is this table CAVS_DEFINITIONS important to be populated for the rest of the AIA installation?
The installation keeps on failing and it is a real issue for us...
If of any use, here are some results from SQL requests onto our AIA database:
SQL> SELECT * FROM NLS_DATABASE_PARAMETERS ;
PARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET WE8ISO8859P15
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD.MM.YYYY
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
PARAMETER VALUE
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 10.2.0.4.0
20 rows selected.
SQL> select to_date('01-OCT-07','DD-MON-RR') from dual;
TO_DATE('
01-OCT-07
Regards,
KaRiNe.
Edited by: KaRiNe_Fr on 3 juin 2009 01:59 -
FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED UNHANDLED EXCEPTION ORA-01843
Hi everyone
When I run My form in Microsoft Windows Melinem , and I have Button on the form WHEN I press the button it works fine ,but when I run the same form in Microsoft Windows XP and WHEN I press the button it give this message :
FRM-40735
WHEN-BUTTON-PRESSED TRIGGER RAISED UNHANDLED EXCEPTION ORA-01843
AND I RECOMPILE THE FORM IN Microsoft Windows XP BUT STILL I AM GETING THE SAME MESSAGE
WAITING FOR YOU VALUABLE ANSWER .
BEST REGARDS
JAMIL ALSHAIBANIForms [32 Bit] Version 6.0.8.23.2 (Production)
Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production
and the script which is used in the button as the following :
DECLARE
CURSOR C1 IS
SELECT ITEM_CODE,AVERAGE_COST,STORE_CODE,ITEM_QUANTITY,TOTAL_COST
FROM IM_GOODS_RECIEVE_DETAILS
WHERE DOC_CODE = :IM_GOODS_RECIEVE_HEADER.DOC_CODE;
LOC_DOC_CODE VARCHAR2(10);
LOC_DOC_DATE DATE;
LOC_ITEM_CODE VARCHAR2(30);
LOC_ITEM_QUANTITY NUMBER(20,3);
LOC_CART_QTY NUMBER(20,3);
LOC_UNIT_CODE VARCHAR2(10);
LOC_TOTAL_COST NUMBER(20,6);
LOC_AVERAGE_COST NUMBER(20,6);
LOC_SUM_QTY NUMBER(20,6);
LOC_BALANCE NUMBER(20,6);
LOC_PRICE NUMBER(20,6);
LOC_BALANCE_COST NUMBER(25,6);
LOC_ITEM VARCHAR2(30);
L0C_TOT_COST NUMBER(20,6);
LOC_TOT_QTY NUMBER(20,6);
LOC_NEW_AVERAGE NUMBER(20,6);
LOC_ON_HAND_QTY NUMBER(20,3);
al_id Alert;
al_button NUMBER;
LOC_SYS_DATE DATE;
BEGIN
SELECT TO_DATE(TO_CHAR(SYSDATE,'DD/MM/YYYY')) INTO LOC_SYS_DATE FROM DUAL;
FOR R IN C1
LOOP
BEGIN
SELECT B.ITEM_CODE ,SUM(NVL(ITEM_QUANTITY,0)) INTO LOC_ITEM ,LOC_SUM_QTY
FROM IM_TRANS_ISSUE_HEADER A,IM_TRANS_ISSUE_DETAILS B
WHERE A.DOC_CODE = B.DOC_CODE
AND B.DEL_STORE = R.STORE_CODE
AND ITEM_CODE = R.ITEM_CODE
AND DOC_DATE BETWEEN :IM_GOODS_RECIEVE_HEADER.DOC_DATE
AND LOC_SYS_DATE
GROUP BY
ITEM_CODE
ORDER BY B.ITEM_CODE ;
exception
when no_data_found then
NULL;
when form_trigger_failure then
show_message(sqlerrm);
raise form_trigger_failure;
when others then
show_message(sqlerrm);
raise form_trigger_failure;
END;
BEGIN
BEGIN
SELECT (NVL(QUANTITY_ON_HAND,0) + (NVL(LOC_SUM_QTY,0))),NVL(ITEM_PRICE1,0),
NVL(QUANTITY_ON_HAND,0)
INTO LOC_TOT_QTY,LOC_PRICE,LOC_ON_HAND_QTY
FROM IM_LOCATION A, IM_INVENTORY B
WHERE A.ITEM_CODE = B.ITEM_CODE
AND A.ITEM_CODE = R.ITEM_CODE
AND A.STORE_CODE = R.STORE_CODE;
LOC_BALANCE := (:IM_GOODS_RECIEVE_DETAILS.ITEM_QUANTITY) - (LOC_TOT_QTY);
LOC_BALANCE := - (LOC_BALANCE);
LOC_BALANCE_COST := ((LOC_BALANCE) * (LOC_PRICE));
L0C_TOT_COST := LOC_BALANCE_COST + :IM_GOODS_RECIEVE_DETAILS.TOTAL_COST;
LOC_NEW_AVERAGE := ROUND(((L0C_TOT_COST)/(LOC_TOT_QTY)),5);
exception
when no_data_found then
NULL;
when form_trigger_failure then
show_message(sqlerrm);
raise form_trigger_failure;
when others then
show_message(sqlerrm);
raise form_trigger_failure;
END;
BEGIN
SELECT 1 INTO :GLOBAL.DUMMY
FROM COST_TEMP_SUM
WHERE S_GOODS_DOC = :IM_GOODS_RECIEVE_HEADER.DOC_CODE
AND S_GOODS_DATE = :IM_GOODS_RECIEVE_HEADER.DOC_DATE
AND S_ITEM_CODE = R.ITEM_CODE;
exception
when no_data_found then
INSERT INTO COST_TEMP_SUM
VALUES(:IM_GOODS_RECIEVE_HEADER.DOC_CODE,
:IM_GOODS_RECIEVE_HEADER.DOC_DATE,LOC_SUM_QTY,LOC_ON_HAND_QTY,
LOC_TOT_QTY,LOC_BALANCE,R.ITEM_QUANTITY,
LOC_PRICE,LOC_BALANCE_COST,R.TOTAL_COST,
L0C_TOT_COST,LOC_NEW_AVERAGE,R.ITEM_CODE,LOC_SYS_DATE);
when form_trigger_failure then
show_message(sqlerrm);
raise form_trigger_failure;
when others then
show_message(sqlerrm);
raise form_trigger_failure;
END;
END;
IF LOC_BALANCE_COST = 0 THEN
UPDATE IM_INVENTORY
SET ITEM_PRICE1 = R.AVERAGE_COST
WHERE ITEM_CODE = R.ITEM_CODE;
ELSE
UPDATE IM_INVENTORY
SET ITEM_PRICE1 = LOC_NEW_AVERAGE,ITEM_PRICE2 = LOC_PRICE
WHERE ITEM_CODE = R.ITEM_CODE;
END IF;
-- THIS FOR ISSUED ITEMS QUANTITY
FOR R2 IN (
SELECT B.ITEM_CODE as LOC_ITEM_CODE, NVL(ITEM_QUANTITY,0) as LOC_ITEM_QUANTITY,
A.DOC_CODE as LOC_DOC_CODE, AVERAGE_COST as LOC_AVERAGE_COST,
TOTAL_COST as LOC_TOTAL_COST,A.DOC_DATE as LOC_DOC_DATE,
CART_QTY as LOC_CART_QTY,UNIT_CODE as LOC_UNIT_CODE
FROM IM_TRANS_ISSUE_HEADER A,IM_TRANS_ISSUE_DETAILS B
WHERE A.DOC_CODE = B.DOC_CODE
AND B.DEL_STORE = R.STORE_CODE
AND ITEM_CODE = R.ITEM_CODE
AND DOC_DATE BETWEEN :IM_GOODS_RECIEVE_HEADER.DOC_DATE
AND LOC_SYS_DATE
-- AND :EXPENSES_TAB.EXP_DATE
ORDER BY B.ITEM_CODE )
LOOP
BEGIN
SELECT 1 INTO :GLOBAL.DUMMY
FROM COST_TEMP
WHERE T_DOC_CODE = R2.LOC_DOC_CODE
AND T_DATE = R2.LOC_DOC_DATE
AND T_ITEM_CODE = R2.LOC_ITEM_CODE;
exception
when no_data_found then
INSERT INTO COST_TEMP
VALUES(R2.LOC_DOC_CODE,R2.LOC_DOC_DATE,R2.LOC_CART_QTY,R2.LOC_ITEM_QUANTITY,
R2.LOC_AVERAGE_COST,:IM_GOODS_RECIEVE_HEADER.DOC_CODE,
:IM_GOODS_RECIEVE_HEADER.DOC_DATE,R.ITEM_CODE,R.STORE_CODE);
when form_trigger_failure then
show_message(sqlerrm);
raise form_trigger_failure;
when others then
show_message(sqlerrm);
raise form_trigger_failure;
END;
Begin
al_id := Find_Alert('POST_DATA');
IF Id_Null(al_id) THEN
Message('User_Warning alert does not exist');
RAISE Form_Trigger_Failure;
ELSE
** Show the warning alert
-- jamil al_button := Show_Alert(al_id);
** If user pressed OK (button 1) then bring up another
** alert to confirm -- button mappings are specified
** in the alert design
-- IF R2.LOC_ITEM_QUANTITY != 0 AND al_button = ALERT_BUTTON1 THEN
IF R2.LOC_ITEM_QUANTITY != 0 THEN
BEGIN
UPDATE IM_TRANS_ISSUE_DETAILS
SET AVERAGE_COST = LOC_NEW_AVERAGE,
TOTAL_COST = LOC_NEW_AVERAGE * R2.LOC_ITEM_QUANTITY
WHERE DOC_CODE = R2.LOC_DOC_CODE
AND ITEM_CODE = R2.LOC_ITEM_CODE ;
END;
END IF;
END IF;
END;
END LOOP;
END LOOP;
GO_BLOCK('IM_GOODS_RECIEVE_HEADER');
:IM_GOODS_RECIEVE_HEADER.FLAG_COST := 1;
COMMIT;
SET_ITEM_PROPERTY('IM_GOODS_RECIEVE_HEADER.PUSH_BUTTON152',ENABLED,PROPERTY_FALSE);
SET_ITEM_PROPERTY('EXPENSES_TAB.PUSH_BUTTON151',ENABLED,PROPERTY_FALSE);
SHOW_MESSAGE('The New Cost Price updated Successfully !!!');
END;
BEGIN
IF nvl(:IM_GOODS_RECIEVE_HEADER.FLAG_COST,0) = 1 THEN
Make_Block_Query_Only('IM_GOODS_RECIEVE_DETAILS');
ELSIF nvl(:IM_GOODS_RECIEVE_HEADER.FLAG_COST,0) = 0 THEN
Make_Block_Query_Only('IM_GOODS_RECIEVE_DETAILS');
END IF;
END;
best regards
Jamil Alshaibani -
Oracle error "ORA-01843: not a valid month" when trying to run sqlldr
Hi all,
I'm trying to load some data into a staging database via a CSV file using sqlldr, and am running into an issue where it doesn't like the date format I'm using.
Here is my input data:
2012-01-09 16:28:12 -05:00Here is the entry in the .ctl file:
created TIMESTAMP WITH TIME ZONE 'yyyy-mm-dd HH24:MI:SS TZR'And finally, here is the entry in the .sql file:
created TIMESTAMP WITH TIME ZONEAfter I try to load, I get greeted with the dreaded error message: Record 1: Rejected - Error on table WTPART, column CREATED. ORA-01843: not a valid month
I'm really confused as to why it's blowing up on the date, because it seems to me that "01" is indeed a valid date in terms of the date format I'm using. Any ideas? Thanks!
Edited by: Nick Tiberi on Jan 10, 2012 8:06 AMHmmm, not sure exactly what the problem is. It works fine for me on my XE instance.
Set up the control and data files....
tubby@Tubbz:~/test$ cat >> WTPart.csv <<EOF
2012-01-09 16:28:12 -05:00
EOF
tubby@Tubbz:~/test$
tubby@Tubbz:~/test$ cat >> load.ctl <<EOF
LOAD DATA
INFILE WTPart.csv
APPEND INTO TABLE WTPart
FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
created TIMESTAMP WITH TIME ZONE 'yyyy-mm-dd HH24:MI:SS TZR'
EOF
tubby@Tubbz:~/test$
tubby@Tubbz:~/test$ /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/sqlldr tubby/pswd@xe control=load.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Tue Jan 10 10:21:28 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 1
tubby@Tubbz:~/test$
{code}
Query the result from the database
{code}
ME_XE?select * from wtpart;
CREATED
09-JAN-12 04.28.12.000000 PM -05:00
1 row selected.
Elapsed: 00:00:00.01
ME_XE?
ME_XE?select * from v$version;
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
5 rows selected.
Elapsed: 00:00:00.01
ME_XE?
{code}
Are you sure your CSV file doesn't have some "funky" data in it? -
sql server 2008 r2
RS2008 r2
I can execute the query in BIDS 2008 with out a problem and I can run on our RS2005 server without a problem
But when I deploy report and run on our RS2008 server I get the error
An error has occurred during report processing. (rsProcessingAborted)
Query execution failed for dataset 'NIR'. (rsErrorExecutingCommand)
ORA-01843: not a valid month
QUERY:
select * from NIR_QUARTERLY where birth_date between :PARAM1 and :PARAM2
order by PT_CODECAUSE
The problem is caused by not using VALID dates values in the dataset.
- This data problem was masked in the original version as the Predicate(s) used can change between versions of Oracle
- Oracle does *not* guarantee the same explain plan or the specific order of predicates used between versions of Oracle
Reviewing the EXPLAIN PLAN for both versions revealed in this case:
1) The table was partitioned
2) The EXPLAIN PLANS were not the same due to how the partitions were accessed
3) If the same query was used against a non-partitioned table using the same data, the following error would always occur
ORA-01843: not a valid month
4) The problem string value was in this case found to include the string value of '0000-00-00'
The ORA-01843 occurred when using the TO_DATE function against '0000-00-00'
There is *no* Year= '0000' Month= '00' or day = '00' -- therefore the ORA-01843: not a valid month
--Prashanth -
Using Oracle OLE DB provider (with ADO) generates error: ORA-01843 while using date
Were using OLE DB provider in order to connect to our Oracle 9i database. When executing the following query in a SQL Plus window I will get the correct results:
SELECT gum_seu_syo_id, seu_userid, seu_first_name, seu_last_name
From group_user_mapping, security_users
Where gum_seu_syo_id = seu_syo_id
and gum_term_date > '8/19/2002'
and gum_seg_syo_id = 11
However if will execute the same query from the our application (VB using ADO) I will get the following error:
ORA-01843: Not a valid month
Checking with our Oracle DBA we made sure my registry is correct and includes the correct format under HEKY_LOCAL_MACHINE\SOFTWARE\ORACLE\ORACLE_HOME,
where the key is NLS_DATE_FORMAT (of type REG_EXPAND_SZ) with the value:
MM/DD/YYYY HH:MI:SS AM
I also run the following query in a SQL Plus window:
select sysdate from dual;
and got the following result:
08/19/2002 10:27:20 AM
which shows that the data format is correct.
Trying to switch between the month and day in the query (put '19/8/2002') worked from the application but generated ORA-01843: Not a valid month in the SQL Plus window.
Any ideas?try using
to_char function
for eg.
select * from emp where to_char(hiredate,'dd/mm/yy') > '20/3/83'.
Jagriti -
Getting Ora 01843 not a Valid month Error
Hi
I was trying to assign the data in MM/DD/YY format
from a date value '09/25/2009'..
I cannot Obain the result i always get this
ORA-01843: not a valid month
May i ask you kindly to help me out here.
Below is the code Snippet;
DECLARE
lv_date DATE;
BEGIN
lv_date := '09/25/2009';
BEGIN
lv_date:= TO_DATE(lv_date,'MM/DD/YY');
lv_date:= TO_CHAR(lv_date,'MM/DD/YY');
-- I slso tried this way but same error.
-- lv_date := TO_CHAR(TO_DATE(lv_date,'MM/DD/YYYY'),'MM/DD/YY');
END;
DBMS_OUTPUT.PUT_LINE('the date format is = '|| lv_date);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE ('Err from MainBlock '|| SQLCODE || SQLERRM);
END;Hi,
1)
lv_date := '09/25/2009';lv_date is a variable of datatype date, but you are assigning a varchar, which Oracle is not able to do implicit conversion because of nls_date_format
change to something like to_date('09/25/2009','mm/dd/yyyy')
2)
lv_date:= TO_DATE(lv_date,'MM/DD/YY');
lv_date:= TO_CHAR(lv_date,'MM/DD/YY');Why would be assinging a char value to date datatype. Use any one depending on datatype of lv_date
Regards
Anurag Tibrewal. -
Date error ORA-01843: not a valid month
Hi,
I am in a 4.01 Apex environment with NLS_DATE_FORMAT mm/dd/yyyy. I created a view with a CASE statements using 'when eventstartdate between '08/15/2010' and '06/1/2011' then...' clauses and the view is created fine. I also can query the view with no problem with SQL workshop and the CASE statements work as expected. When I create an interactive report on that view I keep getting ORA-01843: not a valid month. I even tried matching the format in the Interactive Report column format mask to the NLS format for the date and still get error.
What seems especially strange to me is that even if I have the view column defined with a 'to_char' I still get the same error when I use the CASE statement to build the view. Doesn't the Interactive Report just 'see' the View column definitions-- why should it 'care' how the view was built?
The only way I can get the View to work with an Interactive report in any manner is to remove all the CASE statements and define the 'eventstartdate' as text using to_char but that then eliminates my ability to do any filters that require date comparisons with between or '>', '<'.
Help would be appreciated!
Thanks,
PatQuick late night response - always convert your dates for comparison. Apples to apples
Instead of between '01/31/2012', use either
TO_DATE('01/31/2012', 'MM/DD/YYYY')or
DATE '2012-01-31'More related info
http://www.grassroots-oracle.com/2011/03/date-format-tolerance.html
Sorry if I'm off target, thought it may help -
XMLTable default values for timestamp results in ORA-01843: not a valid month
When I try to provide a default for a timestamp value in the XMLTABLE function, I am greeted with an error - ORA-01843: not a valid month - no matter how I provide that default value. Whether there is a value present in the XML or not is irrelavant for this bug to occur. It appears to be an incomplete fix of bug number 9745897 (thread).
select x.*
from
xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')
COLUMNS dt timestamp default sysdate) x;
select x.*
from
xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')
COLUMNS dt timestamp default systimestamp) x;
select x.*
from
xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')
COLUMNS dt timestamp default to_char(systimestamp, 'YYYY-MM-DD"T"HH24:MI:SS') ) x;
Edit: A little more followup.
This works:
select x.*
from
xmltable('/DOC' passing xmltype('<DOC></DOC>')
COLUMNS dt date default sysdate) x;
This also works, except for its just the date, and not the date/time
select x.*
from
xmltable('/DOC' passing xmltype('<DOC></DOC>')
COLUMNS dt timestamp default sysdate) x;
This doesn't work
select x.*
from
xmltable('/DOC' passing xmltype('<DOC></DOC>')
COLUMNS dt timestamp default systimestamp) x;
ORA-01861: literal does not match format stringHi,
First of all, let's check the manual for the DEFAULT clause :
XMLTABLE SQL/XML Function in Oracle XML DB
The optional DEFAULT clause specifies the value to use when the PATH expression results in an empty sequence (or NULL). Its expr is an XQuery expression that is evaluated to produce the default value.
According to the documentation, the DEFAULT clause should specify an XQuery expression.
However, that is wrong, the actual implementation only expects an expression that resolves to a string, the content is not interpreted.
So, bottom line is if we don't directly specify a string, the expression will be implicitly converted to one, and we all know how bad things can go when implicit conversions occur, especially when dates or timestamps are involved.
Now let's focus on how the DEFAULT clause affects the query evaluation.
When a DEFAULT clause is specified, Oracle rewrites the projection differently and do not use the native xs:dateTime format to convert the value :
select x.*
from
xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')
COLUMNS dt timestamp default systimestamp
) x
becomes :
SELECT CASE EXISTSNODE(VALUE(KOKBF$),'/DOC/DT')
WHEN 1 THEN CAST(TO_TIMESTAMP(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(SYS_XQEXTRACT(VALUE(KOKBF$),'/DOC/DT')),50,1,2)) AS timestamp )
ELSE CAST(TO_TIMESTAMP(TO_CHAR(SYSTIMESTAMP(6)),'SYYYY-MM-DD"T"HH24:MI:SSXFF') AS timestamp )
END "DT"
FROM TABLE("SYS"."XQSEQUENCE"(EXTRACT("SYS"."XMLTYPE"('<DOC><DT>2013-08-14T15:08:31</DT></DOC>'),'/DOC'))) "KOKBF$"
See the red part : it doesn't use the format parameter, so the conversion relies on the session's NLS settings.
When there's no DEFAULT clause, the TO_TIMESTAMP function uses an explicit format :
select x.*
from
xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')
COLUMNS dt timestamp --default systimestamp
) x
rewritten to :
SELECT CAST(
TO_TIMESTAMP(
SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(SYS_XQEXTRACT(VALUE(KOKBF$),'/DOC/DT'),0,0,20971520,0),50,1,2)
, 'SYYYY-MM-DD"T"HH24:MI:SSXFF'
AS timestamp --default systimestamp
) "DT"
FROM TABLE("SYS"."XQSEQUENCE"(EXTRACT("SYS"."XMLTYPE"('<DOC><DT>2013-08-14T15:08:31</DT></DOC>'),'/DOC'))) "KOKBF$"
so yes, maybe there's a bug here.
Edit: A little more followup.
This works:
select x.*
from
xmltable('/DOC' passing xmltype('<DOC></DOC>')
COLUMNS dt date default sysdate) x;
Actually no, it doesn't work. Granted, maybe it doesn't produce any error, but the result is incorrect.
As explained, the conversion relies on the session NLS (NLS_DATE_FORMAT in this case) :
SQL> show parameters nls_date_format
NAME TYPE VALUE
nls_date_format string DD/MM/RR
SQL>
SQL> select sysdate from dual;
SYSDATE
16/08/13
SQL> select x.*
2 from
3 xmltable('/DOC' passing xmltype('<DOC></DOC>')
4 COLUMNS dt date default sysdate) x;
DT
13/08/16
Oracle first converts SYSDATE to a string using current NLS_DATE_FORMAT, resulting in '16/08/13'
Then this string is converted to a DATE using the xs:date format 'YYYY-MM-DD' resulting in 13/08/0016 (August 13, 0016) which is incorrect.
The obvious workaround to this issue is to control how Oracle implicitly converts from string to date/timestamp format :
SQL> alter session set NLS_TIMESTAMP_FORMAT= 'YYYY-MM-DD"T"HH24:MI:SS';
Session altered.
SQL> select x.*
2 from
3 xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')
4 COLUMNS dt timestamp default systimestamp
5 ) x;
DT
2013-08-14T15:08:31
SQL> select x.*
2 from
3 xmltable('/DOC' passing xmltype('<DOC></DOC>')
4 COLUMNS dt timestamp default systimestamp) x;
COLUMNS dt timestamp default systimestamp) x
ERROR at line 4:
ORA-01861: literal does not match format string
SQL> select x.*
2 from
3 xmltable('/DOC' passing xmltype('<DOC></DOC>')
4 COLUMNS dt timestamp default cast(systimestamp as timestamp)) x;
DT
2013-08-16T12:32:58 -
Trying to use PL/SQL to automatically create a report that show the following:
Daily:
# of Registered Users
# of Completes (assessment) Average per User
# of Starts (assessment) Average per User
Weekly:
# of Registered Users
# of Completes (assessment) Average per User
# of Starts (assessment) Average per User
Yearly:
# of Registered Users
# of Completes (assessment) Average per User
# of Starts (assessment) Average per User
When I run the PL/SQL I get the following
[error]
ORA-01843: not a valid month
[error]
The error occurs on this part of the PL/SQL
--registered users weekly starts
select count(*), trunc(next_day(sysdate-29, 'SUNDAY')-7), trunc(sysdate-29)
into v_weekly_count_total_ru, v_weekly_start_date, v_weekly_end_date
from entities
where list_id = 3290
and participation_code_id = 10
and trunc(participation_date)
between trunc(next_day(sysdate-29, 'SUNDAY')-7) and
trunc(sysdate-29);I'm using the number 29 because I'm using a test database to test this first before moving it into production. And my test data only goes back to early August 2006.
Also, I'm not doing anything with months, so I am suprised that it is throwing this type of error.
thanksI tested a snippet of code in my production environment, just to see if I would get any results:
--registered users weekly starts
select count(*), trunc(next_day(sysdate-1, 'SUNDAY')-7), trunc(sysdate-1)
--into v_weekly_count_total_ru, v_weekly_start_date, v_weekly_end_date
from entities
where list_id = 3290
and participation_code_id = 10
and trunc(participation_date)
between trunc(next_day(sysdate-1, 'SUNDAY')-7) and trunc(sysdate-1);
COUNT(*) TRUNC(NEXT_DAY(SYSDATE-1,'SUND TRUNC(SYSDATE-1)--INTOV_WEEKLY
1 09/10/2006 00:00:00 09/11/2006 00:00:00I did a double check in my test DB to make sure there is data there:
select count(*)
from entities
where trunc(participation_date)
between to_date('01-08-2006','DD-MM-YYYY')
and to_date('14-08-2006','DD-MM-YYYY')
and list_id = 3290;
COUNT(*)
11So I'm pretty sure that I'm not pulling anything null.
thanks -
ORA-01843: not a valid month - Oracle 11gR2 vs Oracle 10gR2
Hi,
We have two database servers one running on 10g and another running on 11g. Application written in Java (We are using Top link to connect oracle).
Insert query on timestamp works fine on database 10g where as same query fail on 11g and raise error ORA-01843.
If query executed with sqlplus on database 11g it works fine. i
INSERT INTO CAMP (CAMP_PK, TSTAMP_CREATED) VALUES (1, '2010-02-22 06:07:18.008')
Below parameters set on DB:
SQL> select * from nls_database_parameters;
PARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET WE8MSWIN1252
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 11.2.0.1.0
SQL > show parameter nls_
nls_date_format string YYYYMMDD HH24:MI:SS
nls_timestamp_format string YYYY-MM-DD HH24:MI:SS.FF3
nls_timestamp_tz_format string YYYYMMDD HH24:MI:SS.FF3 TZD
Got below session data from application, both are identical.
"11g"
NLS_LANGUAGE=> AMERICAN
NLS_TERRITORY=> AMERICA
NLS_CURRENCY=> $
NLS_ISO_CURRENCY=> AMERICA
NLS_NUMERIC_CHARACTERS=> .,
NLS_CALENDAR=> GREGORIAN
NLS_DATE_FORMAT=> DD-MON-RR
NLS_DATE_LANGUAGE=> AMERICAN
NLS_SORT=> BINARY
NLS_TIME_FORMAT=> HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT=> DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT=> HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT=> DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY=> $
NLS_COMP=> BINARY
NLS_LENGTH_SEMANTICS=> BYTE
NLS_NCHAR_CONV_EXCP=> FALSE
"10g"
NLS_LANGUAGE=> AMERICAN
NLS_TERRITORY=> AMERICA
NLS_CURRENCY=> $
NLS_ISO_CURRENCY=> AMERICA
NLS_NUMERIC_CHARACTERS=> .,
NLS_CALENDAR=> GREGORIAN
NLS_DATE_FORMAT=> DD-MON-RR
NLS_DATE_LANGUAGE=> AMERICAN
NLS_SORT=> BINARY
NLS_TIME_FORMAT=> HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT=> DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT=> HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT=> DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY=> $
NLS_COMP=> BINARY
NLS_LENGTH_SEMANTICS=> BYTE
NLS_NCHAR_CONV_EXCP=> FALSE
Does DBTIMEZONE make any impact on nls ?
"11g"
SQL> SELECT DBTIMEZONE, SESSIONTIMEZONE, SYSDATE FROM DUAL;
DBTIMEZONE SESSIONTIMEZONE SYSTIMESTAMP
+00:00 -05:00 20100222 05:07:25.343
"10g"
SQL> SELECT DBTIMEZONE, SESSIONTIMEZONE, SYSDATE FROM DUAL;
DBTIMEZONE SESSIONTIMEZONE SYSTIMESTAMP
-05:00 -05:00 20100222 05:07:34.771I am agree we can resolve this issue with to_timestamp but i need to defend on why it was working on 10g and not on 11g.A timestamp in the form '2010-02-22 06:07:18.008' should have never been accepted with NLS_TIMESTAMP_TZ_FORMAT='DD-MON-RR HH.MI.SSXFF AM TZR'. So there are three possibilities:
1) The NLS_TIMESTAMP_TZ_FORMAT session format (NLS_SESSION_PARAMETERS) in force during the INSERT is not really the one you listed.
2) The column CAMP.TSTAMP_CREATED is of type VARCHAR2 and not TIMESTAMP in the 10g database.
3) There is a bug in the JDBC driver you use with 10g that allows this strange conversion.
4) The SQL issued in the 10g database is really:
INSERT INTO CAMP (CAMP_PK, TSTAMP_CREATED) VALUES (1, TIMESTAMP '2010-02-22 06:07:18.008')-- Sergiusz -
Hi,
We developed OA page for Employee's Payslip and it is working fine for all the employees but it is not working for only one employee...Getting the error as
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement
preparation
## Detail 0 ##
java.sql.SQLException: ORA-01843: not a valid month
Real Scenario is:
The user "DANISH.LOTFY" is login into application and when he click on Payslip to the month then he is always getting the above error.
For testing purpose we have removed his employee assignment from user screen(fnd_user) and assigned some other employee name (say MOHAMED.ELBAHY)... After this when DANISH.LOTFY logins into the application and payslip page is working fine...(He can able to see MOHAMED.ELBAHY payslip.....
Realy we don't know this strange behaviour of OA ...
------ Code with Error details------------------
Statement:
SELECT * FROM (SELECT DISTINCT ppa.DATE_EARNED, TO_CHAR(ppa.DATE_EARNED,'MON-YYYY') DISPLAY
, TO_CHAR(ppa.DATE_EARNED,'MM YYYY') PARAM
FROM
pay_payroll_actions ppa
,pay_assignment_actions pac
,PER_ALL_ASSIGNMENTS_F PASS
,FND_USER FU
,per_time_periods PTP
WHERE ppa.payroll_id = 61
AND ppa.payroll_action_id = pac.payroll_action_id
AND PAC.ASSIGNMENT_ID = PASS.ASSIGNMENT_ID
AND PASS.PERSON_ID = FU.EMPLOYEE_ID
AND FU.USER_ID =Fnd_Profile.VALUE('USER_ID')
AND TRIM(TO_CHAR(ppa.DATE_EARNED,'MON-YYYY')) IS NOT NULL
---Added by Sudipta C on 28th Janaury 2008
AND TRIM(TO_CHAR(ppa.DATE_EARNED,'MON-YYYY')) <> TRIM(TO_CHAR(SYSDATE,'MON-YYYY'))
AND ppa.DATE_EARNED=(SELECT MAX(DATE_EARNED) FROM pay_payroll_actions WHERE time_period_id=ppa.time_period_id)
AND ppa.DATE_EARNED >='30-NOV-2007'
UNION ALL
--Query to Display only the Current Month if the Concurrent Request Ran
SELECT DISTINCT ppa.DATE_EARNED, TO_CHAR(ppa.DATE_EARNED,'MON-YYYY') DISPLAY
, TO_CHAR(ppa.DATE_EARNED,'MM YYYY') PARAM
FROM
pay_payroll_actions ppa
,pay_assignment_actions pac
,PER_ALL_ASSIGNMENTS_F PASS
,FND_USER FU
,per_time_periods PTP
WHERE ppa.payroll_id = 61
AND ppa.payroll_action_id = pac.payroll_action_id
AND PAC.ASSIGNMENT_ID = PASS.ASSIGNMENT_ID
AND PASS.PERSON_ID = FU.EMPLOYEE_ID
AND FU.USER_ID = Fnd_Profile.VALUE('USER_ID')
AND TRIM(TO_CHAR(ppa.DATE_EARNED,'MON-YYYY')) IS NOT NULL
AND TRIM(TO_CHAR(ppa.DATE_EARNED,'MON-YYYY')) = TRIM(TO_CHAR(SYSDATE,'MON-YYYY'))
AND ppa.DATE_EARNED=(SELECT MAX(DATE_EARNED) FROM pay_payroll_actions WHERE time_period_id=ppa.time_period_id)
AND ppa.DATE_EARNED >='30-NOV-2007'
--Check the Concurrent Program Ran or not to Display the SYS Month Payroll Period ID
AND EXISTS
(SELECT TRIM(TO_CHAR(REQUEST_DATE,'MON-YYYY')) FROM fnd_conc_req_summary_v fcrs
WHERE program_short_name = 'PROC_EXP1_TESTING'
AND PHASE_CODE='C' AND STATUS_CODE='C'
AND TO_CHAR(REQUEST_DATE,'MON-YYYY')=TO_CHAR(SYSDATE,'MON-YYYY')
AND REQUEST_DATE=(SELECT MAX(REQUEST_DATE) FROM fnd_conc_req_summary_v
WHERE CONCURRENT_PROGRAM_ID=fcrs.CONCURRENT_PROGRAM_ID))
ORDER BY 1 DESC) QRSLT WHERE (( UPPER(DISPLAY) like :1 AND (DISPLAY like :2 OR DISPLAY like :3 OR DISPLAY like :4 OR DISPLAY like :5)))
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1408)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormData(OAPageBean.java:2555)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1677)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
at oa_html._OA._jspService(_OA.java:84)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
at oracle.jsp.JspServlet.service(JspServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
at org.apache.jserv.JServConnection.run(JServConnection.java:294)
at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
java.sql.SQLException: ORA-01843: not a valid month
Could any please suggest/provide your valuable inputs to resolve this issue(It is in production , so please treat it as very urgent).
Thanks & Regards,
J.PrakashHi,
This is really a strange behaviour as you are saying that it is happening only for one user so please check his user preferences.
Regards,
Reetesh Sharma -
The database error text is: ORA-01843: not a valid month
I am trying to use a date field as a query filter and I keep getting the
following error:
A database error occurred. The database error text is: ORA-01843: not a
valid month. (WIS 10901).
When I remove the query filter and run the query it works as
expected. I want to be able to allow the users to use the date field in order
to select a date range. Can someone provide me with some information on how to
resolve this issue.SQL> SELECT (to_char(tO_date('09/29/2006', 'mm/dd/yyyy'))||':'||TO_CHAR(systimestamp,'hh24:mi:ss:ff6'))
2 FROM dual;
(TO_CHAR(TO_DATE('09/29/2006
29-SEP-06:01:33:09:023000
But you want mm/dd/yyyy hh24:mi:ss:ff6 format then use TO_CHAR function for format specifier
SQL> SELECT to_char(to_timestamp((to_char(tO_date('09/29/2006', 'mm/dd/yyyy'))||':'||TO_CHAR(systimestamp,'hh24:mi:ss:ff6')), 'dd/mm/yyyy hh24:mi:ss:ff6'),'mm/dd/yyyy hh24:mi:ss:ff6')
2 FROM DUAL
3 /
TO_CHAR(TO_TIMESTAMP((TO_CHAR
09/29/0006 01:40:27:113000
SQL> Khurram -
Query with error: ORA-01843: not a valid month
Hi,
I have a problem with a query. I have modified a query that before worked but not now!
The correct original query was:
SELECT rtrim('Cambio di: '
|| (CASE WHEN nvl(A.CODICE_EMITTENTE ,' ') <> nvl(B.CODICE_EMITTENTE ,' ') THEN 'Codice emittente, ' ELSE '' END)
|| (CASE WHEN nvl(A.DESCRIZIONE_TITOLO,' ') <> nvl(B.DESCRIZIONE_TITOLO,' ') THEN 'Descrizione titolo, ' ELSE '' END)
|| (CASE WHEN nvl(A.SOTTOSTANTE,' ') <> nvl(B.SOTTOSTANTE,' ') THEN 'Sottostante, ' ELSE '' END)
|| (CASE WHEN nvl(A.TIPO_SOTTOSTANTE, ' ') <> nvl(B.TIPO_SOTTOSTANTE,' ') THEN 'Tipo sottostante, ' ELSE '' END)
|| (CASE WHEN nvl(A.CEDOLA_LORDA_CORRENTE, 0) <> nvl(B.CEDOLA_LORDA_CORRENTE, 0) THEN 'Cedola lorda corrente, ' ELSE '' END)
|| (CASE WHEN nvl(A.FREQUENZA_CEDOLA, ' ') <> nvl(B.FREQUENZA_CEDOLA, ' ') THEN 'Frequenza cedola, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') THEN 'Data inizio facoltà call, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') THEN 'Data fine facoltà call, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') THEN 'Data inizio facoltà put, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') THEN 'Data fine facoltà put, ' ELSE '' END)
|| (CASE WHEN nvl(A.AMMONTARE_EMESSO, 0) <> nvl(B.AMMONTARE_EMESSO, 0) THEN 'Ammontare emesso, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') <> nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999') THEN 'Data primo godimento, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_SCADENZA, '31-Dec-2999') <> nvl(B.DATA_SCADENZA, '31-Dec-2999') THEN 'Data scadenza, ' ELSE '' END)
|| (CASE WHEN nvl(A.PRIMO_PREZZO_EMISSIONE, 0) <> nvl(B.PRIMO_PREZZO_EMISSIONE, 0) THEN 'Primo prezzo di emissione, ' ELSE '' END)
|| (CASE WHEN nvl(A.MODALITA_RIMBORSO, 0) <> nvl(B.MODALITA_RIMBORSO, 0) THEN 'Modalità rimborso, ' ELSE '' END)
|| (CASE WHEN nvl(A.SUBORDINAZIONE, ' ') <> nvl(B.SUBORDINAZIONE, ' ') THEN 'Subordinazione, ' ELSE '' END)
|| (CASE WHEN nvl(A.DIV_EMIS_CODE, 0) <> nvl(B.DIV_EMIS_CODE, 0) THEN 'Codice divisa di emissione, ' ELSE '' END)
|| (CASE WHEN nvl(A.DIV_EMIS, ' ') <> nvl(B.DIV_EMIS, ' ') THEN 'Divisa di emissione, ' ELSE '' END)
,', ') TIPO_VARIAZIONE,
A.ISICOD ,
A.CODICE_EMITTENTE AS EMIT_COD_T, B.CODICE_EMITTENTE AS EMIT_COD_T1,
A.DESCRIZIONE_TITOLO AS DESC_TITOLO_T, B.DESCRIZIONE_TITOLO AS DESC_TITOLO_T1,
A.SOTTOSTANTE AS SOTTOSTANTE_T, B.SOTTOSTANTE AS SOTTOSTANTE_T1,
A.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T, B.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T1,
A.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T, B.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T1,
A.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T, B.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T1,
A.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T, B.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T1,
A.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T, B.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T1,
A.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T, B.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T1,
A.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T, B.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T1,
A.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T, B.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T1,
A.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T, B.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T1,
A.DATA_SCADENZA AS DATA_SCADENZA_T, B.DATA_SCADENZA AS DATA_SCADENZA_T1,
A.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T, B.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T1,
A.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T, B.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T1,
A.SUBORDINAZIONE AS SUBORDINAZIONE_T, B.SUBORDINAZIONE AS SUBORDINAZIONE_T1,
A.DIV_EMIS_CODE AS DIV_EMIS_CODE_T, B.DIV_EMIS_CODE AS DIV_EMIS_CODE_T1,
A.DIV_EMIS AS DIV_EMIS_T, B.DIV_EMIS AS DIV_EMIS_T1,
A.START_DATE AS DATA_AGG_T, B.START_DATE AS DATA_AGG_T1
FROM SPR_KLERS_ISD A, SPR_KLERS_ISD B
WHERE A.START_DATE=TRUNC(SYSDATE)
AND A.ISICOD=B.ISICOD
AND B.START_DATE = decode(trim(to_char(sysdate, 'Day')), 'Monday',trunc(sysdate-3), trunc(sysdate-1))
AND (nvl(A.CODICE_EMITTENTE,' ') != nvl(B.CODICE_EMITTENTE,' ')
OR
nvl(A.DESCRIZIONE_TITOLO,' ') != nvl(B.DESCRIZIONE_TITOLO,' ')
OR
nvl(A.SOTTOSTANTE,' ') != nvl(B.SOTTOSTANTE,' ')
OR
nvl(A.TIPO_SOTTOSTANTE, ' ') != nvl(B.TIPO_SOTTOSTANTE,' ')
OR
nvl(A.CEDOLA_LORDA_CORRENTE, 0) != nvl(B.CEDOLA_LORDA_CORRENTE, 0)
OR
nvl(A.FREQUENZA_CEDOLA, ' ') != nvl(B.FREQUENZA_CEDOLA, ' ')
OR
nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.AMMONTARE_EMESSO, 0) != nvl(B.AMMONTARE_EMESSO, 0)
OR
nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') != nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999')
OR
nvl(A.DATA_SCADENZA, '31-Dec-2999') != nvl(B.DATA_SCADENZA, '31-Dec-2999')
OR
nvl(A.PRIMO_PREZZO_EMISSIONE, 0) != nvl(B.PRIMO_PREZZO_EMISSIONE, 0)
OR
nvl(A.MODALITA_RIMBORSO, 0) != nvl(B.MODALITA_RIMBORSO, 0)
OR
nvl(A.SUBORDINAZIONE, ' ') != nvl(B.SUBORDINAZIONE, ' ')
OR
nvl(A.DIV_EMIS_CODE, 0) != nvl(B.DIV_EMIS_CODE, 0)
OR
nvl(A.DIV_EMIS, ' ') != nvl(B.DIV_EMIS, ' '))The new query that not works is:
SELECT rtrim('Cambio di: '
|| (CASE WHEN nvl(A.CODICE_EMITTENTE ,' ') <> nvl(B.CODICE_EMITTENTE ,' ') THEN 'Codice emittente, ' ELSE '' END)
|| (CASE WHEN nvl(A.DESCRIZIONE_TITOLO,' ') <> nvl(B.DESCRIZIONE_TITOLO,' ') THEN 'Descrizione titolo, ' ELSE '' END)
|| (CASE WHEN nvl(A.SOTTOSTANTE,' ') <> nvl(B.SOTTOSTANTE,' ') THEN 'Sottostante, ' ELSE '' END)
|| (CASE WHEN nvl(A.TIPO_SOTTOSTANTE, ' ') <> nvl(B.TIPO_SOTTOSTANTE,' ') THEN 'Tipo sottostante, ' ELSE '' END)
|| (CASE WHEN nvl(A.CEDOLA_LORDA_CORRENTE, 0) <> nvl(B.CEDOLA_LORDA_CORRENTE, 0) THEN 'Cedola lorda corrente, ' ELSE '' END)
|| (CASE WHEN nvl(A.FREQUENZA_CEDOLA, ' ') <> nvl(B.FREQUENZA_CEDOLA, ' ') THEN 'Frequenza cedola, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') THEN 'Data inizio facoltà call, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') THEN 'Data fine facoltà call, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') THEN 'Data inizio facoltà put, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') THEN 'Data fine facoltà put, ' ELSE '' END)
|| (CASE WHEN nvl(A.AMMONTARE_EMESSO, 0) <> nvl(B.AMMONTARE_EMESSO, 0) THEN 'Ammontare emesso, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') <> nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999') THEN 'Data primo godimento, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_SCADENZA, '31-Dec-2999') <> nvl(B.DATA_SCADENZA, '31-Dec-2999') THEN 'Data scadenza, ' ELSE '' END)
|| (CASE WHEN nvl(A.PRIMO_PREZZO_EMISSIONE, 0) <> nvl(B.PRIMO_PREZZO_EMISSIONE, 0) THEN 'Primo prezzo di emissione, ' ELSE '' END)
|| (CASE WHEN nvl(A.MODALITA_RIMBORSO, 0) <> nvl(B.MODALITA_RIMBORSO, 0) THEN 'Modalità rimborso, ' ELSE '' END)
|| (CASE WHEN nvl(A.SUBORDINAZIONE, ' ') <> nvl(B.SUBORDINAZIONE, ' ') THEN 'Subordinazione, ' ELSE '' END)
|| (CASE WHEN nvl(A.DIV_EMIS_CODE, 0) <> nvl(B.DIV_EMIS_CODE, 0) THEN 'Codice divisa di emissione, ' ELSE '' END)
|| (CASE WHEN nvl(A.DIV_EMIS, ' ') <> nvl(B.DIV_EMIS, ' ') THEN 'Divisa di emissione, ' ELSE '' END)
,', ') TIPO_VARIAZIONE,
A.ISICOD ,
A.CODICE_EMITTENTE AS EMIT_COD_T, B.CODICE_EMITTENTE AS EMIT_COD_T1,
A.DESCRIZIONE_TITOLO AS DESC_TITOLO_T, B.DESCRIZIONE_TITOLO AS DESC_TITOLO_T1,
A.SOTTOSTANTE AS SOTTOSTANTE_T, B.SOTTOSTANTE AS SOTTOSTANTE_T1,
A.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T, B.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T1,
A.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T, B.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T1,
A.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T, B.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T1,
A.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T, B.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T1,
A.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T, B.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T1,
A.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T, B.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T1,
A.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T, B.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T1,
A.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T, B.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T1,
A.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T, B.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T1,
A.DATA_SCADENZA AS DATA_SCADENZA_T, B.DATA_SCADENZA AS DATA_SCADENZA_T1,
A.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T, B.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T1,
A.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T, B.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T1,
A.SUBORDINAZIONE AS SUBORDINAZIONE_T, B.SUBORDINAZIONE AS SUBORDINAZIONE_T1,
A.DIV_EMIS_CODE AS DIV_EMIS_CODE_T, B.DIV_EMIS_CODE AS DIV_EMIS_CODE_T1,
A.DIV_EMIS AS DIV_EMIS_T, B.DIV_EMIS AS DIV_EMIS_T1,
A.START_DATE AS DATA_AGG_T, B.START_DATE AS DATA_AGG_T1
FROM SPR_KLERS_ISD A, SPR_KLERS_ISD B
WHERE A.START_DATE=TRUNC(SYSDATE)
AND A.ISICOD=B.ISICOD
AND B.END_DATE = TRUNC(SYSDATE)
AND (nvl(A.CODICE_EMITTENTE,' ') != nvl(B.CODICE_EMITTENTE,' ')
OR
nvl(A.DESCRIZIONE_TITOLO,' ') != nvl(B.DESCRIZIONE_TITOLO,' ')
OR
nvl(A.SOTTOSTANTE,' ') != nvl(B.SOTTOSTANTE,' ')
OR
nvl(A.TIPO_SOTTOSTANTE, ' ') != nvl(B.TIPO_SOTTOSTANTE,' ')
OR
nvl(A.CEDOLA_LORDA_CORRENTE, 0) != nvl(B.CEDOLA_LORDA_CORRENTE, 0)
OR
nvl(A.FREQUENZA_CEDOLA, ' ') != nvl(B.FREQUENZA_CEDOLA, ' ')
OR
nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.AMMONTARE_EMESSO, 0) != nvl(B.AMMONTARE_EMESSO, 0)
OR
nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') != nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999')
OR
nvl(A.DATA_SCADENZA, '31-Dec-2999') != nvl(B.DATA_SCADENZA, '31-Dec-2999')
OR
nvl(A.PRIMO_PREZZO_EMISSIONE, 0) != nvl(B.PRIMO_PREZZO_EMISSIONE, 0)
OR
nvl(A.MODALITA_RIMBORSO, 0) != nvl(B.MODALITA_RIMBORSO, 0)
OR
nvl(A.SUBORDINAZIONE, ' ') != nvl(B.SUBORDINAZIONE, ' ')
OR
nvl(A.DIV_EMIS_CODE, 0) != nvl(B.DIV_EMIS_CODE, 0)
OR
nvl(A.DIV_EMIS, ' ') != nvl(B.DIV_EMIS, ' '))where I have changed only this:
B.START_DATE = decode(trim(to_char(sysdate, 'Day')), 'Monday',trunc(sysdate-3), trunc(sysdate-1)) --------->AND B.END_DATE = TRUNC(SYSDATE)
Both START_DATE and END_DATE are date filds.
When I execute the second query I receive this:
ORA-01843: not a valid monthin many ponts of the query that change every time I execute the query, why this behaviour?
How can I solve?
Thanks, bye bye.Could you execute the following query and post the output.
select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
select sysdate from dual;Also what are the datatypes for these columns
>
nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.AMMONTARE_EMESSO, 0) != nvl(B.AMMONTARE_EMESSO, 0)
OR
nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') != nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999')
OR
nvl(A.DATA_SCADENZA, '31-Dec-2999') != nvl(B.DATA_SCADENZA, '31-Dec-2999')
>
I hope you know anything given in single quotes is a string and not a date.
Regards
Raj
Maybe you are looking for
-
Macbook Air 2010 trackpad stop working when touching case (palm rest)
My MBA 2010 A1369 had demaged keyboard and trackpad by liquid. I got used whoel top case and replace. (not myself) Seller claimed it is ok but we face one problem. when I touch case (palm rest) trackpad stops responding. When on one side partly when
-
Photoshop Elements 4 (Help!)
Just ordered photoshop elements 4 and turns out its all in swedish, anyone know a way to change to english???
-
Iphone4 dropped in water 1611 error
Well, This is what ive done so far. This is my wifes phone and I was out of town so I coulndt get to it right away,so I had a poly..whatever screwdriver overnighted to her. She took the back cover off and let it sit in a closed bowl of rice for four
-
HI, I created a Real Time application with debugging enabled that only makes a straight line move and then finds center (using SoftMotion function blocks). When I run the VI from the project everything works fine. When I create the executable and run
-
Hi friends, can any tell me the BAPI FM for tcode FBL3N. Thanks, Ankitha