Home » Developer & Programmer » Forms » ORA-01722 (Invalid Number) When Fetching Data from Cursor
ORA-01722 (Invalid Number) When Fetching Data from Cursor [message #258188] Fri, 10 August 2007 09:34 Go to next message
TheodoreB
Messages: 1
Registered: August 2007
Location: Eau Claire, WI
Junior Member
While converting a form from 6i to 10g, I've come across this error. The code that is causing the problem is as follows:

DECLARE
  Dummy_Define CHAR(1);

  CURSOR SYSTEM_VARIABLES_cur IS      
    SELECT 1 FROM SYS_VARS S     
    WHERE S.VAR_NAME = :PP.PPI;

BEGIN
   
  OPEN SYSTEM_VARIABLES_cur;        
  FETCH SYSTEM_VARIABLES_cur INTO Dummy_Define;  
  IF ( SYSTEM_VARIABLES_cur%found ) THEN     
    Message('Error ...');     
    CLOSE SYSTEM_VARIABLES_cur;     
    RAISE Form_Trigger_Failure;     
  END IF;
  CLOSE SYSTEM_VARIABLES_cur;
 
END;


The line that is causing the problem is the FETCH line.

Any help is greatly appreciated.

TIA,

--TB
Re: ORA-01722 (Invalid Number) When Fetching Data from Cursor [message #258236 is a reply to message #258188] Fri, 10 August 2007 11:46 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is what you do:
SELECT 1                     --> 1 is a NUMBER
INTO Dummy_Define            --> you defined this variable as CHAR(1)
FROM SYS_VARS S
WHERE ...
It seems that Oracle refused to do implicit conversion; so, what you might try is to
a) declare dummy_define NUMBER(1),
b) SELECT '1' INTO dummy_define
Re: ORA-01722 (Invalid Number) When Fetching Data from Cursor [message #258642 is a reply to message #258188] Mon, 13 August 2007 04:07 Go to previous message
hemavb
Messages: 103
Registered: May 2007
Location: Dubai , UAE
Senior Member
however if are expecting alpha numeric data, just change the declaration type...

Dummy_Define CHAR(1);
to
Dummy_Define VARCHAR2(1);
Previous Topic: HOW 2 use ESC key in FORMS
Next Topic: Cannot see icon in runtime
Goto Forum:
  


Current Time: Fri Sep 27 04:31:01 CDT 2024