catupgrd. SQL and ORA-01722
Hello11 G R1
When you run catupgrd.sql, I get:
DOC>#######################################################################
DOC>#######################################################################
DOC > the following statement will cause an "ORA-01722: invalid number."
DOC > error if the current time zone version file is not identical to the
DOC > version in the database to be upgraded. The statement will cause a
DOC > error ORA-00942 or ORA-00904 if the utility of pre-upgrade (utlu111i.sql)
DOC > has not be executed to update the database table $ registry to include the existing
DOC > the timezone database version.
DOC >
DOC > Shutdown ABORT and return to the original ORACLE_HOME. Then apply
DOC > patch version zone required to the original ORACLE_HOME
DOC > before attempting to upgrade. Restart utlu111i.sql after the application
DOC > patch to save the new version of the timzone file in the
DOC > table of the registry database $.
DOC >
DOC>#######################################################################
DOC>#######################################################################
DOC > #.
SELECT TO_NUMBER ('MUST_BE_SAME_TIMEZONE_FILE_VERSION')
*
ORA-01722: invalid number
But my version of zone is 4:
SQL > select * from v$ timezone_file;
FILENAME VERSION
------------ ----------
timezlrg.dat 4
And:
SQL > select status from v$ instance;
STATUS
------------
MIGRATE FROM OPEN
SQL > show user
USER "SYS".
SQL > select tablespace_name, status of dba_tablespaces;
STATUS TABLESPACE_NAME
------------------------------ ---------
ONLINE SYSTEM
UNDOTBS1 ONLINE
SYSAUX ONLINE
TEMP ONLINE
USERS ONLINE
ONLINE EXAMPLE
Any help?
Thank you.
Hmm, I think that the message would be:
DOC>#######################################################################
DOC>#######################################################################
DOC > the following statement will cause an "ORA-01722: invalid number."
DOC > error if the current time zone version file is not identical to the
DOC > version in the database to be upgraded. The statement will cause a
DOC > error ORA-00942 or ORA-00904 if the utility of pre-upgrade (utlu111i.sql)
DOC > has not be executed to update the database table $ registry to include the existing
DOC > the timezone database version.
DOC >
DOC > Shutdown ABORT and return to the original ORACLE_HOME. Then apply
DOC > patch version zone required to the original ORACLE_HOME
DOC > before attempting to upgrade. Restart utlu111i.sql after the application
DOC > patch to save the new version of the timzone file in the
DOC > table of the registry database $.
DOC >
DOC>#######################################################################
DOC>#######################################################################
DOC > #.
Tags: Database
Similar Questions
-
multi select sql problem - ORA-01722: invalid number
Hello
I have a multi select list and when I select only one item it works perfectly, but if I select several items, it gives an error. The sql statement is as below:
SELECT * VIEW WHERE INSTR (': ' |: P1_ID |': ',' :'||) ID: ': ') > 0
and I get the following error:
ORA-01722: invalid number
Here is some information on the display:
Name of the column
Data Type (NUMBER)
Nullable (No.)Hello
I just try this in my own sandbox application to sand...
Create report area with
SELECT t_id, t_code FROM t_table WHERE INSTR(':'||TO_CHAR(:P1_ID)||':', ':'||TO_CHAR(t_id)||':') > 0
as the source.
Create multiple selection list
SELECT t_code, t_id FROM t_table
as the source.
Create a button with application of GO, subordinate the region report on request = GB.
Now, I run the page, select a value in the list, click on go - region displays with the correct result.
Now I run the page, select several values in the list, click on go - region displays with good results.
What is your scenario? If so, it works for me...
See you soon
Ben
http://www.munkyben.WordPress.com
Don't forget to mark the answers useful or correct ;) -
Hello
I'm doing a validation test of principle with regard to the rights of the applicant. I created 2 diagrams of Test (DEFINER1 and INVOKER1) for the same thing. When I call a procedure in the Invoker1 Definer1 and the procedure has, in turn, a SQL statement inside that a PL/SQL function calls, so he get ORA-00904 "" is not a valid identifier. All procedures/packages in the scheme of Definer1 are created as the rights of the applicant. Simplified script below for the same, kindly let me know if I make a mistake, it's the expected behavior, or miss me something.
set line 10000
Set feedback off
------------------------------------------------------------------------------------------------------------------------------
QUICK problem: error ORA-00904: "object name": invalid identifier
CALLS while the use of the appellant's rights, procedure call PL/SQL that has a SQL that calls a PL/SQL function.
------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------
GUEST
GUEST
------------------------------------------------------------------------------------------------------------------------------
Creating patterns DEFINER1 and INVOKER1 QUICK...
GUEST
------------------------------------------------------------------------------------------------------------------------------
CREATE DEFINER1 USER IDENTIFIED BY DEFINER1
TEMPORARY TEMP TABLESPACE
/
GRANT CREATE SESSION TO DEFINER1
/
GRANT CREATE PROCEDURE FOR DEFINER1
/
CREATE INVOKER1 USER IDENTIFIED BY INVOKER1
TEMPORARY TEMP TABLESPACE
/
GRANT CREATE SESSION TO INVOKER1
/
GRANT CREATE PROCEDURE FOR INVOKER1
/
------------------------------------------------------------------------------------------------------------------------------
GUEST will now connect to the DEFINER1 schema...
GUEST
CONNECT DEFINER1/DEFINER1
------------------------------------------------------------------------------------------------------------------------------
Creating QUICK package (with rights of Summoners) with 2 functions simple (one with PRAGMA RESTRICT_REFERENCES another without him.)...
GUEST
------------------------------------------------------------------------------------------------------------------------------
CREATE or REPLACE PACKAGE global_pkg
AUTHID CURRENT_USER
AS
FUNCTION add2 (NUMBER of p1
NUMBER of p2
)
RETURN NUMBER;
FUNCTION add2_rr (NUMBER of p1
NUMBER of p2
)
RETURN NUMBER;
PRAGMA RESTRICT_REFERENCES (add2_rr, WNDS, WNPS, NSOR, RNP);
END global_pkg;
/
---------------------------------------------------------------
CREATE OR REPLACE PACKAGE BODY GLOBAL_PKG
AS
---------------------------------------------------------------
FUNCTION add2 (NUMBER of p1
NUMBER of p2
)
RETURN NUMBER
IS
BEGIN
RETURN (p1 + p2);
END add2;
---------------------------------------------------------------
FUNCTION add2_rr (NUMBER of p1
NUMBER of p2
)
RETURN NUMBER
IS
BEGIN
RETURN (p1 + p2);
END add2_rr;
---------------------------------------------------------------
END global_pkg;
/
------------------------------------------------------------------------------------------------------------------------------
ENCOURAGE creating stand-alone simple function (with rights of Summoners)...
GUEST
------------------------------------------------------------------------------------------------------------------------------
FUNCTION to CREATE or REPLACE add2 (NUMBER of p1
NUMBER of p2
)
RETURN NUMBER
AUTHID CURRENT_USER
IS
BEGIN
RETURN (p1 + p2);
END ADD2;
/
------------------------------------------------------------------------------------------------------------------------------
PROMPT creation of procedure (with rights of Summoners) who calls the Package and functions...
GUEST
------------------------------------------------------------------------------------------------------------------------------
CREATE OR REPLACE PROCEDURE pr_tester
AUTHID CURRENT_USER
IS
l_num NUMBER (2);
BEGIN
dbms_output.put_line (1 + 1 = ' | global_pkg.add2_rr (1,1));
BEGIN
SELECT global_pkg.add2_rr (1.1)
IN l_num
FROM DUAL;
dbms_output.put_line ('worked..');
EXCEPTION
WHILE OTHERS
THEN
dbms_output.put_line ('global_pkg.add2_rr wo' |) SQLERRM);
END;
dbms_output.put_line (1 + 1 = ' | global_pkg.) ADD2 (1,1));
BEGIN
SELECT global_pkg.add2 (1.1)
IN l_num
FROM DUAL;
dbms_output.put_line ('worked..');
EXCEPTION
WHILE OTHERS
THEN
dbms_output.put_line ('global_pkg.add2 wo' |) SQLERRM);
END;
dbms_output.put_line (1 + 1 = ' |) ADD2 (1,1));
BEGIN
SELECT add2 (1.1)
IN l_num
FROM DUAL;
dbms_output.put_line ('worked..');
EXCEPTION
WHILE OTHERS
THEN
dbms_output.put_line ('add2 wo' |) SQLERRM);
END;
END;
/
------------------------------------------------------------------------------------------------------------------------------
Grant QUICK overlooking the procedure to INVOKER1 scheme...
GUEST
------------------------------------------------------------------------------------------------------------------------------
GRANT EXECUTE ON pr_tester TO invoker1
/
------------------------------------------------------------------------------------------------------------------------------
Test QUICK 1: Define schema works...
GUEST
------------------------------------------------------------------------------------------------------------------------------
SET SERVEROUTPUT ON
BEGIN
pr_tester;
END;
/
------------------------------------------------------------------------------------------------------------------------------
GUEST
GUEST
GUEST
GUEST will now connect to the INVOKER1 schema...
GUEST
CONNECT INVOKER1/INVOKER1
------------------------------------------------------------------------------------------------------------------------------
Test FAST 2: Fails with ORA - 00904 define schema
------------------------------------------------------------------------------------------------------------------------------
SET SERVEROUTPUT ON
BEGIN
definer1.pr_tester;
END;
/
------------------------------------------------------------------------------------------------------------------------------
GUEST
GUEST
GUEST
INVITE to drop the two schemas, enter the password for the sys
------------------------------------------------------------------------------------------------------------------------------
CONNECT SYS AS SYSDBA
DROP USER CASCADE DEFINER1
/
DROP USER INVOKER1
/
------------------------------------------------------------------------------------------------------------------------------
GUEST
GUEST has dropped to users...
------------------------------------------------------------------------------------------------------------------------------
Thank you
Marie.
Basically, you know the answer...
Why you call procedure Tester pr_tester with the name of schema prefix (definer1.pr_tester) during his call of the schema of the invoker?
Now... Imagine the following query runs under the scheme of the appellant:
SELECT global_pkg.add2_rr (1.1)
IN l_num
FROM DUAL;
the schema of the invoker 'knows' global_pkg?
HTH
-
Error number return when and ORA: 01722 invalid
Hi people, I posted this under another topic as well as eBusiness suite so apologies if some you've seen, but I would really appreciate the help on this one. Any suggestions are welcome.
We strive to create a calculation that returns the number of days of absence a person has had in a given period of time. We need answer these absences which began before the period and are closed during it, lack that begins during the period and ends after she and those that open and close that it contains.
The period is always a rolling 6 months from sysdate.
It's the calc we found so far that works for some people, but we get the error invalid number if the absence includes a half-day - so 0.5, 1.5, etc..
It's probably more complicated, but we are not the techno at all so learn we will!
We use the business district of HRMS - Administration - Oracle Human Resources (Core) 10G and the folders present Absence and nobody.
SUM (TO_NUMBER (NVL ((CASES WHERE the Attendance.Actual Absence Start Date < TO_DATE (ADD_MONTHS (SYSDATE,-6), 'DD-Mon-YYYY') THEN (BOX WHEN presence Absence.)))) "" Actual end date ' > SYSDATE SO (WORKING_DAYS_BETWEEN (TO_DATE (ADD_MONTHS (SYSDATE,-6), 'DD-Mon-YYYY'), SYSDATE)) else (CASE WHEN (BOX WHEN TO_DATE (ADD_MONTHS (SYSDATE,-6), 'DD-Mon-YYYY') > = Absence Start Date of Attendance.Actual THEN (WORKING_DAYS_BETWEEN (TO_DATE (ADD_MONTHS (SYSDATE,-6), 'DD-Mon-YYYY'), presence of Absence.)))) (("" Actual end date ")) ELSE (CASE WHEN (WORKING_DAYS_BETWEEN (Start Date of Attendance.Actual of Absence, presence of Absence." Actual end date")) IS NULL SO (WORKING_DAYS_BETWEEN (Attendance.Actual of Absence Start Date, SYSDATE)) ELSE (BOX WHEN SYSDATE < = presence Absence.) "" Actual end date ' THEN (WORKING_DAYS_BETWEEN (Attendance.Actual of Absence Start Date, SYSDATE)) ELSE (WORKING_DAYS_BETWEEN (Start Date of Attendance.Actual of Absence, presence of Absence." (((Actual end date")) END) END) END) IS NULL SO (WORKING_DAYS_BETWEEN (TO_DATE (ADD_MONTHS (SYSDATE,-6), 'DD-Mon-YYYY'), SYSDATE)) else (BOX WHEN TO_DATE (ADD_MONTHS (SYSDATE,-6), 'DD-Mon-YYYY') > = Absence Start Date of Attendance.Actual THEN (WORKING_DAYS_BETWEEN (TO_DATE (ADD_MONTHS (SYSDATE,-6), 'DD-Mon-YYYY'), presence Absence.))) (("" Actual end date ")) ELSE (CASE WHEN (WORKING_DAYS_BETWEEN (Start Date of Attendance.Actual of Absence, presence of Absence." Actual end date")) IS NULL SO (WORKING_DAYS_BETWEEN (Attendance.Actual of Absence Start Date, SYSDATE)) ELSE (BOX WHEN SYSDATE < = presence Absence.) "" Actual end date ' THEN (WORKING_DAYS_BETWEEN (Attendance.Actual of Absence Start Date, SYSDATE)) ELSE (WORKING_DAYS_BETWEEN (Start Date of Attendance.Actual of Absence, presence of Absence." (((((Actual end date")) END) END) END) END) END) else (WHEN BOX (BOX WHEN TO_DATE (ADD_MONTHS (SYSDATE,-6), 'DD-Mon-YYYY') > = Absence Start Date of Attendance.Actual THEN (WORKING_DAYS_BETWEEN (TO_DATE (ADD_MONTHS (SYSDATE,-6), 'DD-Mon-YYYY'), presence Absence.)))) (("" Actual end date ")) ELSE (CASE WHEN (WORKING_DAYS_BETWEEN (Start Date of Attendance.Actual of Absence, presence of Absence." Actual end date")) IS NULL SO (WORKING_DAYS_BETWEEN (Attendance.Actual of Absence Start Date, SYSDATE)) ELSE (BOX WHEN SYSDATE < = presence Absence.) "" Actual end date ' THEN (WORKING_DAYS_BETWEEN (Attendance.Actual of Absence Start Date, SYSDATE)) ELSE (WORKING_DAYS_BETWEEN (Start Date of Attendance.Actual of Absence, presence of Absence." (((Actual end date")) END) END) END) IS NULL SO (WORKING_DAYS_BETWEEN (TO_DATE (ADD_MONTHS (SYSDATE,-6), 'DD-Mon-YYYY'), SYSDATE)) else (BOX WHEN TO_DATE (ADD_MONTHS (SYSDATE,-6), 'DD-Mon-YYYY') > = Absence Start Date of Attendance.Actual THEN (WORKING_DAYS_BETWEEN (TO_DATE (ADD_MONTHS (SYSDATE,-6), 'DD-Mon-YYYY'), presence Absence.))) (("" Actual end date ")) ELSE (CASE WHEN (WORKING_DAYS_BETWEEN (Start Date of Attendance.Actual of Absence, presence of Absence." Actual end date")) IS NULL SO (WORKING_DAYS_BETWEEN (Attendance.Actual of Absence Start Date, SYSDATE)) ELSE (BOX WHEN SYSDATE < = presence Absence.) (("" END END END END END actual end Date ' THEN (WORKING_DAYS_BETWEEN (Attendance.Actual of Absence Start Date, SYSDATE)) ELSE (lack Attendance.Duration days))), (DAYS_BETWEEN (Start Date of Attendance.Actual of Absence, presence of Absence." ((Actual end date'))), '999999990 D 00'))Hello
It could be that it's because you use SYSDATE that contains both as a fraction and not trunc (sysdate) that contains at present. It could be that your working_dates_between triggers this error.
However, your formula is much more complicated that it should be.
First of all, you want to watch the ADD_MONTHS (TRUNC (SYSDATE),-6) date at trunc (sysdate). So, you want to look the part of the absence which is located in the time stamp. It's the BIGGEST (Absence Attendance.Actual Start Date, ADD_MONTHS (TRUNC (SYSDATE),-6)) to LEAST (NVL (lack of attendance. (("" Actual end Date ", TRUNC (SYSDATE)), TRUNC (SYSDATE)). You may need to add 1 to the end of absence date because it is the last day of their absence, and not the date of their return. It depends on how you calculate the days between the beginning and the end
Date of the absence. You can create calculations for the date of beginning and end of the absences in the time window of 6 months. Create the AbsenceStart calculation asGreatest (attendance absence. Actual Start date, ADD_MONTHS (trunc (sysdate),-6))
and AbsenceEnd as
LESS (NVL (lack of attendance. (("" Actual end Date ", TRUNC (SYSDATE)), TRUNC (SYSDATE))
Next, you need to pick up only lack what part of the absence in your 6 months date window. To do this, you can use a condition in the workbook or a condition in a statement box. You must then calculate the difference between those dates and SUM all values.
SUM (CASE WHEN AbsenceEnd > = AbsenceStart THEN WORKING_DAYS_BETWEEN (AbsenceStart, AbsenceEnd) END)
That's all. Not so complicated after all.
Rod West
-
Strange ORA-01722: invalid number on viewCriteria
Hello
I defined in jDev 11.1.1.5 do with viewCriteria and everything works until I have migrate jDev 11.1.1.6. Now, I get this exception run this view
< Utils > < buildFacesMessage > ADF: addition of the JSF error message: ORA-01722: invalid number
java.sql.SQLSyntaxErrorException: ORA-01722: invalid number
After a few experiences, I found that this problem is viewCriteria, which is not so simple. It is used with condition NOT IN subquery.
(P_P_ID_FK NOT IN (SELECT P_ID of P where NVL (VALID_FROM, CURRENT_DATE) < = CURRENT_DATE))
I know that DOESN'T look good is not standard in ADF viewCriteria, but SQL work well. So tell me why there at - it SQLSyntaxErrorException!
When I remove that part or AppModule viewCriteria viewCriteria, then everything works.
Exception disappear even when I move the condition NOT IN with the main request viewCriteria subquery.
I tried to rewrite viewCriteria using NOT EXISTS, but there is no possibility of query from same table due to the inability of aliasing table names.
You have a work around?
Thank you.
Problem is resolved declaratively by manual editing of XML view this tutorial Andrejus Baranovskis Blog: implementation of criteria seen in Colombia - British ADF
-
Query SQL and Exception ORA-01722
Hello
I have a table called t_lookup that contains three columns of the argument lookup_value, Description and Lookup_Type they are all of type varchar2. If I run the query, its working fine below
SELECT *.
FROM (SELECT lookup_value
*, To_Number (Description) Dd *.
OF t_Lookup
WHERE Lookup_Type = 'CALENDAR') Tab ;
Here is the result
Lookup_value argument... DD
---------------------------------------.
January... 1
February... 2
March......................... 3
April........................... 4
May........................... 5
June.......................... 6
July........................... 7
August... 8
September... 9
October... 10
November... 11
December... 12
But when I run
SELECT *.
FROM (SELECT lookup_value
*, To_Number (Description) Dd *.
OF t_Lookup
WHERE Lookup_Type = 'CALENDAR') tab
AND Dd = 9;
then he throws exception ORA
ORA-01722: invalid number
Can someone help me on this in order to understand the cause of this problem? Oracle server that I use is "Oracle9i Release 9.2.0.8.0".
Thank youI guess it is expected that some of the descriptions will have non-numeric data, right?
Assuming that this is the case, the success or failure of the request depends on how the optimizer can choose to run your query. If it happens to run TO_NUMBER function before it filters a row with non-numeric data, you will get an error. When chasing the TO_NUMBER filtering all lines with non-numeric data, the query will be successful. Because query plans are subject to change, especially when you finally upgrade, you probably don't want just to find a SQL query that works, you will need to make sure that the query plan never changes or that the query is formulated in such a way that it will never fail.
My first thought would be to know if you really need store digital data in a field of VARCHAR2 in the first place. I guess it's a kind of generic lookup table (which causes a series of questions, what is a). Can we at least keep string, date and numbers given in separate columns?
Except, you can create your own function to PL/SQL that converts a string to a number and catches the exception?
CREATE OR REPLACE FUNCTION my_to_number( p_arg IN varchar2 ) RETURN NUMBER IS l_num NUMBER; BEGIN l_num := to_number( p_arg ); RETURN l_num; EXCEPTION WHEN others THEN RETURN NULL; END;
Who will ensure that the request is successful, regardless of the plan. Note that you probably want to catch just the error ORA-01722, not others, in your actual code - this is just a sample.
Except that, you will need to do something to strengthen stability in the query plan. A stored outline, which forces the query to use the query plan that does not generate an error.
Justin
-
SQL * Loader - rejected records - error on table ORA-01722: invalid number
Get the following errors:
Please tell me where I'm wrong?
The log file and extracts the data file with the control file is attached.
Also guide me please how I can download 4900 files at once?
-------------------------------------
SQL * Loader: release 11.1.0.7.0 - Production on Fri 14 Oct 03:06:06 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Control file: sample.ctl
Data file: Cities.csv
Bad leadership: Cities.bad
Discard File: none is specified
(Allow all releases)
Number of loading: ALL
Number of jump: 0
Authorized errors: 50
Link table: 64 lines, maximum of 256000 bytes
Continuation of the debate: none is specified
Path used: classics
Table CITY, loaded from every logical record.
Insert the option in effect for this table: INSERT
Column Position Len term Encl. Datatype name
------------------------------ ---------- ----- ---- ---- ---------------------
FIRST ID *, CHARACTER
35. ACCORDING TO NAME, ' CHARACTER
COUNTRYCODE 3, ' CHARACTER
THE NEXT POPULATION * CHARACTER WHT
Sheet 1: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 2: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 3: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Folder 4: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 5: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 6: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 7: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 8: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
File 9: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Case 10: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Factsheet 11: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 12: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
File 13: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Fact sheet 14: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Fact sheet 15: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 16: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
File 17: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 18: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
File 19: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 20: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 21: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Account 22: rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 23: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record number of 24: rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 25: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Fact sheet 26: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Fact sheet 27: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 28: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 29: rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 30: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record of 31: rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
• Statement 32: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 33: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Page 34: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 35: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 36: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 37: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 38: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 39: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 40: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 41: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Page 42: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 43: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 44: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 45: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
• Statement 46: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 47: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 48: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 49: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Page 50: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 51: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
NUMBER of MAXIMUM ERRORS EXCEEDED - above the statistics reflect partial performance.
CITY table:
0 rows successfully loaded.
51 lines not filled due to data errors.
0 rows not loading because all WHEN clauses were failed.
0 rows not populated because all fields are null.
The space allocated to bind table: 35840 bytes (64 lines)
Bytes of read buffer: 1048576
Total logical records ignored: 0
Total logical records read: 64
Total rejected logical records: 51
Total logical records ignored: 0
Run started on Fri 14 Oct 03:06:06 2011
Run finished Fri Oct 14 03:06:12 2011
Time was: 00:00:06.18
Time processor was: 00:00:00.03
----------------------------------------------------------------------
my control file (sample.ctl):
Load data infile 'Cities.csv '.
in the town of table
fields completed by «,»
(external id integer,
char (35) name box by ' ', '
CountryCode tank (3) box by ' ', '
external population integer terminated by '\n '.
)
my data (Cities.csv) file (it contains 4900 documents, but I show here just 4 records for ease)
3830, "Virginia Beach", "USA", 425257
3831, 'Atlanta', 'USA', 416474
3832, "Sacramento", "USA", 407018
3833, 'Oakland', 'USA', 399484
Thanks in advance!Watch when I have a little change your database as follows
1,'Kabul','AFG',1780000 2,'Qandahar','AFG','237500' 3,'Herat','AFG','186800'
I got the same error (last 2 rows rejected for the same number invalid error)
mhouri > select * from cities; ID NAME COU POPULATION ---------- ----------------------------------- --- ---------- 1 Kabul AFG 1780000 SQL*Loader: Release 10.2.0.3.0 - Production on Fri Oct 14 10:38:06 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. Control File: cities.ctl Data File: cities.dat Bad File: cities.bad Discard File: none specified (Allow all discards) Number to load: ALL Number to skip: 0 Errors allowed: 50 Bind array: 64 rows, maximum of 256000 bytes Continuation: none specified Path used: Conventional Table CITIES, loaded from every logical record. Insert option in effect for this table: INSERT Column Name Position Len Term Encl Datatype ------------------------------ ---------- ----- ---- ---- --------------------- ID FIRST * , CHARACTER NAME NEXT 35 , ' CHARACTER COUNTRYCODE NEXT 3 , ' CHARACTER POPULATION NEXT * WHT CHARACTER Record 4: Rejected - Error on table CITIES, column ID. Column not found before end of logical record (use TRAILING NULLCOLS) Record 2: Rejected - Error on table CITIES, column POPULATION. ORA-01722: invalid number Record 3: Rejected - Error on table CITIES, column POPULATION. ORA-01722: invalid number Table CITIES: 1 Row successfully loaded. 3 Rows not loaded due to data errors. 0 Rows not loaded because all WHEN clauses were failed. 0 Rows not loaded because all fields were null. Space allocated for bind array: 35840 bytes(64 rows) Read buffer bytes: 1048576 Total logical records skipped: 0 Total logical records read: 4 Total logical records rejected: 3 Total logical records discarded: 0 Run began on Fri Oct 14 10:38:06 2011 Run ended on Fri Oct 14 10:38:06 2011 Elapsed time was: 00:00:00.23 CPU time was: 00:00:00.09
Value of the population within the data file must be a number
Best regards
Mohamed Houri
-
ORA-01722: invalid number in SQL Loader
Hi all
CREATE TABLE SAMPL_TABLE
(
ITEM_CATEGORY VARCHAR2 (30 BYTES),
ITEM_NO VARCHAR2 (240 BYTES),
ITEM_DESCRIPTION VARCHAR2 (240 BYTES),
CLIENT_NAME VARCHAR2 (240 BYTES),
CUSTOMER_NO VARCHAR2 (240 BYTES),
VALID_AMOUNT_MONTH1 NUMBER,
VALID_UNITS_MONTH1 NUMBER,
VALID_BUDGET_AMOUNT_MONTH1 NUMBER,
VALID_BUDGET_UNITS_MONTH1 NUMBER,
ATTRIBUTE1 VARCHAR2 (240 BYTES),
ATTRIBUT2 VARCHAR2 (240 BYTES),
NUMBER OF VALID_RATE
);
Control file
Options (Errors = 10000, Skip = 3)
DOWNLOAD THE DATA
INFILE ' / home/appltest/Sheet1.csv'
BADFILE "sample.bad."
DISCARDFILE 'sample.dsc '.
REPLACE
IN THE TABLE sampl_table
fields completed by «,»
surrounded of possibly "" "
trailing nullcols
(
client_name TANK NULLIF client_name = BLANKS "RTRIM(:customer_name)."
customer_no NULLIF CHAR customer_no = BLANKS "RTRIM(:customer_no)."
item_no NULLIF TANK item_no = BLANKS "RTRIM(:item_no)."
valid_amount_month1 "to_number (: valid_amount_month1, '999,999,999.99')."
valid_units_month1 "to_number (substr (: valid_units_month1, instr(:valid_units_month1,'$') + 1), '999,999,999.99')."
valid_budget_units_month1 "to_number (: valid_budget_units_month1, '999,999,999.99')."
valid_budget_amount_month1 "to_number (trim (substr (: valid_budget_amount_month1, instr(:valid_budget_amount_month1,'$') + 1)), '999,999,999.99')."
valid_rate NULLIF CHAR valid_rate = BLANKS 'RTRIM(:valid_rate) '.
)
Sheet1.csv
Name of the cust Cust #. Article no. Item Desc Category Amount – month 1 Units - month 1 Act early Act early Budget - months 1 Budget - unit - months 1 Rate Name of the cust Cust #. Article no. Item Desc Category Amount – month 1 Units - month 1 Act early Act early Budget - months 1 Budget - unit - months 1 Rate Name of the cust Cust #. Article no. Item Desc Category Amount – month 1 Units - month 1 Act early Act early Budget - months 1 Budget - unit - months 1 Rate REYNU 1001 ABC001 ABC Renyu ABC 82 61 1 REYNU1 1028 ABC123 ABCRenyu123 ABC 295 1469 1 REYNU2 1028 ABC344 ABC Renyu 344 ABC 2270 6335 1 Get error below
Sheet 1: Rejected - error on the table SAMPL_TABLE, column VALID_RATE.
ORA-01722: invalid number
Sheet 2: Rejected - error on the table SAMPL_TABLE, column VALID_RATE.
ORA-01722: invalid number
Sheet 3: Rejected - error on the table SAMPL_TABLE, column VALID_RATE.
ORA-01722: invalid number
Sheet 1: Rejected - error on the table SAMPL_TABLE, column VALID_AMOUNT_MONTH1 .
ORA-01722: invalid number
Sheet 2: Rejected - error on the table SAMPL_TABLE, column VALID_AMOUNT_MONTH1 .
ORA-01722: invalid number
Sheet 3: Rejected - error on the table SAMPL_TABLE column VALID_AMOUNT_MONTH1
ORA-01722: invalid number
Can you help me please?
Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
Hello
No sign of setting shaped or ' $' is seen in the data, which is the reason why I guess you used the conversions in the * ctl file.
What is the problem with this symbol $ in the code?
No problem with the ' $'-what I mean is that it is not necessary.
Looking for him "$" field and exclude it from your text/number (SUBSTR) and if there is no "$" in your file, this additional training is not mandatory - why clutter up your code with unnecessary functions?
Regarding the error you get, it is related to the format mask, you provide:
Message #20:
Select to_number (substr (146, instr(146,'$') + 1), '999,999,999.99') of double
o/p: 146
Select to_number (substr (1469, instr(1469,'$') + 1), '999,999,999.99') of double
Error: ORA-01722: invalid number
1. you must use "146" (text) and no 146 (number).
2. ' 146' works because it "fits" the format mask you supplied: 999 999,999. 99. " but '1469' does not like the format mask expects one ',' as the delimiter of thousands, that is, "1 469'."
Select to_number (substr (1, 469', instr('1,469','$') + 1), '999,999,999.99') twice;
Similarly, in the #22 Post:
to_number (substr (' 752,3308', instr ('752.3308', ' $') + 1), 999, 999 999,99') of double
4 decimals are consistent with the format DP 2 mask.
Simply remove all masks of format.
-
Hi all
I was hoping you could help me. After a server restart scheduled that I tried to start my fundraiser, when I did, I got the following error:
09/29/14 10:19:36 Error executing command start_collector Internal Error at oracle.av.common.AuditException.toAuditException(AuditException.java:253) at oracle.av.management.impl.HttpManagementAdaptor.getData(HttpManagementAdaptor.java:259) at oracle.av.management.impl.HttpManagementAdaptor.getData(HttpManagementAdaptor.java:291) at oracle.av.management.impl.HttpManagementAdaptor.startCollector(HttpManagementAdaptor.java:434) at oracle.av.management.impl.ManagementServiceImpl.startCollector(ManagementServiceImpl.java:651) at oracle.av.management.impl.ManagementServiceImpl.startCollector(ManagementServiceImpl.java:696) at oracle.av.management.impl.ManagementServiceImpl.startCollector(ManagementServiceImpl.java:707) at oracle.av.avca.control.StartCollectorTask.executeTask(StartCollectorTask.java:82) at oracle.av.avca.backend.BaseTask.execute(BaseTask.java:104) at oracle.av.avca.Avctl.startCTL(Avctl.java:180) at oracle.av.avca.Avctl.main(Avctl.java:213) Nested Exception: java.sql.SQLException: ORA-28001: the password has expired at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:522) at oracle.av.common.AuditException.toAuditException(AuditException.java:250) at oracle.av.management.impl.HttpManagementAdaptor.getData(HttpManagementAdaptor.java:259) at oracle.av.management.impl.HttpManagementAdaptor.getData(HttpManagementAdaptor.java:291) at oracle.av.management.impl.HttpManagementAdaptor.startCollector(HttpManagementAdaptor.java:434) at oracle.av.management.impl.ManagementServiceImpl.startCollector(ManagementServiceImpl.java:651) at oracle.av.management.impl.ManagementServiceImpl.startCollector(ManagementServiceImpl.java:696) at oracle.av.management.impl.ManagementServiceImpl.startCollector(ManagementServiceImpl.java:707) at oracle.av.avca.control.StartCollectorTask.executeTask(StartCollectorTask.java:82) at oracle.av.avca.backend.BaseTask.execute(BaseTask.java:104) at oracle.av.avca.Avctl.startCTL(Avctl.java:180) at oracle.av.avca.Avctl.main(Avctl.java:213)
So I checked the database of Audit Vault and of course, uses that have expired there, Audit Vault users expire after 180 days.
SELECT username, account_status, expiry_date FROM dba_users WHERE account_status = 'EXPIRED';
I had a user "AGENT_BW3", which has expired. I also had the SYSAV & AVREPORTUSER that have expired. So I changed my profile and then reset the password for these uses to the same than what have been before
Now when I try to restart the collector, I get the following:
09/29/14 10:36:02 Error executing command start_collector Internal Error at oracle.av.common.AuditException.toAuditException(AuditException.java:253) at oracle.av.management.impl.HttpManagementAdaptor.getData(HttpManagementAdaptor.java:259) at oracle.av.management.impl.HttpManagementAdaptor.getData(HttpManagementAdaptor.java:291) at oracle.av.management.impl.HttpManagementAdaptor.startCollector(HttpManagementAdaptor.java:434) at oracle.av.management.impl.ManagementServiceImpl.startCollector(ManagementServiceImpl.java:651) at oracle.av.management.impl.ManagementServiceImpl.startCollector(ManagementServiceImpl.java:696) at oracle.av.management.impl.ManagementServiceImpl.startCollector(ManagementServiceImpl.java:707) at oracle.av.avca.control.StartCollectorTask.executeTask(StartCollectorTask.java:82) at oracle.av.avca.backend.BaseTask.execute(BaseTask.java:104) at oracle.av.avca.Avctl.startCTL(Avctl.java:180) at oracle.av.avca.Avctl.main(Avctl.java:213) Nested Exception: java.sql.SQLException: ORA-01017: invalid username/password; logon denied at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:522) at oracle.av.common.AuditException.toAuditException(AuditException.java:250) at oracle.av.management.impl.HttpManagementAdaptor.getData(HttpManagementAdaptor.java:259) at oracle.av.management.impl.HttpManagementAdaptor.getData(HttpManagementAdaptor.java:291) at oracle.av.management.impl.HttpManagementAdaptor.startCollector(HttpManagementAdaptor.java:434) at oracle.av.management.impl.ManagementServiceImpl.startCollector(ManagementServiceImpl.java:651) at oracle.av.management.impl.ManagementServiceImpl.startCollector(ManagementServiceImpl.java:696) at oracle.av.management.impl.ManagementServiceImpl.startCollector(ManagementServiceImpl.java:707) at oracle.av.avca.control.StartCollectorTask.executeTask(StartCollectorTask.java:82) at oracle.av.avca.backend.BaseTask.execute(BaseTask.java:104) at oracle.av.avca.Avctl.startCTL(Avctl.java:180) at oracle.av.avca.Avctl.main(Avctl.java:213)
Now of course I went on this issue the wrong way, is - that someone has encountered this problem before?
Just to add, I tried to connect with the same passwords for all users of Audit Vault in sqlplus and all work fine, its only the "start_collector" that has the problem.
Kind regards.
I fixed it by following these steps.
When the audit Vault database is created all users will see the profile by DEFAULT, it is a grace expires 180 days. I needed to reset user passwords that I did. The part that missed me, was that even if I put the passwords for what they had been before the expiry I still need to change the portfolio.
sqlplus SYSAVDVA/xx
-User AV_ADMIN
ALTER USER SYSAV IDENTIFIED BY xx;
-Server wallet
CD $ORACLE_HOME/network/admin/avwallet
AVCA create_credential - wrl. dbalias - av - usr SYSAV/xx
sqlplus SYSAVDVA/xx
-User AV_AGENT
ALTER USER IDENTIFIED BY AGENT_BW3 xx.
-Portfolio Officer
CD $ORACLE_HOME/network/admin/avwallet
AVCA create_credential - wrl. dbalias - av - usr AGENT_BW3/xx
This fixed the problem.
-
ORA-01722 PL/SQL: numeric string or the error value
Hi people;
I have an error with this request:
How to fix the PL/SQL ORA-01722: numeric value or error string?SELECT SEQ_ENTITE.nextval, ENT_CODE_ENT, ENT_GPL_ID, TO_NUMBER('2012')+1, pkg_etl_fdx.f_getseqexe('LPG_TYE', 'TYE_CODE_CON', ENT_CODE_TEN, 'TYE_SEQ', TO_NUMBER('2012')), ENT_LIB_ENT, ENT_SEUIL, 'O', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ENT_CODE_UNI, ENT_CODE_MERE, ENT_IND_FIN, 0, 0, 0, ENT_NIVEAU, ENT_CODE_TEN, CHAR_TO_LABEL('EXERCICE', 'PUB:EXE'||TO_NUMBER('2012')+1||':'), OLS_GRP FROM ENTITE WHERE ENT_OLS_EXE = TO_NUMBER('2012');
The description of the entity table:
Thank you.desc entite Nom NULL Type ------------- -------- ----------------- ENT_SEQ NOT NULL NUMBER(38) ENT_CODE_ENT NOT NULL VARCHAR2(6 CHAR) ENT_GPL_ID NOT NULL NUMBER(10) ENT_OLS_EXE NOT NULL NUMBER(38) ENT_TYE_SEQ NUMBER(38) ENT_LIB_ENT VARCHAR2(40 CHAR) ENT_SEUIL NUMBER(3) ENT_AUTO_DEP VARCHAR2(1 CHAR) ENT_TOT_REP FLOAT(126) ENT_TREC_VEN FLOAT(126) ENT_TREC_INT FLOAT(126) ENT_RPT_ANT FLOAT(126) ENT_TOT_VEN FLOAT(126) ENT_CUM_REP FLOAT(126) ENT_CREC_INT FLOAT(126) ENT_CRPT_ANT FLOAT(126) ENT_CCRE_RCU FLOAT(126) ENT_TOT_ENG FLOAT(126) ENT_TOT_FAC FLOAT(126) ENT_TDEP_INT FLOAT(126) ENT_TOT_DEM FLOAT(126) ENT_TOT_RES FLOAT(126) ENT_CODE_UNI VARCHAR2(6 CHAR) ENT_CODE_MERE VARCHAR2(6 CHAR) ENT_IND_FIN VARCHAR2(1 CHAR) ENT_TOT_ATT FLOAT(126) ENT_CUM_ATT FLOAT(126) ENT_CUM_REA FLOAT(126) ENT_NIVEAU NUMBER(1) ENT_CODE_TEN VARCHAR2(2 CHAR) OLS_EXERCICE NUMBER(10) OLS_GRP NUMBER(10)
select 'PUB:EXE'|| to_char(TO_NUMBER('2012')+1 )||':' from dual
Kind regards
Gena -
Hello
I get error java.sql.SQLException: ORA-01017: name of user and password invalid. connection refused
When I'm trying to run my Unix server. The same scenario when executing designer works very well... nobody knows what username and password... its looking for?
Thank you
VincentIt is the odiparams.sh of the unix server is updated and configured.
-
java.sql.SQLException: ORA-06550 and ORA-00900 call stored procedures
Hi all
I have 2 a stored procedures that I want to call from my Session bean. One of them takes a few settings, but not the other. When I call the procedures, I get the following errors described below. I tested the two stored procedures in sql plus and sqldveleoper and they work well. The funniest, it is, I have another stored procedure that I can call successfully from the same bean in session with no problems, so I'm a bit confused as to why his play now.
I use stand-alone 10.1.3.4 OC4J and Oracle 10 g Db 10.2.0.4 and platform DB that I use is Oracle10gPlatform and Eclipselink as my JPA provider. I have also tried against toplink (not toplink essentials) and still no joy
Here is the error I get when I try and call the procedure which takes the parameters of the session bean
Here are my stored procedure that take parametersInternal Exception: java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'HASHDATA' ORA-06550: line 1, column 7: PL/SQL: Statement ignored Error Code: 6550 Call: BEGIN HashData(input=>?, hashedValue=>?, hashed=>?); END; bind => [password1, => hashedValue, => hashed] Query: DataReadQuery()
Here is my code in the session bean to call the procedure that takes as parameters (Hashdata)create or replace procedure hashData(input IN VARCHAR2, hashedValue OUT BLOB, hashed OUT BOOLEAN) as inputRaw RAW(2000); --hashed BOOLEAN := false; begin dbms_output.put_line('the data to be hashed is '||input); dbms_output.put_line('converting input to raw ...'); inputRaw := utl_i18n.string_to_raw(input,'AL32UTF8'); dbms_output.put_line('Hashing Data ...'); hashedValue := DBMS_CRYPTO.Hash (src=>inputRaw,typ=>DBMS_CRYPTO.HASH_SH1); dbms_output.put_line('hash is '||UTL_I18N.raw_to_char(dbms_lob.substr(hashedValue, 4000,1))); if (hashedValue is not null) then hashed :=true; dbms_output.put_line('hashedValue IS NOT null'); else hashed := false; dbms_output.put_line('hashedValue IS null'); end if; end;
When I call the other takes no parameters, I get the following error.public UserBean() { // TODO Auto-generated constructor stub sessMan = SessionManager.getManager(); session = sessMan.getSession("Session", Thread.currentThread() .getContextClassLoader()); } public Serializable hashData(String input){ logger.debug("Hashing Data ... "); hashedValue= null; boolean hashed=false; StoredProcedureCall call = new StoredProcedureCall(); ValueReadQuery query = new ValueReadQuery(); call.setProcedureName("HashData"); call.addNamedArgumentValue("input", input); call.addNamedOutputArgument("hashedValue", "hashedValue", java.sql.Blob.class); call.addNamedOutputArgument("hashed", "hashed", java.lang.Integer.class); query.addArgument("input"); query.setCall(call); session.executeQuery(query); if ((Boolean)hashed){ logger.debug("The data has been hashed and the hash value is: "+hashedValue); } else{ logger.debug("The data has could not be hashed"); hashedValue=null; } return (Serializable)hashedValue; }
Here is the procedure which takes no parametersInternal Exception: java.sql.SQLException: ORA-00900: invalid SQL statement Error Code: 900 Call: BEGIN testJPAProc(); END; Query: DataReadQuery()
Heres is the code to call procedures that take no parameterscreate or replace procedure testJPAProc is begin dbms_output.put_line('testJPAProc called'); end;
You guys can tell me where I'm wrong if I do something wrong. Why make these mistakes? because as far as I can tell the code (java and pl/sql) are both correct unless there is something I missed. It's kinda funny because I have another stored procedure I can call successfully.StoredProcedureCall call = new StoredProcedureCall(); ValueReadQuery query = new ValueReadQuery(); call.setProcedureName("testJPAProc"); query.setCall(call); session.executeQuery(query);
Thank youThe first question is that the Boolean in Oracle is not a supported JDBC type, but a PLSQL type.
Change to an INTEGER is probably the best, you can also use the PLSQLStoredProcedureCall class to access.The second problem is perhaps that the stored procedure is not valid, make sure that it compiled correctly. It can also be the type of your query, you must use a DataModifyQuery, not a read request that it returns nothing.
If still no luck, try to call directly through JDBC, it works?---
James: http://www.eclipselink.org: http://en.wikibooks.org/wiki/Java_Persistence -
ORA-01722: invalid number
I get the error: ORA-01722: invalid number during the execution of the SQL statement.
SELECT
TO_NUMBER (TO_CHAR ((TRUNC(:P_DATE1,'MM')-1), "MM")) LAST_MON
OF THE DOUBLE
Sanjay
I'll guess that you write an APEX application.
In the APEX, the variables are always strings. If you want to interpret as dates, you should pack them with a call TO_DATE and a format mask. Assuming that you stated your control APEX of date in MM/DD/YYYY format, it would mean that the SQL, you would need is
SELECT TO_NUMBER(TO_CHAR((TRUNC( TO_DATE(:P_DATE1, 'MM/DD/YYYY'),'MM')-1),'MM')) LAST_MON FROM DUAL
Of course, if you're just trying to extract the month to date and subtract 1, I just have
SELECT extract( month from to_date( :p_date1, 'MM/DD/YYYY') ) - 1 FROM dual
Justin
-
ORA-01722: number not valid only in where clause
I'm getting ORA-01722: invalid number when you use to_number in where clause:
I don't get it without where clause (300 rows returned):select to_number(txt_field) from tbl where 100>=to_number(txt_field);
No logical explanation?select to_number(txt_field) from tbl;
Published by: totalnewby on February 21, 2012 04:54totalnewby wrote:
No logical explanation?Let me guess - tbl is actually a point of view:
SQL> create table tbl(code varchar2(10),val varchar2(10)); Table created. SQL> insert into tbl values('string','abc'); 1 row created. SQL> insert into tbl values('number','123'); 1 row created. SQL> create or replace 2 view tbl_vw 3 as 4 select * 5 from tbl 6 where code = 'number' 7 / View created. SQL> select to_number(val) 2 from tbl_vw 3 / TO_NUMBER(VAL) -------------- 123 SQL> select to_number(code) 2 from tbl_vw 3 where to_number(val) > 100 4 / select to_number(code) * ERROR at line 1: ORA-01722: invalid number SQL>
Reason is first selection from the first filters view (find out where clause) out of the non-numeric values and then only apply to_number. When the second select is run optimizer merges the view definition and where would adopt becomes:
where where code = 'number '.
and to_number (val) > 100Since there is no order of predicate, it happens that to_number (val) > 100 is applied first, and he obviously fails.
SY.
-
ORA-01722: error number invalid coming in Oracle 10 g.
Hello
We get the error "ORA-01722: invalid number" when opening a cursor using the CURSOR for LOOP.
This error started only after we migrated to Oracle 10 g to Oracle 9i. Earlier, the same code used to work properly. And also on Oracle 10 g, this is not not the case every time. Sometimes, it gives error while sometimes it works.
Does anyone know about any such bug in Oracle 10 g. Our cursor is a cursor parameterized accepting a VARCHAR2 parameter and the value that we have to it is also character.
Our Oracle 10 g Enterprise Edition Release 10.2.0.3.0 - 64 bit Production database and runs on the UNIX server.And also on Oracle 10 g, this is not not the case every time. Sometimes, it gives error while sometimes it works.
This is usually due to
(a) environment settings that differ from one session to the next
(b) or, more often, dataThe error means that Oracle expects a number and that it is unable to get an entry (data or SQL or bind variable) number provided. I agree with William that she looks a lot like implicit conversion TO_NUMBER() failure.
Why not add a debugging code exception handler? When this exception occurs, the dump of the PL/SQL and call stack values of all variables and parameters of a table/record of debugging (using a standalone transaction).
Maybe you are looking for
-
clear history graphic waveform dynamic data 1 d are used
I'm new to Labview and uses a waveform graph. To clear what I need to provide a table empty. I did it with scalars entered, but in this case, the entrance to the chart is a table 1 d of dynamic data beam. I can't understand how create a table empty
-
synchronization of a listbox and a chart legend
Hi all I'm working on a code where I would be able to select/deselect 50 locations on a XY Chart. Due to the relatively large number of field names, it makes sense to place them in a scrolling caption or listbox. Problem is (AFAIK), the legend of th
-
Error codes: A 80071, 91 & 643 (cannot install updates)
I had this problem for about a month.
-
I downloaded books from my computer on my corner several times via Adobe Digital. Today, Windows is not recognize as my Nook is connected to the computer. The cord shows power at the end of the meal.
-
CustomSqlDataSource cascading.
I'm trying to implement the example of quotes application CustomSqlDataSource. I tried to copy the customsqldatasource.cpp and customsqldatasource.h in the folder src but the customsqldatasource.cpp is to launch a large number of errors mSqlConnector