Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7192943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:03:59+00:00 2026-05-28T20:03:59+00:00

On Executing this query, im having an error: * Error report: ORA-06502: PL/SQL: numeric

  • 0

On Executing this query, im having an error:

*Error report:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 34
06502. 00000 – “PL/SQL: numeric or value error%s”
*

.

My oracle version is:
Oracle9i Enterprise Edition Release 9.2.0.1.0 – Production
PL/SQL Release 9.2.0.1.0 – Production

please help me..
Regards,

 DECLARE CURSOR c1 is SELECT TABLE_NAME FROM All_Tables WHERE TABLE_NAME NOT LIKE '%$%' AND Owner NOT IN ('WMSYS', 'EXFSYS', 'CTXSYS', 'WKSYS', 'SYSMAN', 'SYSTEM', 'FLOWS_030000', 'MDSYS', 'ORDSYS', 'DBSNMP', 'XDB', 'OLAPSYS');  
    col_names SYS_REFCURSOR; TYPE dat_res IS RECORD(tab_name VARCHAR2(1000),col_name VARCHAR2(1000)); 
    TYPE dr is table of dat_res; 
    act_dat dr:= dr(); 
    status NUMBER := 0; 
    cnt NUMBER := 1; 
    sql_stmt VARCHAR2(10000); 
    tab_name1 VARCHAR2(100); 
    col_name1 VARCHAR2(100); 

BEGIN 

FOR I IN C1 LOOP sql_stmt:= 'SELECT table_name,column_name FROM all_Tab_cols WHERE table_name = '||CHR(39)||I.table_name||CHR(39); 
OPEN col_names FOR sql_stmt; LOOP FETCH col_names INTO tab_name1,col_name1; 
EXIT WHEN col_names%NOTFOUND; 
BEGIN 


EXECUTE IMMEDIATE 
'SELECT 1 FROM '||tab_name1|| ' WHERE REGEXP_LIKE('||'TO_CHAR('||col_name1||'), '||CHR(39)||'^[%][a-bA-B]'||CHR(39)||') ' 
INTO status;


EXCEPTION 
WHEN VALUE_ERROR THEN NULL;
WHEN NO_DATA_FOUND THEN NULL; 
WHEN OTHERS THEN NULL; 
END; 
IF (status = 1) THEN act_dat.extend; act_dat(cnt).tab_name:= tab_name1; act_dat(cnt).col_name:= col_name1; status := 0; cnt:= cnt + 1; 
END IF; END LOOP; 
CLOSE col_names; 
END LOOP; 
dbms_output.put_line('Table Name : Column Name'); 
FOR K IN act_dat.FIRST..act_dat.LAST LOOP insert into my_SAuditor_table VALUES (act_dat(K).tab_name, act_dat(K).col_name); 
END LOOP; 
Execute IMMEDIATE 'SELECT * FROM my_SAuditor_table';
END;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:04:00+00:00Added an answer on May 28, 2026 at 8:04 pm

    You might be looping over an empty collection.
    You need to check that act_dr has some rows before using act_dr.FIRST and act_dr.LAST, otherwise you get null which is not a number.

    This can be done with:

    if act_dr.count > 0 then
    FOR K IN act_dat.FIRST..act_dat.LAST LOOP 
       insert into my_SAuditor_table VALUES (act_dat(K).tab_name, act_dat(K).col_name); 
    END LOOP;
    end if;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having an error executing this query. Delete from customerpayment where customerid =
I'm having trouble executing a Doctrine DQL Query. This is the error it gives
I am having an issue executing this query. SELECT * FROM gob_attachment WHERE CONTAINS
I'm executing a query like this select field from table; In that query, there
I am having issues executing a SQL statement from a stored proc having single
I'm executing the following query SELECT COUNT(*) FROM table WHERE field1='value' AND (field2 >=
I am having trouble with a sql query. I need to insert a row
I am having problem with changing SQL query to preform faster. I need to
I'm having a hard time with this join query in my application. I have
I am having a java class where I am executing a query and assigning

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.