ORA-06502 on cursor fetch dba_triggers
Oracle 11.2.0.3 SE - One
Oracle Linux 5.6, 64-bit
I watched it until I'm blue in the face...
Procedure uses a loop of CURSOR to scroll dba_triggers and disabling selected triggers. Going through the result set, I get
ERROR on line 1:
ORA-06502: PL/SQL: digital error or value
ORA-06512: at "ESTEVENS. TRUNCATE_SCHEMA', line 66
ORA-06512: at line 1
I think I have identified as a particular line by ordering my SELECT cursor, the two ascendant and descendant and is the line that should be the next one is the same of the order. For example, assume that the returned rows are named "AAA", "BBB", "CCC", etc.. If I includes an ORDER BY ASC TRIGGER_NAME, the last row before reports error is "FFF", then any error during playback of what should be 'GGG '. If I ORDER BY DESC TRIGGER_NAME, the last row reports until the error is "HHH", even once any error during playback of what should be 'GGG '.
Code of procedure is
create or replace
procedure truncate_schema (i_schema in varchar2)
is
type usrtbl_typ is ref cursor return % ROWTYPE dba_tables;
cv_usrtbl usrtbl_typ;
v_usrtbl dba_tables % ROWTYPE;
type usrconstraint_typ is ref cursor return sys.dba_constraints%ROWTYPE;
cv_usrconstraint usrconstraint_typ;
v_usrconstraint sys.dba_constraints%ROWTYPE;
type usrtrigger_typ is ref cursor return sys.dba_triggers%ROWTYPE;
cv_usrtrigger usrtrigger_typ;
v_usrtrigger sys.dba_triggers%ROWTYPE;
date of T_DATE;
v_sql varchar2 (20000);
number of v_rowcnt;
Start
Select sysdate in double T_DATE;
dbms_output.put_line ('Run time is' | to_char (T_DATE,' dd-mon-yyyy hh24:mi:ss'));))
--
dbms_output.put_line (' processing user ' | i_schema);
--
-Disable all triggers on the tables in the selected schema
--
dbms_output.put_line (' '... triggers ");
Select count (*)
in v_rowcnt
of dba_triggers
where table_owner = i_schema;
dbms_output.put_line (' treatment ' | v_rowcnt |) "triggers");
v_rowcnt: = 0;
Open the cv_usrtrigger for
Select * from sys.dba_triggers
where table_owner = i_schema
order by the owner,
trigger_name desc;
loop
extract the cv_usrtrigger in v_usrtrigger;
When the output cv_usrtrigger % NOTFOUND;
v_sql: = 'alter trigger' |
v_usrtrigger. Owner |
'.' ||
v_usrtrigger.trigger_name |
"disable."
v_rowcnt: = v_rowcnt + 1;
dbms_output.put_line (v_rowcnt |') -' || v_sql);
-execution immediate v_sql;
end loop;
close cv_usrtrigger;
end truncate_schema;
The sample output:
SQL > exec truncate_schema ('DW')
Run time is June 5, 2014 10:56:09
Processing user DW
... triggers
Treatment of 54 triggers
1 - alter trigger DW. < delete name for public consumption >
2 - alter trigger DW. < delete name for public consumption >
-snip unnecessary repetition-
30 - alter trigger DW. < delete name for public consumption >
BEGIN truncate_schema ('DW'); END;
*
ERROR on line 1:
ORA-06502: PL/SQL: digital error or value
ORA-06512: at "ESTEVENS. TRUNCATE_SCHEMA', line 66
ORA-06512: at line 1
SQL >
I was starting to suspect may be a corruption of data dictionary (stable in the dev database), but I was able to repeat the error (and on the same named trigger!) in another data base which is a DUPLICATE of the production of rman.
Oops, I missed you select all of the columns in dba_triggers. You probably have a trigger with TRIGGER_BODY > 64767 bytes. Exclude TRIGGER_BODY go select and I'm almost certain that you will be OK.
SY.
Tags: Database
Similar Questions
-
Hello
I have an EA of RDBMS Oracle 11.2.0.4.
I ger the following error when I try to convert a data type LONG to type CLOB data thanks to a PL/SQL procedure:
declare
v_prefix varchar2 (20): = null;
v_text_view_clob clob: = null;
long v_text_view_long: = null;cursor c_v
is
Select
a.view_name as view_name
Of
USER_VIEWS one;
Start
for r_v in c_v
loop
Start
v_text_view_clob: = null;
v_text_view_long: = null;-Do the SQL code of the view
Select
a.Text text
in
v_text_view_long
Of
USER_VIEWS one
where
a.view_name = r_v.view_name;v_text_view_clob: = v_text_view_long;
update of ohibo_views one
set
a.view_text = v_text_view_clob
where
a.view_name = r_v.view_name;
exception
while others then
dbms_output.put_line ('View =' | r_v.view_name |) "kan niet worden geconverteerd!");
dbms_output.put_line (substr (sqlerrm, 1, 60));
end;
end loop;
-commit;
exception
while others then
lift;
end;
/I get the error a specific record:
View = VER_POLISMUTATIES_VW kan niet worden geconverteerd!
ORA-06502: PL/SQL: digital error or value
At looked the origina; Value of type LONG and it is indeed a "long" piece of text.
However, CLOB has a restriction about 4G * db_block_size and LONG 2 G - 1 according to the documentation.
I should be able with the method above to convert a LONG in CLOB.
Anyone had a similar situation?
Thanks in advance for advice how to solve.
Kind regards
PS: my apologies, I didn't know which group to post this discussion: database or PL/SQL.
Good indeed, a link with the right explanation.
I didn't know that there was such a function.
Thank you!
Kind regards
-
Cannot generate the dynamic query - ora-06502
Hi friends,
during execution of code below I get the error message: ora-06502 pl/sql numeric or value error on line 11
I'm not able to open a SQL session table logging.
DECLARE
T_Participants TYPE TABLE IS NUMBER;
c_Participant_Id t_Participants: = t_Participants();
CLOB V_SQL;
BEGIN
Select the participantid COLLECT in BULK IN c_Participant_Id in t_roster_detail
where rosterid = 10654
and ba = "MD";
I'm IN 1.c_Participant_Id.COUNT LOOP
V_SQL: = V_SQL | "SELECT p.participantid,.
Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10331, p.Current_Data, NULL), null) "10331_CURRENT."
Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10331, p.Goal_Data, NULL), null) "10331_Goal."
Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 9640, p.Current_Data, NULL), null) "9640_CURRENT."
Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 9640, p.Goal_Data, NULL), null) "9640_Goal."
Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 9643, p.Current_Data, NULL), null) "9643_CURRENT."
Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 9643, p.Goal_Data, NULL), null) "9643_Goal."
Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10332, p.Current_Data, NULL), null) "10332_CURRENT."
Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10332, p.Goal_Data, NULL), null) "10332_Goal."
Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10721, p.Current_Data, NULL), null) "10721_CURRENT."
Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10721, p.Goal_Data, NULL), null) "10721_Goal."
Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10701, p.Current_Data, NULL), null) "10701_CURRENT."
Decode (p.Participantid, ' | c_Participant_Id (i) |', decode (p.Measureid, 10701, p.Goal_Data, NULL), null) '10701_Goal '.
OF t_sce_msr_output_data p
WHERE IN (SELECT T_PC_AXIS_DEFINITION CREATES CREATES
WHERE PLANCOMPONENTID IN (SELECT PLANCOMPONENTID FROM T_PLAN_COMPONENT WHERE PLANID = 10702))
UNION ";
END LOOP;
DELETE FROM T_LOGGING_SQL;
INSERT INTO T_LOGGING_SQL VALUES (V_SQL);
COMMIT;
END;
SQL > desc t_sce_msr_output_data
Name Null? Type
----------------------------------------- -------- ------------
IDSCENARIO NOT NULL NUMBER
CREATES NOT NULL NUMBER
PARTICIPANTID NOT NULL NUMBER
NUMBER OF BASELINE_DATA
NUMBER OF CURRENT_DATA
NUMBER OF GOAL_DATA
You are way more complicate things here. First of all, there is no need at all for dynamic sql because the wy you are querying is incorect.
Even if you do not have an error, which you query will do is run the query on t_sce_msr_output_data once for each row returned by the cursor. Each iteration of the query will return all matching rows (i.e. lines for all the participantid in the t_sce_msr_output_data table), then the external decoding will be will force all other NULL columns for all the participantid that do not correspond to the "current" participantid
The query can be simplified to:
Select p.participantid,
Decode (p.Measureid, 10331, p.Current_Data, NULL) "10331_CURRENT."
Decode (p.Measureid, 10331, p.Goal_Data, NULL) "10331_Goal."
Decode (p.Measureid, 9640, p.Current_Data, NULL) "9640_CURRENT."
Decode (p.Measureid, 9640, p.Goal_Data, NULL) "9640_Goal."
Decode (p.Measureid, 9643, p.Current_Data, NULL) "9643_CURRENT."
Decode (p.Measureid, 9643, p.Goal_Data, NULL) "9643_Goal."
Decode (p.Measureid, 10332, p.Current_Data, NULL) "10332_CURRENT."
Decode (p.Measureid, 10332, p.Goal_Data, NULL) "10332_Goal."
Decode (p.Measureid, 10721, p.Current_Data, NULL) "10721_CURRENT."
Decode (p.Measureid, 10721, p.Goal_Data, NULL) "10721_Goal."
Decode (p.Measureid, 10701, p.Current_Data, NULL) "10701_CURRENT."
Decode (p.Measureid, 10701, p.Goal_Data, NULL) '10701_Goal '.
of t_sce_msr_output_data p
where in (select creates creates
of t_pc_axis_definition
where plancomponentid in (select plancomponentid
of t_plan_component
where planid = 10702)) and
participantid in (select participantid
of t_roster_detail
where rosterid = 10654 and
BA = "MD");
You probably want to pivot these results by participant, if so look in the note from the FAQ for the columns of the rows.
John
-
Hi all
FUNCTION to CREATE or REPLACE fnc_two (p_in_job IN VARCHAR2)
RETURN VARCHAR2
AS
CUR CURSOR
IS
SELECT ename
WCP
WHERE job = p_in_job;
v_first_name emp.ename%TYPE;
BEGIN
FOR my heart IN rec
LOOP
IF v_first_name IS NULL
THEN
v_first_name: = rec.ename;
ON THE OTHER
v_first_name: = v_first_name | ',' || Rec.Ename;
END IF;
END LOOP;
RETURN v_first_name;
END;
SQL > SELECT fnc_two ('CLERK')
2 FROM dual;
SELECT fnc_two ('CLERK')
*
ERROR on line 1:
ORA-06502: PL/SQL: digital or value error: character string buffer too small
ORA-06512: at the 'APPS '. FNC_TWO', line 17
SQL > select distinct work of emp
2.
JOB
---------
CLERK
SELLER
PRESIDENT
MANAGER
ANALYST
v_first_name: = v_first_name | ',' || Rec.Ename;
The above statement is the original error. The value has been assinged to v_first_name is larger than the computer can handle.
Increase the size of the variable v_first_name to avoid the error example
v_first_name varchar2 (100);
-
ORA-06502: PL/SQL: digital error or value
Hello
We have a package with a cursor that returns the session information:
create or replace PACKAGE BODY "LOGIN_AUDIT" ... ... CURSOR session_cur IS SELECT * FROM v$session WHERE audsid=USERENV('sessionid'); session_rec session_cur%ROWTYPE; ... FUNCTION get_osuser RETURN VARCHAR2 IS BEGIN RETURN session_rec.osuser; END; FUNCTION get_dbuser RETURN VARCHAR2 IS BEGIN RETURN NVL(session_rec.username, 'ORACLE_SYS'); END; ...
The package compiled successfully and works ok out for a function that is the get_osuser. When you launch sqlplus, we get the following error:
Select double LOGIN_audit.get_osuser;
*
ERROR on line 1:
ORA-06502: PL/SQL: digital error or value
ORA-06512: at "APPUSR. LOGIN_AUDIT', line 94
ORA-06512: at "APPUSR. LOGIN_AUDIT', line 102
The APPUSR has select priv on V$ SESSION and a select * from v$ session returns the session information. We can perform any other function since the package without any problem, for example:
APPUSR@APPD > select double login_audit.get_dbuser;
GET_DBUSER
-------------------------------------------------------------
APPUSR
Can someone help us work on what happens please.
PS Oracle: 11.2.0.3, OS Windows 2008 server.
Thank you
Really I have not aside, this and raise the question?
Why you write all this code?
wouldn't the following very good enough?
- FUNCTION get_osuser RETURN VARCHAR2; Use sys_context ('USERENV', 'OS_USER')
- FUNCTION get_dbuser RETURN VARCHAR2; Use sys_context ('USERENV', 'SESSION_USER')
- FUNCTION get_client_info RETURN VARCHAR2; Use sys_context ('USERENV', 'CLIENT_INFO')
- FUNCTION get_module_info RETURN VARCHAR2; Use sys_context ('USERENV', 'MODULE')
- FUNCTION get_action_info RETURN VARCHAR2; Use sys_context ('USERENV', 'ACTION')
Just do not know, I see the advantage of messing around with this slider and have to fight with the updating of information and others.
This would totally work around the error you get and probably accelerate - and make it easier to maintain.
??
Unless there is some additional requirements, that I'm missing
-
ORA-06502: PL/SQL: digital or value error: character conversion number e
Hi all
I work with DBLOCALE , which is
and DBREMOTEOracle Database 10g Release 10.2.0.3.0 - 64bit Production PL/SQL Release 10.2.0.3.0 - Production CORE 10.2.0.3.0 Production TNS for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Productio NLSRTL Version 10.2.0.3.0 - Production
Leave a procedure on DBLOCALE I run SCHEMA. MYPROCEDURE@dbremote (NUMBER, stringPar VARCHAR2, datePar DATE numberPar)Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production PL/SQL Release 9.2.0.8.0 - Production CORE 9.2.0.8.0 Production TNS for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production NLSRTL Version 9.2.0.8.0 - Production
I use this procedure only to call a function in a package of DBREMOTE with education booleanresult: = MYPACKAGE. MYFUNC (NUMBER, stringPar VARCHAR2, datePar DATE numberPar)
In the service, I try to INSERT IN MYTABLE (numberPar, stringPar, datePar) and the error
is triggered.ORA-06502: PL/SQL: numeric or value error: character to number conversion error
I missed something basic? Where is my mistake?
I have check all types of past data and types of data in the table, that I have to insert.
Any help or suggestion will be appreciated. Feel free to ask me any questions that need me to explain or for more details.
Best regards
AlexOraclePSP wrote:
It starts with a page of APEX who call a procedure in DBLOCALE.
Apex point (page) variables are all text - and bind as text variables when used in PL/SQL and SQL code.
In this procedure, ii assess the past, then insert into a few tables@DBREMOTE without errors.
The end of it, I'm calling the remote packaged function.
In the function I use parameters to open a cursor and insert into MYTABLE.That you pass as parameters? The variable element of Apex (e.g. : P1_DATE) or do you attribute the object variable to a PL/SQL variable and the neck of the PL/SQL variable as a parameter?
Even if I agree with you on the copy & paste I don't know what part of the process, I can speak to you.
Well, you can try the following. Create a dynamic PL/SQL region on the page. This region should be implemented and made that the page has been sent (in other words, element variables used in the page need value for this region, for the record). You can create a condition for this region that must be met to be made - and this can check the QUERY variable, or to check if the relevant variables have values.
In this dynamic PL/SQL code for the region block, use HTP.prn () as you would use DBMS_OUTPUT.put_line () in client-server test normal (using TOAD or SQL * more). And in this block of code, call the remote procedure.
For example
--// dynamic PL/SQL region code block: HTP.prn( 'Item P1_DATE = ['||:P1_DATE||']
' ); HTP.prn( 'Item P1_NUMBER = ['||:P1_NUMBER||']
' ); ..etc.. HTP.prn( 'Calling remote procedure:
' ); begin RemoteProc@RemoteDB( param1=>:P1_DATE, param2=>:P1_NUMBER ); HTP.prn( 'Call was successful
' ); exception when OTHERS then HTP.prn( 'Call failed with: '||SQLERMM(SQLCODE)||'
'); end; ..etc.. -
Hi people,
I'm using the shuttle of the Apex, but returned the error ' ORA-06502: PL/SQL: digital error or value: character string buffer too small ", when the query returns many rows then 800.»» Where can I change this?
I enclose the procedure.
Thanks for the help.
create or replace PROCEDURE DHTML_SHUTTLE)
pSQL_1 clob,
pSQL_2 clob,
pID_1 varchar2 default '1',
pID_2 varchar2 default '2'.
pSort1 varchar2 default 'Y ',.
pSort2 varchar2 default 'Y ',.
pFixed1 varchar2 default 'n'.
pHeight varchar2 default '150'.
pWidth varchar2 default '150'.
pImagePrefix varchar2 default v ('IMAGE_PREFIX'),
pOnClick varchar2 default null,
pStyle varchar2 default null,
pFirstImage varchar2 default 'shuttle_top.png '.
pPreviousImage varchar2 default 'shuttle_up.png '.
pNextImage varchar2 default 'shuttle_down.png '.
pLastImage varchar2 default 'shuttle_bottom.png '.
pRefreshImage varchar2 default 'shuttle_reload.png '.
pRightAllImage varchar2 default 'shuttle_last.png '.
pRightImage varchar2 default 'shuttle_right.png '.
pLeftImage varchar2 default 'shuttle_left.png '.
pLeftAllImage varchar2 default 'shuttle_first.png '.
) as
l_shuttle_attributes varchar2 (20000);
Start
l_shuttle_attributes: = ' multiple = "multiple" style = "height :'|| pHeight | "PX; width :'|| pWidth | "PX; » " ;
HTP. PRN ("< style >");
If (pStyle is null) then
/ * style for default shuttles.
HTP. PRN ('.shuttleSort1 img, .shuttleControl img, .shuttleSort2 img {display: block; cursor: hand; cursor: margin: 3px ;}");})
on the other
HTP. PRN (pStyle);
end if;
HTP. PRN ("</style > '");
HTP. PRN ("< table cellpadding ="0"cellspacing ="0"border ="0 "summary =" "> < tr >" ");
/ * Sort orders 1 * /.
if(pSort1='Y') then
HTP. PRN ("< class td ="shuttleSort1"> ');
HTP. PRN ("< img src =" "'| pImagePrefix | pFirstImage |'") onclick = "g_ShuttleMe" | pID_1 | '.sort1 ;'|| ("T") pOnClick | ("' alt = 'Top' / >");
HTP. PRN ("< img src =" "'| pImagePrefix | pPreviousImage |'") onclick = "g_ShuttleMe" | pID_1 | '.sort1 ;'|| ("U") pOnClick | ("' alt = 'Up' / >");
HTP. PRN ("< img src =" "'| pImagePrefix | pNextImage |'") onclick = "g_ShuttleMe" | pID_1 | '.sort1 ;'|| ("D") pOnClick | ("" alt = "Low" / > ");
HTP. PRN ("< img src =" "'| pImagePrefix | pLastImage |'") onclick = "g_ShuttleMe" | pID_1 | '.sort1 ('B') ;'|| pOnClick | ("' alt = 'Bottom' / >");
HTP. PRN ("< table > '");
end if;
/ * Shuttle point 1 * /.
HTP. PRN ("< class td"shuttleSelect1"= > ' |") htmldb_item.select_list_from_query (pID_1, null, pSQL_1, l_shuttle_attributes, 'NO', null, null, 'SHUTTLE_': pID_1, 'SHUTTLE_': pID_1, null). "< table >');
/ * Shuttle controls * /.
HTP. PRN ("< td align ="center "class =" shuttleControl "> ');
HTP. PRN ("< img src =" "'| pImagePrefix | pRefreshImage |'") onclick = "g_ShuttleMe" | pID_1 | '. reset(); | pOnClick | ("" alt = "reset" / > ");
if(pFixed1='Y') then
HTP. PRN ("< img src ="'| pImagePrefix | pRightAllImage |') "onclick =" move_all ('| "')" SHUTTLE_' | pID_1 | " «, » ||'' 'SHUTTLE_' | pID_2 | " ') ;'|| pOnClick | "" "alt =" > > "/ >"); "
HTP. PRN ("< img src ="'| pImagePrefix | pRightImage |) "" onclick = "move ('|) "' SHUTTLE_' | pID_1 | " «, » ||'' 'SHUTTLE_' | pID_2 | " ') ;'|| pOnClick | "" "alt =" > "/ >"); "
HTP. PRN ("< img src ="'| pImagePrefix | pLeftImage |) "" onclick = "delete ('|) "' SHUTTLE_' | pID_2 | " ') ;'|| pOnClick | "" "alt =" < "/ >"); "
HTP. PRN ("< img src ="'| pImagePrefix | pLeftAllImage |) "" onclick = "remove_all ('|) "' SHUTTLE_' | pID_2 | " ') ;'|| pOnClick | "" "alt =" < < "/ >"); "
on the other
HTP. PRN ("< img src =" "'| pImagePrefix | pRightAllImage |'") onclick = "g_ShuttleMe" | pID_1 | '. move_all() '. pOnClick | "" "alt =" > > "/ >"); "
HTP. PRN ("< img src ="'| pImagePrefix | pRightImage |) "" onclick = "g_ShuttleMe" | " pID_1 | '. move(); | pOnClick | "" "alt =" > "/ >"); "
HTP. PRN ("< img src ="'| pImagePrefix | pLeftImage |) "" onclick = "g_ShuttleMe" | " pID_1 | '. remove() '. pOnClick | "" "alt =" < "/ >"); "
HTP. PRN ("< img src ="'| pImagePrefix | pLeftAllImage |) "" onclick = "g_ShuttleMe" | " pID_1 | '. remove_all() ". pOnClick | "" "alt =" < < "/ >"); "
end if;
HTP. PRN ("< table > '");
/ * Shuttle point 2 * /.
HTP. PRN ("< class td"shuttleSelect1"= > ' |") htmldb_item.select_list_from_query (pID_2, null, pSQL_2, l_shuttle_attributes, 'NO', null, null, 'SHUTTLE_': pID_2, 'SHUTTLE_': pID_2, null). "< table >');
/ * Sort controls 2 * /.
if(pSort2='Y') then
HTP. PRN ("< class td ="shuttleSort2"> ');
HTP. PRN ("< img src =" "|") pImagePrefix | pFirstImage |' "onclick ="g_ShuttleMe"| pID_1 | '.sort2 ;'|| ("T") pOnClick | ("' alt = 'Top' / >");
HTP. PRN ("< img src =" "|") pImagePrefix | pPreviousImage |' "onclick ="g_ShuttleMe"| pID_1 | '.sort2 ;'|| ("U") pOnClick | ("' alt = 'Up' / >");
HTP. PRN ("< img src =" "|") pImagePrefix | pNextImage |' "onclick ="g_ShuttleMe"| pID_1 | '.sort2 ;'|| ("D") pOnClick | "" alt = "to the low"(/>'); "
HTP. PRN ("< img src =" "|") pImagePrefix | pLastImage |' "onclick ="g_ShuttleMe"| pID_1 | '.sort2 ('B') ;'|| pOnClick | ("' alt = 'Bottom' / >");
HTP. PRN ("< table > '");
end if;
HTP. PRN ("< /tr > < / table > '");
HTP. PRN ("< script > '");
HTP. PRN ('if(!flowSelectArray) {var flowSelectArray = new Array();}' | chr('13') | chr('10'));
HTP. PRN ("var g_ShuttleMe' |") pID_1 | "= null". Chr('13') | Chr('10'));
HTP. PRN ("flowSelectArray [' |]") pID_1 | «] = "SHUTTLE_" | "» pID_1 | '";' || Chr('13') | Chr('10'));
HTP. PRN ("flowSelectArray [' |]") pID_2 | «] = "SHUTTLE_" | "» pID_2 | '";' || Chr('13') | Chr('10'));
HTP. PRN ('g_ShuttleMe' | pID_1 |) ' = new dhtml_ShuttleObject ("SHUTTLE_" | pID_1 |) "", "SHUTTLE_" | " pID_2 | '");' || Chr('13') | Chr('10'));
HTP. PRN ("< /script >" | ") chr('13') | chr('10'));
end;The problem that you hit is htmldb_item.select_list_from_query, so tweak that a bit.
DG tournament, I used my own Shuttle, but never documented it as well, but I found an another blog post that makes.
Take a look at this solution.Just a question; do you really want more than 800 objects in your Shuttle? Is it not more logical to have a drop down menu or something like that before limiting the list?
Dimitri
-
apex_json throws ORA-06502
Hello
I use 5 APEX and must work with GEOJSON.
If I test the following statement in SQL Developer, everything works fine:
DECLARE s varchar2(32767) := '{ "a": 1, "b": ["hello", "world"]}'; BEGIN apex_json.parse(s); sys.dbms_output.put_line('a is '||apex_json.get_varchar2(p_path => 'a')); END;
But if I change the JSON data to the following:
s varchar2(32767) := '{ "a": 1.1, "b": ["hello", "world"]}';
I get this error:
Fehler beim Start in Zeile : 1 in Befehl - DECLARE s varchar2(32767) := '{ "a": 1.1, "b": ["hello", "world"]}'; BEGIN apex_json.parse(s); sys.dbms_output.put_line('a is '||apex_json.get_varchar2(p_path => 'a')); END; Fehlerbericht - ORA-06502: PL/SQL: numerischer oder Wertefehler: Fehler beim Konvertieren von Zeichen zu Zahl ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 367 ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 519 ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 566 ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 756 ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 774 ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 811 ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 839 ORA-06512: in "APEX_050000.WWV_FLOW_JSON", Zeile 852 ORA-06512: in Zeile 4 06502. 00000 - "PL/SQL: numeric or value error%s" *Cause: *Action:
The same thing happens with with MyMethod...
sys.dbms_output.put_line('a is '||apex_json.get_number(p_path => 'a'));
Because I work with GEOJSON, there are decimal numbers in my JSON data - I have to deal with.
I have not found any suspicion in the apex_json documentation.
How can I solve this problem?
Kind regards
Christian
Hello
your example works fine for me on 5.0.2. There were a few bugs that fixed us since 5.0. Some may be available as SAFF, but maybe you need to upgrade to the latest version.
Kind regards
Christian
-
Passing data from attachment of DB (Blob data Type) after the CLOB data type conversion, giving the error "ORA-06502: PL/SQL: digital error or value" in the PL/SQL package. If the BLOB size 32K > it will give another error works great my procedure.
For example, I enclose my code here.
function get_base64 (p_blob_in in blob) return clob is
CLOB v_clob;
CLOB v_result;
whole v_offset;
v_chunk_size PLS_INTEGER: = 12288;
v_buffer_varchar varchar2 (32767).
v_buffer_raw raw (32767).
Start
fnd_file.put_line (fnd_file.log, 'here');
If p_blob_in is null then
Returns a null value.
end if;
DBMS_LOB.CREATETEMPORARY (v_clob, true);
fnd_file.put_line (fnd_file.log, 'here1');
v_offset: = 1;
fnd_file.put_line (fnd_file.log, 'Loop value'-| ceil (DBMS_LOB.) GetLength (p_blob_in) / v_chunk_size));
because me in 1... ceil (DBMS_LOB. GetLength (p_blob_in) / v_chunk_size) loop
DBMS_LOB. Read (p_blob_in, v_chunk_size, v_offset, v_buffer_raw);
v_buffer_raw: = utl_encode.base64_encode (v_buffer_raw);
v_buffer_varchar: = utl_raw.cast_to_varchar2 (v_buffer_raw);
DBMS_LOB. WriteAppend (v_clob, length (v_buffer_varchar), v_buffer_varchar);
v_offset: = v_offset + v_chunk_size;
end loop;
fnd_file.put_line (fnd_file.log, 'Out of the loop');
v_result: = v_clob;
fnd_file.put_line (fnd_file.log, 'V_result length' - |) DBMS_LOB. GetLength (v_result));
fnd_file.put_line (fnd_file.log, 'V_result' - | v_result);
DBMS_LOB.freeTemporary (v_clob);
Return v_result;
exception
while others then
fnd_file.put_line (fnd_file.log, 'Error based on the encode_base64' - |) SQLERRM);
Returns a null value.
end;
In my main program I call this function as below:
Main proceedings...
l_return_clob CLOB.
Begin
....
l_return_clob: = get_base64 (p_blob_in);
-In returning it gives error - ORA-06502: PL/SQL: digital error or value
end;
Then, please mark the thread ANSWERED.
-
APEX 5.0. With the image stored in a BLOB gives ORA-06502.
Hello
I want to create an interactive report - computer desk with an image that is stored in a BLOB but it a: returnes ORA-06502: PL/SQL: digital or value error: character of number conversion error.
I created a test with only the image report (charged - which is a BLOB) and an ID (PK - one number from a sequence)
SELECT ID, invoice of foto
I tried with and without a formatmask for the ' 999999999999999 ID' and the Type of plain text, because it seems not to be a better choice...
For the Type 'pay' is 'View Image' and the 'Table name' and 'BLOB column' are defined. 'Primary Key column 1' set ID 'column of Type mime"points to a field that contains" image/jpeg", as the stored image is a photo in format jpg.
The image from a Forms application displays OK.
DB is a 11.2.0.4 on Linux 6.6 and APEX is 5.0
What did I miss?
Thank you
Dino
Dino Hustinx wrote:
I want to create an interactive report - computer desk with an image that is stored in a BLOB but it a: returnes ORA-06502: PL/SQL: digital or value error: character of number conversion error.
I created a test with only the image report (charged - which is a BLOB) and an ID (PK - one number from a sequence)
SELECT ID, invoice of foto
As described in the documentation, the report query selects the length of the BLOB, not the column itself column:
select id, dbms_lob.get_length(billed) billed from foto
-
Apex 4.2
I searched through the forums of the research about this error, but I do not understand what to do from here. I am writing a process that sends an e-mail when a value of the claim is made (or on a button click). Procedure is as follows:
DECLARE l_body clob; l_body_html clob; l_subject varchar2(100); BEGIN l_body := empty_clob(); l_body_html := empty_clob(); IF V('REQUEST') in ('SAVE_ME') AND :P32_PARENT_UPDATED_FL IS NOT NULL THEN l_subject := 'Survey Job Request Updated'||utl_tcp.crlf||utl_tcp.crlf; l_body := 'Update'||utl_tcp.crlf; l_body_html := '<html> <head> <style type = "text/css"> /* Can add style attributes later */ </style> </head> <body>'||utl_tcp.crlf; l_body_html := l_body_html ||'Survey Job Request has been updated.<br /><br />'||utl_tcp.crlf; l_body_html := l_body_html ||'Title: '||utl_tcp.crlf; l_body_html := l_body_html ||:P32_TITLE||utl_tcp.crlf; l_body_html := l_body_html ||'<br />Request Category : '||utl_tcp.crlf; l_body_html := l_body_html ||:P32_REQUEST_CATEGORY||utl_tcp.crlf; l_body_html := l_body_html ||'<br />Update Date: '||utl_tcp.crlf; l_body_html := l_body_html ||:P32_UPDATE_DATE||utl_tcp.crlf; l_body_html := l_body_html ||'<br />Updated By: '||utl_tcp.crlf; l_body_html := l_body_html ||:P32_LAST_EDITED_BY_USERID||utl_tcp.crlf; l_body_html := l_body_html ||'</body></html>'; END IF; :P32_CANCELLATION_REASON := l_body_html; apex_mail.send( p_to => '[email protected]', p_from => '[email protected]', p_body => l_body_html, p_body_html => l_body_html, p_subj => l_subject); END;
I added two lines to the code (lines 08 and 09) and when I run my program, I now get the error:
- ORA-21560: 3 argument is null, invalid or out of range
Without these two lines, I received the error:
ORA-06502: PL/SQL: digital error or value: specified incorrect LOB Locator
I'm not quite sure what is wrong or what I can change. There seems to be right, and in fact, it worked before. I have no idea why this error keeps popping up. Any help on that would be great. Thanks in advance.
Hello
NewApexCoder wrote:
Hmmm... good point. I think that apex_mail.send must be called inside the IF block. But in the future, I added several conditional statements, won't I need to include the apex_mail.send function in each IF block? But at the same time, there is the case that if no conditional instructions are met? Tests, when none of the conditions are true (when I had a second IF block in the code), an email would not be defined, which is correct. Could that be causing a problem however. If the IF block is not filled could he always try to send an email about anything or the l_body_html and l_subject fields have in them the garbage that causing ORA error?
If the call to the procedure of sending (it is a procedure, and not a function) many times is necessary or useful depends on exactly what you're trying to do.
For example, you can write to Santa for
- Submit a wish list
- Change of address
- Contradiction with your boss, who can you tell Santa you were mean
or any combination of these grounds. If you want to send a simple email whenever any of the conditions are met (and not send a when none are met), then you could do something like this:
DECLARE
need_to_send BOOLEAN: = FALSE;
...
BEGIN
...
IF wish_list IS NOT NULL
THEN
l_body: = l_body | ...
need_to_send: = TRUE;
END IF;
IF old_addresss <> new_address
THEN
l_body: = l_body | ...
need_to_send: = TRUE;
END IF;
IF boss_is_a_big_fat_liar
THEN
l_body: = l_body | ...
need_to_send: = TRUE;
END IF;
IF need_to_send
SO - It's the only call to send
apex_mail. Send...
In any case, the error message ' ORA-21560: argument 3 sucks...» "is pretty clear: If you have not given a value to everything you're passing as p_body, then you'd better call the procedure.
-
DBMS_STATS.gather_schema_stats: ORA-06502
I am trying to run under block to find all objects with stale stats. Is someone can you please tell me what I'm missing?
Set serveroutput on;
DECLARE
ObjList dbms_stats. ObjectTab;
BEGIN
DBMS_STATS. GATHER_SCHEMA_STATS (ownname = > null, OPTIONS = > "LIST out of DATE", objlist = > ObjList);
FOR i IN ObjList.FIRST... ObjList.LAST
LOOP
dbms_output.put_line (ObjList (i). ObjName | ' ' || ObjList (i). Type of the object);
END LOOP;
END;
/
ORA-06502: PL/SQL: digital error or value
ORA-06512: at line 5
06502 00000 - "PL/SQL: digital error or the value of %s.
* Cause: A digital arithmetic error, String, conversion or coercion
has occurred. For example, this error occurs if an attempt is made to
assign the NULL value to a variable declared NOT NULL, or if a
attempt to assign an integer greater than 99 to a variable
NUMBER (2) declared.
* Action: Change the data, how it is handled, or how it is so declared
that values do not violate the constraints.
Using the Oracle 12 c on Windows 7 version
You do not currently have all stale stats, so the dbms_stats. ObjectTab is empty. Take into account:
SQL > create type test_type as the object)
col1 2 varchar2 (10));
3.
Type of creation.
SQL > create type test_tab as table of test_type.
2.
Type of creation.
SQL > declare
l_tt 2 test_tab;
3. start
4. Select test_type (dummy)
5 bulk collect into l_tt
6 double
7 where 1 = 2;
8 because I in l_tt.first... l_tt loop. Last
9 dbms_output.put_line (l_tt (i) .col1);
10 end of loop;
11 end;
12.
declare
*
ERROR on line 1:
ORA-06502: PL/SQL: digital error or value
ORA-06512: at line 8 level
You should test if there is in fact no value before attempting to access the object.
SQL > declare
l_tt 2 test_tab;
3. start
4. Select test_type (dummy)
5 bulk collect into l_tt
6 double
7 where 1 = 2;
8 if l_tt.count > 0 then
9 because loop me in l_tt.first... l_tt. Last
10 dbms_output.put_line (l_tt (i) .col1);
11 end of loop;
12 on the other
13 dbms_output.put_line ('no statistics obsolete');
14 end if;
15 end;
16.
No stale stats
PL/SQL procedure successfully completed.
John
-
ORA-06502 error digital or value of PL/SQL.
Hi experts,
Oracle Apex 4.2, 11g database, using windows 7.
I created a form and trying to create automatically generated # (sequence of not) with logic and SQL.
My requirement is to generate the good good exercise only and exercise begin from 01 July and ends 30 June each year. This means if the 07/01/2015 start it will create a new voucher No.
The table name is GL_PV and the columns are:
Number of PV_No
Date of PV_Date
Number of CC_code
number amount
Remarks varchar2 (100)
What I did: -.
Created a process to submit before the calculations and validations.
Code are
IF TO_NUMBER (TO_CHAR (: P15_pv_date, 'MM')) < = 6 THEN
SELECT MAX (to_number (nvl(pv_no,0))) + 1
IN: P15_pv_no
OF GL_PV
WHERE pv_date
BETWEEN
TO_DATE ('01 - JUL' |) ' -'|| (TO_NUMBER (TO_CHAR(:P15_pv_date,'YYYY'))-1), 'DD-MON-YY')
AND
TO_DATE (30 - JUN'|) ' -'|| To_char(:P15_pv_date,'YYYY'), 'DD-mon-YY')
and cc_code =: P15_cc_code;
ON THE OTHER
SELECT MAX (to_number (nvl(pv_no,0))) + 1
IN: P15_pv_no
OF GL_PV
WHERE pv_date
BETWEEN
TO_DATE ('01 - JUL' |) ' -'|| To_char(:P15_pv_date,'YYYY'), 'DD-mon-YY')
AND
TO_DATE (30 - JUN'|) ' -'|| (TO_NUMBER (TO_CHAR(:P15_pv_date,'YYYY')) + 1), 'DD-MON-YY')
and cc_code =: P15_cc_code;
END IF;
If: P15_pv_no is null then
: P15_pv_no: = 1;
end if;
and press the button when Conditions = Generate_Button
I have the default assign to pv_date = sysdate, when I launched the point Pv_date form shows the current date and I click on Generate_button now show error.
Error ORA-06502 PL/SQL digital or value. Conversation number character.
One last thing, I checked this code already in TOAD, type I assigned as DATE-value = 10/11/2014 (today's date) works fine without error.
Please guide what this evil is stated.
Best regards
: P15_pv_date is probably not a date but a varchar2 in Apex
Try this
NVL SELECT (MAX (to_number (nvl(pv_no,0))) + 1, 1)
IN: P15_pv_no
OF GL_PV
WHERE pv_date
BETWEEN to_date (' 01-07-' |) (extract (year of to_date (: P15_pv_date, "dd-mm-yyyy")) + case when extracted (months to_date (: P15_pv_date, "dd-mm-yyyy")))<= 6="" then="" -1="" else="" 0="" end="" ),="" 'dd-mm-yyyy'="">=>
AND to_date (30 - 06-' |) (extract (year of to_date (: P15_pv_date, "dd-mm-yyyy")) + case when extracted (months to_date (: P15_pv_date, "dd-mm-yyyy")))<= 6="" then="" 0="" else="" 1="" end="" ),="" 'dd-mm-yyyy'="">=>
and cc_code =: P15_cc_code;
-
Is any idea available in the process of disassembly of the table or restore the line to line 22?
I see a bunch of discussions on the subject, but no clear solution/answer...
What could be the causes of this error?
I had two process of disassembly on the level now, and one of them had failed with this error. Displacement of the failure of the process of disassembly compared to the level of the suite for the level of performance of test unit solved the error for a while, but after some more dragging the process of disassembly of the table (with about 500 cases) is permanent.
Please advise...
Thank you
Val
Well, had to create a bug officially... I hope this helps...
Bug 19696042 : UNIT TEST: disassembly of THE TABLE or LINE RESTORE failed: ORA-06502: STRING BUFFER TOO SMA
Thank you
Val
-
Getting Ora-06502: PL/SQL of Numeric or value error.
Hello
I m getting the following error when a calculation for form fields.
""Server Ajax Call returned error Ora-06502: PL/SQL digital error or value ".
I m using the dynamic action to calculate my value fields display. Here is the code of my DA.
(Required value) event: change
Selection type (required): product (s)
Article (s) (required): P141_PROP_COST, P141_DOWNPAY_AMT, P141_PREM_PERC, P141_DOWNPAY_PERC, P141_PREM_AMT
Begin
: P141_TOTAL_SELL_PRICE: =: P141_DOWNPAY_AMT +: P141_PREM_AMT;
: P141_COMM_AMT: =: P141_TOTAL_SELL_PRICE*.02;
: P141_TOTAL_SELL_PRICE_FEE: =: P141_TOTAL_SELL_PRICE +: P141_TRANSFER_COST +: P141_COMM_AMt;
: P141_INST_REM_AMT: =: P141_PROP_COST-: P141_DOWNPAY_AMT;
End;
Page point to presented: P141_PROP_COST, P141_DOWNPAY_AMT, P141_PREM_AMT, P141_TRANSFER_COST
Return point page: P141_TOTAL_SELL_PRICE, P141_COMM_AMT, P141_TOTAL_SELL_PRICE_FEE, P141_INST_REM_AMT
I m using another DA for the calculation and validation of my form fields rest. Here is the code:
{$("#P141_DOWNPAY_PERC").change (function ()}
var x = ($("#P141_DOWNPAY_PERC").val () / 100) * $("#P141_PROP_COST").val ();
$("#P141_DOWNPAY_AMT").val (x);
});
{$("#P141_DOWNPAY_AMT").change (function ()}
If ($("#P141_DOWNPAY_AMT").val () > $("#P141_PROP_COST").val ())
{
Alert ("section may be no greater than the basic price");
}
on the other
{var y = ($("#P141_DOWNPAY_AMT").val () / ($("#P141_PROP_COST").val ())) * 100;}
y = Math.Round (y);
$("#P141_DOWNPAY_PERC").val (y) ;}
});
{$("#P141_PREM_PERC").change (function ()}
var x = ($("#P141_PREM_PERC").val () / 100) * $("#P141_PROP_COST").val ();
$("#P141_PREM_AMT").val (x);
});
{$("#P141_PREM_AMT").change (function ()}
If ($("#P141_PREM_AMT").val () > $("#P141_PROP_COST").val ())
{
Alert ("section may be no greater than the basic price");
}
on the other
{var z = ($("#P141_PREM_AMT").val () / ($("#P141_PROP_COST").val ())) * 100;}
z = Math.Round (z);
$("#P141_PREM_PERC").val (z) ;}
});
Any help.
Concerning
Pa'Problems of implicit conversion' comes to mind when I see this:
: P141_TOTAL_SELL_PRICE: =: P141_DOWNPAY_AMT +: P141_PREM_AMT;
This is similar to the problems I've seen when using the default formats for the Date Picker Item Types.
I will add in some APEX_DEBUG. MESSAGE() lines to check what are the string values.
(remember, all bind variables are of type VARCHAR2)
You should maybe explicitly to convert strings to numbers using TO_NUMBER() and include the appropriate format.
(a bit like you have to do with the conversion of strings to dates.)
My $0.02 worth
MK
Maybe you are looking for
-
Bookmarks have stopped working in Firefox 41.0.1
Bookmarks have stopped working (i.e. I can't create new ones) in Fx 41.0.1. My old favorites are still there and they still work as expected. In the past, when I created a bookmark (' bookmarks > Bookmark this page') I would get a dialog box so that
-
How to create A less B Mix?
I would take a stereo track, the left and right by 180 ° compared to the other channels and add them in mono to create A less B Mix. I know how to do this on a mixing console but I can't find the commands for this logic. Someone knows how to do this?
-
Toshiba key feature Suggestion - option to reverse the effect of the FN key
If there is an option to reverse the effect of FN + Fx, for example, if this option is enable pressing the F7 will increase the light and won't F7 effect, and so on for all other keys. If he can make more than 1 option in this idea, for example rever
-
printer won't print hp officejet 6500 a e710a
printer won't print, if you please, emergency aid
-
3 X TC will not work with Tamron lens
I need help, I bought a Soligor 3 X Converter TV for use with my Tamron 150 ~ 600 mm lens, the body is a 60 d. The problem is when I try to take a shot I get an error message "Err 01 communication between the camera and lens is faulty. Clean the cont