Question

Asked on 2006-10-20 at 08:25:55ID: 25474483

Cursor for loop error ORA-01722: invalid number

by: dplinnane500

Rating9.2Excellent

The following cursor returns no rows

Cursor update_33_cur is select TMP_PS_ITM_LOC_PRC.ID_ITM,
TMP_PS_ITM_LOC_PRC.ID_STR_RT,
TMP_PS_ITM_LOC_PRC.ID_EVT_PRC_CHN ID_EVT_PRC_CHN,
TMP_PS_ITM_LOC_PRC.dc_exp_cur_sls dc_exp_cur_sls
from TMP_PS_ITM_LOC_PRC , PS_ITM_LOC_PRC
where TMP_PS_ITM_LOC_PRC.ID_ITM = PS_ITM_LOC_PRC.ID_ITM
and TMP_PS_ITM_LOC_PRC.ID_STR_RT = PS_ITM_LOC_PRC.ID_STR_RT
and TMP_PS_ITM_LOC_PRC.ID_EVT_PRC_CHN = PS_ITM_LOC_PRC.ID_EVT_PRC_CHN
and TMP_PS_ITM_LOC_PRC.TRANSACTION_TYPE = 33;


When it enter the loop it exits where it is captured by a WHEN OTHERS exception.
I comment out most of the logic and place a varaible l_tmp_1 inside, it still goes straight to the exception handler, any ideas what could be wrong thanks.

for v in update_33_cur loop



                        l_tmp_1 := v.id_str_rt;
                        --l_tmp_1 := 'v.id_evt_prc_chn';                                                
                        --l_tmp_1 := 'TO_DATE (v.dc_exp_cur_sls, ps_config_pkg.c_date_fmt)';

                        --l_msg :=   v.id_str_rt||' : '||v.id_evt_prc_chn||' : '||v.dc_exp_cur_sls;
                       
/*

 update ps_itm_loc_prc
 set ts_mdf_rcrd = ps_config_pkg.g_sysdate,
                   sc_upd = ps_config_pkg.c_upd_flag,
                   dc_exp_cur_sls = TO_DATE (v.dc_exp_cur_sls, ps_config_pkg.c_date_fmt)
             WHERE ps_itm_loc_prc.id_str_rt = v.id_str_rt
             AND ps_itm_loc_prc.id_evt_prc_chn = v.id_evt_prc_chn;
             
 update tmp_ps_itm_loc_prc
               SET update_flg = 0
             WHERE tmp_ps_itm_loc_prc.id_itm = v.id_itm
               AND tmp_ps_itm_loc_prc.id_str_rt = v.id_str_rt
               AND tmp_ps_itm_loc_prc.id_evt_prc_chn = v.id_evt_prc_chn;
               
               */
end loop;      

  1. plsql cursor
    I havea very basix plsql Q this code is giving me error DECLARE prvd varchar(50); prvd1 varchar(50); cursor V_CURSOR is select P2.PROVIDER_NAME from schema.first_table p2; BEGIN open V_CURSOR; loop fetch V_CURSOR into prvd; select P.PAOWNAM…
  2. ORA-01722:invalid Number Issues
    I have a view "MYVIEW" that has the following structure. REF_ID, NAME, CHOICES 1,'SAM', '1,2,4' 2,'BLAKE','2,3,5' I am trying to fire a SQL Query SELECT * FROM MYVIEW WHERE CHOICES LIKE (1,2) Am i doing something wrong and if yes, how do i fetch the record if the …
  3. Ora-01722 invalid number?
    insert into users (User_Id,Anet_User_ID,Role_ID,Creation_Date,Created_By,Enabled, Last_Updated_By) values (16,'curran-dan889',4,'01-Mar-06', 1 ,'T', '01-Mar-06'); User_Id - Number Anet_User_ID - char Role_ID - number Creation_Date - date Created_By - number En…
  4. Correcting a SQL script that now results in error…
    How can I correct the following sql to avoid the error I am getting? ORA-01722: invalid number select hou_v.name ,flv_vl.meaning facility_name ,hou_v.organization_id ,hou_v.location_id ,hou_v.location_code ,hou_v.address_line_1 ,hou_v.address_line_2 ,hou_v.addres…
  5. ORA-01722 Invalid Number error
    I am getting an error on Col1 which is varchar2(10). When I do: to_number(Col1) I get the error ora-01722. There ar eonly 4 rows and the values are 10, 20, 30 and 40. Interestingly, when I do: length(Col1) it gives me 10 whereas it should give me 2. I tried to do translate function for chr(13) and chr(10) and …

Solution

Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
Zone
General
Tags
cursor invalid number
Participating Experts
2
Solution Grade
A

Replies

 by:

Posted on 2006-10-20 at 08:29:30ID: 28325062

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: nav_kum_v

Posted on 2006-10-20 at 08:30:55ID: 28325063

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: Ritesh_Garg

Posted on 2006-10-20 at 09:34:44ID: 28325064

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: dplinnane

Posted on 2006-10-20 at 10:06:54ID: 28325065

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts

slightwv

slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv

sdstuber

A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber

Testimonials

What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. slightwv

    2,000

    0 points yesterday

    Profile

BrowseBecome an Expert