Htmldb_item.select_list_from_query-report error: ORA-01722: invalid number
Hi, i am trying to create a tabular form
with one of the item's value depending on another item's value, but i have an ORA-01722: invalid number error
my application is:
DESC AC6LIS
ACLIS_SEQ_ID NOT NULL NUMBER(10)
ACLIS_TSG_ID NOT NULL VARCHAR2(5)
ACLIS_EDZ_ID NOT NULL VARCHAR2(3)
DESC VE1EDZ
EDZ_TSG_ID NOT NULL VARCHAR2(5)
EDZ_ID NOT NULL VARCHAR2(3)
EDZ_DESCRIZ VARCHAR2(50)
select ACLIS_TSG_ID, htmldb_item.select_list_from_query(2,ACLIS_EDZ_ID,'select EDZ_DESCRIZ, EDZ_ID from ve1edz where ve1edz.EDZ_TSG_ID ='||ac6lis.ACLIS_TSG_ID) edz_select_list from ac6lis
Any Help?
Thans in advance
Costantino
When your inner SELECT statement is firing it is doing a type conversion. It is seeing a number value in 'ac6lis.ACLIS_TSG_ID' and trying to do a number comparison with 've1edz.EDZ_TSG_ID'. 've1edz.EDZ_TSG_ID' has a non-numeric value in one of the rows which results in your error. To correct this place quotes around the value of 'ac6lis.ACLIS_TSG_ID' like:
select ACLIS_TSG_ID,
htmldb_item.select_list_from_query(2,ACLIS_EDZ_ID,'select EDZ_DESCRIZ, EDZ_ID from ve1edz where ve1edz.EDZ_TSG_ID ='''||ac6lis.ACLIS_TSG_ID||'''') edz_select_list
from ac6lisMike
Similar Messages
-
Error: ORA-01722: invalid number performing List of Values query.
when i created a cascading select list, For the first time it worked properly then little later
it is giving this error.
Error: ORA-01722: invalid number performing List of Values query: "select distinct cl_name d, cl_no r from Kclient where gr_no = :P1_GRNO order by 1
could any one please solve the problem?
2. when i run the application. in all the items edit button is automatically seen
including in the login screen.
could any one identify what is the error and give me a solution.Is this better?
select DISTINCT FIRST_NAME||' '||LAST_NAME display_value
, ROW_ID return_value
from "PSA_RESOURCE_MANAGER"
where PSA_RESOURCE_MANAGER.ACTIVE_FLAG='Y'
AND :P117_REPORTING_MANAGER = PSA_RESOURCE_MANAGER.REPORTING_MANAGER
AND :P117_REPORTING_MANAGER <> -1 order by 1or
select DISTINCT FIRST_NAME||' '||LAST_NAME display_value
, ROW_ID return_value
from "PSA_RESOURCE_MANAGER"
where PSA_RESOURCE_MANAGER.ACTIVE_FLAG='Y'
AND :P117_REPORTING_MANAGER = PSA_RESOURCE_MANAGER.REPORTING_MANAGER
AND :P117_REPORTING_MANAGER != '-1' order by 1Is ROW_ID a column in your table by the way? If not, you should use ROWID (without the underscore) -
Insert into table error - ora-01722 invalid number
Need some assistance with inserting data into a table. The date column keeps on failing to insert.
here is my insert statement
insert into tab_mod_history (TABLE_OWNER, TABLE_NAME, PARTITION_NAME, SUBPARTITION_NAME, INSERTS, UPDATES, DELETES, TIMESTAMP, TRUNCATED)
values ('$i_owner','$i_table','$i_part_name','$i_subpart_name','$i_ins','$i_upd','$i_del','$time','$trunc');Script loads data for partition tables, but not normal tables with the timestamp column
I select the data using this select statement:
select table_owner, table_name, partition_name, subpartition_name, inserts, updates, deletes, timestamp, truncated
from dba_tab_modifications
where table_owner in ('scott','MAC')
order by table_name;ok here are the errors:
values ('MAC','WC_MST','11','1','1','12/04/2011','NO','','')
ERROR at line 2:
ORA-01722: invalid number
Session altered.
values ('MAC','WF_05A','208','128','208','18/02/2011','NO','','')
ERROR at line 2:
ORA-01722: invalid numberHere is the table structure
SQL> desc tab_mod_history
Name Null? Type
TABLE_OWNER VARCHAR2(30)
TABLE_NAME VARCHAR2(30)
PARTITION_NAME VARCHAR2(30)
SUBPARTITION_NAME VARCHAR2(30)
INSERTS NUMBER
UPDATES NUMBER
DELETES NUMBER
TIMESTAMP DATE
TRUNCATED VARCHAR2(3)
DROP_SEGMENTS NUMBERI used the column names to create the variables..that is why $time was used.
How else could I have done it????
thought this was easy..but to my dismay... -
Error ORA-01722: invalid number
Hi,
I am using Apex 3.2 on Oracle 11g (Enterprise Edition).
I am new to Apex and I am using an imported application and editing its features to match my requirements.
While uploading a CSV file, I am getting error as :ORA-01722: invalid number"
Can someone help me where I am wrong or where I need to modify something?
Thanks in advance.
Regards
SharathHi Littlefoot,
Another set of information which I felt could be useful.
In "Home>Application Builder>Application 1000>Page 71>Edit Page Process", under the tab 'Source', I could see the below code. I think I need to make changes here. Please correct me if I am wrong here.
I need your help to modify this code (as this is an imported application, this code might be written keeping in mind the previous application).
--PLSQL code for uploading server details
DECLARE
v_blob_data BLOB;
v_blob_len NUMBER;
v_position NUMBER;
v_raw_chunk RAW(10000);
v_char CHAR(1);
c_chunk_len NUMBER:= 1;
v_line VARCHAR2 (32767):= NULL;
v_data_array wwv_flow_global.vc_arr2;
v_rows NUMBER;
v_count NUMBER;
--for editing
v_sr_no NUMBER:=1;
v_last_char varchar2(2);
BEGIN
-- Read data from wwv_flow_files
SELECT blob_content INTO v_blob_data FROM wwv_flow_files
WHERE last_updated = (SELECT MAX(last_updated) FROM wwv_flow_files WHERE UPDATED_BY = :APP_USER)
AND id = (SELECT MAX(id) FROM wwv_flow_files WHERE updated_by = :APP_USER);
v_blob_len := dbms_lob.getlength(v_blob_data);
v_position := 1;
-- For removing the first line
WHILE ( v_position <= v_blob_len )
LOOP
v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
v_position := v_position + c_chunk_len;
-- When a whole line is retrieved
IF v_char = CHR(10) THEN
EXIT;
END IF;
END LOOP;
-- Read and convert binary to char
WHILE ( v_position <= v_blob_len )
LOOP
v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
v_line := v_line || v_char;
v_position := v_position + c_chunk_len;
-- When a whole line is retrieved
IF v_char = CHR(10) THEN
--removing the new line character added in the end of each line
v_line := substr(v_line, 1, length(v_line)-2);
--removing the double quotes
v_line := REPLACE (v_line, '"', '');
--For checking the absense of data in the end of line
v_last_char:= substr(v_line,length(v_line),1);
IF v_last_char = CHR(44) THEN
v_line :=v_line||'-';
END IF;
-- Convert each column separated by , into array of data
v_data_array := wwv_flow_utilities.string_to_table (v_line, ',');
-- Insert data into target tables
--Checking whether the data already exist
SELECT COUNT(SERVERID) INTO v_count FROM REPOS_SERVERS WHERE SERVERNAME=v_data_array(1);
IF v_count = 0 THEN
EXECUTE IMMEDIATE 'INSERT INTO
REPOS_SERVERS (SERVERID,SERVERNAME,IPADDRESS,OS,SERVER_MODEL,CPU,MEMORY,PLATFORM_TYPE, MACHINE_TYPE,CLUSTERED,LAST_UPDATE_BY,LAST_UPDATE_DATE,REMARKS) VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13)'
USING
SERVERS_SEQ.NEXTVAL,
v_data_array(1),
v_data_array(2),
v_data_array(3),
v_data_array(4),
to_char(NVL(v_data_array(5),NULL)),
v_data_array(6),
v_data_array(7),
v_data_array(8),
v_data_array(9),
v_data_array(10),
v_data_array(11),
v_data_array(12);
END IF;
-- Clearing out the previous line
v_line := NULL;
END IF;
END LOOP;
END;
Regards
Sharath -
Getting ORA-01722 - Invalid number error in SQL
I am trying to run a query like
SELECT NVL (ic.industryclassdesc, 'NULL') industryclass,
NVL (hci.updated_by, 'NULL') updatedby,
NVL (hci.operation, 'NULL') operation,
hci.audittimestamp audittimestamp
FROM xxx_company_inxxxx hci, xxx_industry ic
WHERE hci.company_id = 9079496
AND ic.industryclassid = hci.industryclass_id
ORDER BY DECODE (hci.operation, 'D', 'X', hci.operation), hci.audittimestamp
And getting the error - ORA-01722 - Invalid number.
But the columns - ic.industryclassid, hci.industryclass_id and also hci.company_id are 'Number' datatype and also not nullable.
Can anyone suggest a approchSELECT NVL (ic.industryclassdesc, 'NULL')
> industryclass,
NVL (hci.updated_by, 'NULL') updatedby,
NVL (hci.operation, 'NULL') operation,
hci.audittimestamp audittimestamp
xxx_company_inxxxx hci, xxx_industry ic
WHERE hci.company_id = 9079496
AND ic.industryclassid = hci.industryclass_id
BY DECODE (hci.operation, 'D', 'X', hci.operation),
hci.audittimestamp
And getting the error - ORA-01722 - Invalid number.
Do not enter 'String' in the nvl function,if the column is number datatype,
venki
null -
Varchar to number returns a ORA-01722-Invalid Number error
I have a script where i am converting a varchar to number to be compared against a number.
(To_Number(p.result_value,'999999.99') < 0 OR p.result_value < 0)
this particular line is causing the error ORA-01722-Invalid Number.
Is there any ideas as to why this happens and how I can resolve?
Thanks in advance!The result_value column in Pay_Run_Result_Values is a varchar2 field.
So you need to put in some additional logic to make sure that the row is having numbers alone before doing to_number.
Cheers
Ganesh -
ORA-01722: invalid number error coming in Oracle 10g.
Hi,
We are getting the error "ORA-01722: invalid number" while opening a cursor using CURSOR FOR LOOP.
This error has started coming only after we have migrated to Oracle 10g from Oracle 9i. Earlier the same code used to work properly. And also on Oracle 10g, its not happening every time. Sometimes it gives error while sometimes it works.
Does anybody know about any such bug in Oracle 10g. Our cursor is a parametrized cursor accepting a VARCHAR2 parameter and the value we are passing to it is also character.
Our database is Oracle 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production and is running on UNIX server.And also on Oracle 10g, its not happening every time. Sometimes it gives error while sometimes it works. This is typically due to
a) environment settings that differ from session to session
b) or more often, data
The actual error means that Oracle expects a number and is unable to obtain a number from the input (data or SQL or bind variables) supplied. I agree with William that it looks a lot like an implicit TO_NUMBER() conversion failing.
Why not add a debug exception handler to the code? When that exception occurs, dump the PL/SQL call stack and values of all variables and parameters to a debug/logging table (using an autonomous transaction). -
Getting error as ORA-01722: invalid number
Hi below is my query
select count(1) from table1 where table1.rqstid = '83041' AND table1..score_name = 'Small Business Credit Risk Score' AND
to_number(table1.total_score) >= '70' and rownum<2
I tried to convert '70' to 70, but still I got ame error.
In table1 total_score is varchar2(30) data type, but for this rqstid the data is 420, so it should convert 420 to number and compare with 70.
But why I am getting this error? Please help.
If I remove to_number conversion fot total score then this error is not coming, but this will not give correct result for me.
Thanks.CREATE TABLE SBE_SCORE (
RQSTID VARCHAR2 (30) NOT NULL,
SCORE_NAME VARCHAR2 (300),
TOTAL_SCORE VARCHAR2 (30),
RISKLEVEL VARCHAR2 (30),
SUBSCRIBER_ID NUMBER (10))
INSERT INTO SBE_SCORE ( RQSTID, SCORE_NAME, TOTAL_SCORE, RISKLEVEL,
SUBSCRIBER_ID ) VALUES (
'83041', 'Small Business Credit Risk Score for Financial Services', '420', NULL, NULL);
My Query was
SELECT
count(1)
FROM
sbe_score
WHERE
sbe_score.rqstid = '83041' AND
sbe_score.score_name = 'Small Business Credit Risk Score for Financial Services' AND
to_number(sbe_score.total_score) >= '70' and
rownum<2
Error:ORA:01722 Invalid Number
Now I have modified as below and I am able to get correct results
SELECT
count(1)
FROM
sbe_score
WHERE
sbe_score.rqstid = '83041' AND
sbe_score.score_name = 'Small Business Credit Risk Score for Financial Services' AND
to_number(translate(lower(sbe_score.total_score),'abcdefghijklmnopqrstuvwxyz@._','0'))>= 70 and
rownum<2
I I omit r in the translate function then I am getting same error Invalid number, So just I want to know whether the data 420 for total_score is taking "r" internally? withou our knowledge? -
ORA-01722: invalid number performing List of Values query
I have a situation here where I want to pass string value(available in search field) to POP up key LOV on another page as default value.
I passed item value in default field in POPup key LOV item.I am able to see string value but It also gave me following error.
Error: ORA-01722: invalid number performing List of Values query: "select CUSTOMER_NAME, CUSTOMER_ID from (select customer_name, customer_id from hed_customers) wwvlovinlineviewname where CUSTOMER_ID = :WWV_LOV_RETURN_KEY_UTIL_1111".
Without Default value, it work like champ.
Please suggest how to get rid of this error
Thanks in advanceI hit the same problem.
The thing is that, in APEX, a 'null' value in a form is not really null but gets passed on as '%'.
When that gets compared to a number, 01722 will occur.
A workaround is to define a 'value if null' that is an implicit number, like '-1'.
And lets hope no one ever uses that as a real ID...
Cheers
Peter -
Oracle SQL Developer 1.1.1.25.14, I rror ORA-01722 Invalid Number
I have installed the new version of Oracle SQL Developer 1.1.1.25.14, I use Oracle 9.2. When I browse in the tree of the stored procedures and compile I obtain Error ORA-01722 Invalid Number. The previous version does not give this error. I have tried to change the decimal separator to comma ',' and point '.' but this error always appears.
create or replace
PROCEDURE getAge (
dtmDataStart_in IN DATE,
dtmDataEnd_in IN DATE,
intYears_out OUT NUMBER,
intMonths_out OUT NUMBER,
intDays_out OUT NUMBER) AS
-- Calcola il numero di anni, mesi, giorni intercorsi
-- dalla data iniziale alla data finale.
-- Se la data iniziale è > della data finale, le due date
-- vengono scambiate e le variabili di output vengono ritornate
-- con segno negativo.
--==================================================
-- Data Ultima Modifica: 31/07/98
-- Aggiunta procedura per il calcolo della differenza tra
-- due date dello stesso anno.
--==================================================
-- DICHIARAZIONE VARIABILI INIZIO --------------------------------------------------------
intYMDStart NUMBER(10);
intYMDEnd NUMBER(10);
intYMD NUMBER(10);
intDiffAnni NUMBER(5);
intDiffMesi NUMBER(5);
intDiffGiorni NUMBER(5);
intMeseStart NUMBER(5);
intAnnoStart NUMBER(5);
intTotGiorniMeseStart NUMBER(5);
ysnNegativo NUMBER(5);
-- DICHIARAZIONE VARIABILI FINE ----------------------------------------------------------
BEGIN
intYMDStart := TO_NUMBER( TO_CHAR(dtmDataStart_in,'YYYYMMDD'));
intYMDEnd := TO_NUMBER( TO_CHAR(dtmDataEnd_in,'YYYYMMDD'));
ysnNegativo := 0;
IF intYMDStart = intYMDEnd THEN
intYears_out := 0;
intMonths_out := 0;
intDays_out := 0 ;
ELSE
IF intYMDStart > intYMDEnd THEN
intYMD := intYMDStart;
intYMDStart := intYMDEnd;
intYMDEnd := intYMD;
ysnNegativo := -1;
END IF;
intDiffAnni := TO_NUMBER(TO_CHAR(dtmDataEnd_in,'YYYY')) - TO_NUMBER(TO_CHAR(dtmDataStart_in ,'YYYY'));
intDiffMesi := TO_NUMBER(TO_CHAR(dtmDataEnd_in,'MM')) - TO_NUMBER(TO_CHAR(dtmDataStart_in ,'MM'));
intDiffGiorni := TO_NUMBER(TO_CHAR(dtmDataEnd_in,'DD')) - TO_NUMBER(TO_CHAR(dtmDataStart_in ,'DD'));
-- I valori cosi' calcolati di intDiffAnni, intDiffMesi e intDiffGiorni vanno bene
-- ad eccezione dei seguenti casi:
-- Sistemo intDiffAnni
IF (intDiffMesi > 0 OR (intDiffMesi = 0 AND intDiffGiorni >= 0)) THEN
-- intDiffAnni e' OK
intDiffAnni := intDiffAnni;
ELSE
-- non e' ancora arrivato il giorno del compleanno
intDiffAnni := intDiffAnni-1;
END IF;
-- Sistemo intDiffMesi
IF (intDiffMesi > 0 AND intDiffGiorni < 0) THEN
intDiffMesi := intDiffMesi-1;
ELSIF (intDiffMesi < 0 ) THEN
if(intDiffGiorni<0) THEN
intDiffMesi := intDiffMesi+11;
else
intDiffMesi := intDiffMesi+12;
END IF;
ELSIF (intDiffMesi=0 AND intDiffGiorni<0) THEN
intDiffMesi:=11;
END IF;
-- Sistemo intDiffGiorni
-- Calcolo i giorni come (TotGiorniMeseIniziale - GiornoIniziale) + (GiornoFinale - 0)
-- che e' uguale a fare TotGiorniMeseIniziale + (GiornoFinale-GiornoIniziale)
IF intDiffGiorni < 0 THEN
intMeseStart := TO_NUMBER(TO_CHAR(dtmDataStart_in ,'MM'));
IF intMeseStart IN (1,3,5,7,8,10,12) THEN
intTotGiorniMeseStart := 31;
ELSIF intMeseStart = 2 THEN
-- Da enciclopedia: sono bisestili gli anni multipli di 4
-- esclusi i secoli che non sono multipli di 400 (Parte commentata).
intAnnoStart := TO_NUMBER(TO_CHAR(dtmDataStart_in ,'YYYY'));
if (intAnnoStart MOD 4) = 0
-- AND NOT ((intAnnoStart MOD 100) = 0 AND (intAnnoStart MOD 400) <> 0)
Then
intTotGiorniMeseStart := 29;
else
intTotGiorniMeseStart := 28;
end if;
ELSIF intMeseStart IN (4,6,9,11) THEN
intTotGiorniMeseStart := 30;
END IF;
intDiffGiorni := intDiffGiorni + intTotGiorniMeseStart;
END IF;
IF ysnNegativo = 0 THEN
intDays_out := intDiffGiorni;
intMonths_out := intDiffMesi;
intYears_out := intDiffAnni;
ELSE
intDays_out := intDiffGiorni * (-1);
intMonths_out := intDiffMesi * (-1);
intYears_out := intDiffAnni * (-1);
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getAge;
The output result of compilation is "GETAGE Compiled", I think the 01722 error is not caused from an sql syntax error, but probably caused from an invalid or unsupported or 'strange' configuration on nationalization... the fact surprises me that the previous version did not give problems
THANKS SO MUTCH
*/ -
ORA-01722: Invalid number when importing .csv file
Hi,
I did not find any information regarding my specific problem until now.
I try to import a *.csv file containing id, double, double, double, double, double (e.g. as a sample line "id_1, 674,6703459157907, 4212,205538937771, 674,6703459158016, 5561,546230769363, 2714,6367797576822") into a table with the following definition:
CREATE TABLE "foo"."BUILDING_SURFACES"
( "ID" VARCHAR2(40 BYTE),
"AREA1" BINARY_DOUBLE DEFAULT 0,
"AREA2" BINARY_DOUBLE DEFAULT 0,
"AREA3" BINARY_DOUBLE DEFAULT 0,
"AREA4" BINARY_DOUBLE DEFAULT 0,
"AREA5" BINARY_DOUBLE DEFAULT 0
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ;
I am doing it with the help of the importer tool in the SQLDeveloper, by doing a right-click onto the table and selecting import data. In the assistant everything seem to be fine, even the data preview.
But when I try to import, I get an error: "ORA-01722: Invalid number" and a couple of failure windows appear. These windows display a NullPointerException:
java.lang.NullPointerException
at oracle.dbtools.raptor.data.writers.DataTypeFormatterRegistry.getFormattor(DataTypeFormatterRegistry.java:42)
at oracle.dbtools.raptor.data.writers.ImportGenerator.getBatchForInsert(ImportGenerator.java:1837)
at oracle.dbtools.raptor.data.writers.ImportGenerator.access$1800(ImportGenerator.java:84)
at oracle.dbtools.raptor.data.writers.ImportGenerator$1.afterLoopProcessing(ImportGenerator.java:1125)
at oracle.dbtools.raptor.newscriptrunner.ScriptExecutorTask.loopThroughAllStatements(ScriptExecutorTask.java:220)
at oracle.dbtools.raptor.newscriptrunner.ScriptExecutorTask.doWork(ScriptExecutorTask.java:165)
at oracle.dbtools.raptor.data.writers.ImportGenerator$1.doWork(ImportGenerator.java:782)
If I cancel the task, the insert statements are displayed:
SET DEFINE OFF
--Einfügen für Zeilen 1 bis 2 nicht erfolgreich
--ORA-01722: Ungültige Zahl
--Zeile 1
INSERT INTO BUILDING_SURFACES (ID, AREA1, AREA2, AREA3, AREA4, AREA5) VALUES ('BLDG_0003000b002ea10f','674.6703459157907','4212.205538937771','674.6703459158016','5561.546230769363','2714.6367797576822');
--Zeile 2
As one can see, the numbers are quoted ('). If I delete the quotes by hand, the insert statement works correctly.
What can I do, so that the import tool does not quote the numbers?
Deleting the quotes with the help of a regular expression is not workaround, since a lot of error windows appear, which needs to be closed by hand...
Thanks in advance,
Richard
Some infos about my machine:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
$ java -version
java version "1.6.0_38"
Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.13-b02, mixed mode)
Oracle SQL Developer 3.2.20.09
Version 3.2.20.09
Build MAIN-09.87
Copyright © 2005, 2012 Oracle. All Rights Reserved. Alle Rechte vorbehalten.
IDE Version: 11.1.1.4.37.59.48
Product ID: oracle.sqldeveloper
Product Version: 11.2.0.09.87I solved my problem. :)
I changed the datatype of the area fields to "NUMBER" and edited my input file in a way, that it is tab separated with "," as decimal sign.
Richard -
Microsoft Access shows "ORA-01722: Invalid number"
Hi,
I have seen a previous post on this problem, but none of the tips applied to my situation, so I'm asking again.
I'm accesing Oracle 8i Personal (German Version) with Access 2002 (latest SP, on a computer with Windows 2000). Please note that I installed the latest ODBC driver from Oracle (8.1.7.6.0). When I create a table which has, say, a NUMBER(10,3) field in it, and I link it into Access using the ODBC driver, I cannot enter numbers like "1,23" into the table. The error "ORA-01722: Invalid number" is shown and the INSERT fails. If I enter the numbers like "1.23", the resulting field value is "123". The
problem occurs, whether I use the table view, a form or VBA via ADO. Pass-Through queries (over ADO's QueryDef facility) work, however. The decimal separator is "," in both Windows and Oracle. With normal NUMBER fields everything works fine.
When looking at the SQL log it turns out, that Access hands out a string to the ODBC driver and relies on the driver to convert it to a number. Regardless of the locale set in Windows, Access uses the dot ('1.23') as decimal separator for this string. The German version of oracle wants a comma as decimal separator as in "INSERT INTO TEST VALUES ('1,23')". From a previous post I know that ODBC specifies that all numbers must use the dot, regardless of the locale setting. So it turns out, the Oracle ODBC driver is causing the problem, not Access. But, anyway, this problem could easily be fixed by adding a "Workaround option" to the ODBC driver, that always converts dots in numbers to commas before handing it out to the backend. Another option would be, that the ODBC driver does this decision automatically by asking the backend, which separator it wants.
Any comments greatly appreciated.
Best regards
MarkusThis is actually a duplicate of bug# 1938991 which says:
"A 'Numeric settings' option has been added to the Application Options page of the ODBC Configuration screen so that the user can choose what numeric settings will be used in receiving and returning numeric data that is bound as strings. This option allows the user to choose Oracle NLS settings (the default setting and the behavior in former releases), Microsoft default regional settings (to provide a way to mirror the Oracle OLE DB driver's behavior for greater interoperability) and US numeric settings, which are necessary when using MS Access or DAO in non-US environments. In this case, setting the Numeric settings to US settings should resolve the issue, since DAO is expecting the data in US format."
Apparently the fixed release is 9.2.0.2, 9.0.1.4 or 8.1.7.7 depending on your client version. -
EXECUTE IMMEDIATE ORA-01722 invalid number
hi all
i have a plsql procedure in which the following statement which gives this error ORA-01722: invalid number
sql_stmt :='UPDATE Student set '||stu_gradefor||'=TO_NUMBER('||stu_marks||') where UserID='||stu_UID;
EXECUTE IMMEDIATE sql_stmt;
here all variables (stu_marks,stu_gradefor and stu_UID) are varchar2 coming from different procedure(form) but in the table named Student column HW1 (stu_gradefor) is of datatype number.
I have tried a lot but could not make it to work. Is it that we cannot enter an number through EXECUTE IMMEDIATE? If Possible can somebody help me with this?
Thanks a lot.
Regards
Jyoticreate table Student(UserID varchar2(8) not null, HW1 number(3) , HW2 number(3) , PA1 number(3) , ................);
create table Domain(R_Domain varchar2(11) not null, R_Status char(1) not null, R_Date Date null,R_Value varchar2(11) null, R_Mean varchar2(300) not null);
insert into Domain( R_Domain, R_Status, R_Value, R_Mean )values(
'Term','t','PA1','First Programming Assignment');
Full names for HW1, HW2, PA1....are in the Domain table. so in variable stu_gradefor we get the R_Value.
this is true :variable stu_marks is not actually a number, so the TO_NUMBER is causing the error. stu_marks is of datatype varchar2 but the field HW1,.. are all expecting a numeric value.
i tried SELECT TO_NUMBER(stu_marks) INTO gmark FROM DUAL;
sql_stmt :='UPDATE Student set '||stu_gradefor||'=(:1) where UserID='||stu_UID;
EXECUTE IMMEDIATE sql_stmt using gmark;
where gmark is a number but noting works.same error
This can be true:the column userid is a varchar2 column with a mix of numeric and alpha numeric values. userid value that i inserted was'12345678'
i there any other way to handle this situation?
Thanks for replying
Jyoti -
ORA-01722 Invalid Number Error - report parameter
I have a report which runs successfully using the following simple select statement: -
select u.user_id, u.user_forename||' '||u.user_surname user_name,
fo.flight_number_in, fo.sta, fo.ata, fo.flight_number_out, fo.std, fo.atd
from users u, flight_operations_employees foe, flight_operations fo
where NVL(fo.sta, fo.std) between :P_Start and :P_End and
fo.record_number = foe.record_number and
u.user_id = foe.user_id
order by u.user_surname
Where P_Start and P_End are parameters passed from a form. I want to add further user option selections for the report and have added another parameter (P_inClause) where the user can select one or more items to select from. The column selected is a number on the table. I then want to pass this as another parameter into the report listing a number of valid values using the IN statement. The updated select statement is: -
select u.user_id, u.user_forename||' '||u.user_surname user_name,
fo.flight_number_in, fo.sta, fo.ata, fo.flight_number_out, fo.std, fo.atd
from users u, flight_operations_employees foe, flight_operations fo
where NVL(fo.sta, fo.std) between :P_Start and :P_End and
fo.record_number = foe.record_number and
u.user_id = foe.user_id and
u.user_id IN :P_inClauseorder by u.user_surname
u.user_id is a number column in the table. The value of P_inClause is set as a character parameter in the report and has the value (45,5,13,26) - as an example.
When I try running the report interactively it comes up with the ORA-01722 : Invalid Number error and points to the P_inClause parameter. If I type in the value directly into the select statement it works fine.
Do you have any ideas as to how I can make this work?
Regards
Edited by: Buzzer on Apr 13, 2011 12:44 PMYou can search this forum for "in clause", e.g.:
Re: how to pass values to where conditon -
'ORA-01722: Invalid number' error message in BeX
Hi Gurus,
We have a new report built on top of a DSO. When I run this report, I get the message 'ORA-01722: invalid number'. On furthur testing, I found that when I move two objects 'Date Changed' & 'Time Changed' [both are 'Z' objects we created] from the 'Rows' to 'Free Characteristics', the report runs as expected. So the issue seems that it is with these two objects. One of them is of type 'DATS' & the other of type 'TIMS'. These two are mapped to respective 'Date' & 'Time' fields in SAP R3.
SID's exists in the Master Data tables for both these objects. The data for both the fields contains the normal 'Date' & 'Time' values.Running the query using RSRT shows the same error message. The RSRV check on this report says that 'Query execution not possible as the variables contain invalid values'.
I have seen a couple of other posts in SDN with similar issues but none of them have a solution identified so far. Just wanted to check if anyone who has experienced this issue have been successfully able to resolve it?
Thanks
ArvindHi Ravi,
Thanks for your prompt reply. Yes, the 'Date' & 'Time' objects have 0DATE & 0TIME as reference objects.
I couldn't find any invalid vallues for these date and time fields. If invalid values were present, wouldn't the DSO activation have failed?
Thanks
Arvind.
Maybe you are looking for
-
How can i set my fonts to keep webpages viewable they keep changing size?
i set my fonts with tools. but when i go to webpages it will show very small. How can i keep my webpages set to a certain size font to make it viewable?
-
I just purchased a new Imac I am a recovering PC user anyhow the pages on Safari are quite slow to load. If I try to watch you tube the videos take a really long time to load. I am using wireless connection. The PC I have is also wireless with no pro
-
Sad day, I have to go back to my BlackBerry Torch 9810
Help needed. I have a BlackBerry Z10 but have to switch back to my TORCH 9810. I'm trying to find a way to switch back but BB Link won't work, Desktop Manager either. Does anyone know how I could proceed, I kinow I'll lose a few things but I would li
-
Menu overlay problems - Am I missing something?
Hello! I've been making menus by creating a photoshop document, then using that as my background and overlay, setting the overlay in DSP as a certain layer I created in photoshop. I've done this a hundred times before, but since I got the crossgrade
-
Date difference !!! urgent !!!
Hi, I have the following code. <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*,java.util.*,java.text.*" errorPage="" %> <% DateFormat df = DateFormat.getDateInstance(); String s1="01/09/2003"; String s2 = "01/1