Exception ORA when accepting SQL Tuning Set
Hello
RDBMS version: 11.2.0.1.0 & 11.2.0.4.0
OS: OEL 5 (64-bit)
I am creating a SQL tuning set and get both to do exception below. Tried to search on the forums also with the exception of the ORA, but unable to get any resolution for this exception ORA.
The following awards were made: -.
GRANT CREATE ANY SQL PROFILE TO SCOTT; GRANT DROP ANY SQL PROFILE TO SCOTT; GRANT ALTER ANY SQL PROFILE TO SCOTT; GRANT ADVISOR TO SCOTT; GRANT ADMINISTER SQL MANAGEMENT OBJECT TO SCOTT; grant execute on dbms_spm to SCOTT; grant administer sql management object to SCOTT;
DECLARE my_task_name VARCHAR2(30); my_sqltext CLOB; my_sqlprofile_name VARCHAR2(4000); BEGIN my_sqltext := 'SELECT * FROM emp'; my_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_text => my_sqltext, user_name => 'SCOTT', scope => 'COMPREHENSIVE', time_limit => 60, task_name => 'my_sql_tuning_task3', description => 'Demo Task to tune a query'); DBMS_SQLTUNE.EXECUTE_TUNING_TASK( task_name => 'my_sql_tuning_task3'); my_sqlprofile_name := DBMS_SQLTUNE.ACCEPT_SQL_PROFILE (task_name =>'my_sql_tuning_task3', name => 'my_sql_profile'); -- Culprit for the exception --dbms_output.put_line(my_sqlprofile_name); END; / Error report - ORA-13786: missing SQL text of statement object "1" for tuning task "my_sql_tuning_task3" ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95 ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 16255 ORA-06512: at "SYS.PRVT_SQLPROF_INFRA", line 31 ORA-06512: at "SYS.DBMS_SQLTUNE", line 7133 ORA-06512: at line 4 13786. 00000 - "missing SQL text of statement object \"%s\" for tuning task \"%s\"" *Cause: The user attempted to accept SQL profile for an object that has not a SQL text associated to it. *Action: Check the identifier of the object and retry the operation.
Would be really grateful if someone could point me in the right direction here.
TIA...
Personally, I wouldn't bother with a task of setting.
If you are lucky who will recommend a sql profile based on adjustments of cardinality which may or may not be effective.
I would just use either the COE_XFR_SQL_PROFILE. SQL script SQLT ( doc-id 1487302.1Support) or use SQL Plan baseline to apply the previous execution plan. The latter has the advantage of being able to make an evolution controlled all plans potentially better which would otherwise be generated.
You can choose the older, better plan AWR in the same database or a different database, and then transport it.
Tags: Database
Similar Questions
-
ORA-13754: 'SQL Tuning Set' 'string' does not exist for the user "sysman."
ORA-13754: 'SQL Tuning Set' 'string' does not exist for the user "sysman."
Hello
in 10g R2 when I run the following in isqlplus I error of the United Nations:
No problem if I run it as sys to sqlplus.SELECT * FROM TABLE(DBMS_SQLTUNE.SELECT_SQLSET( 'my_sql_tuning_set', '(disk_reads/buffer_gets) >= 0.05')); ORA-13754: "SQL Tuning Set"'my_sql_tuning_set" does not exist for user "sysman".
Thanks for the help.
How to activate for sys isqlplus?You are logged in as sysman,
Check the user from the sql prompt.
show user
-
List of the SQL tuning sets without OEM
Hello.
I want to know what table is used to store the SQL tuning games/SQL tuning set names. I know that I can easily find the SQL tuning set OEM list, but I want to know about table/dynamic views.
I Googled it but not able to find the table that stores the sql tuning set of tables.
Thank you.
B. Dave
Try different words in google, I used and had to be included... in google...
the value SQL tuning oracle dictionary tables
- Information Advisor views, such as
DBA_ADVISOR_TASKS
,DBA_ADVISOR_EXECUTIONS
,DBA_ADVISOR_FINDINGS
,DBA_ADVISOR_RECOMMENDATIONS
, andDBA_ADVISOR_RATIONALE
views. - SQL tuning views of information, such as
DBA_SQLTUNE_STATISTICS
,DBA_SQLTUNE_BINDS
, andDBA_SQLTUNE_PLANS
views. - SQL Tuning Set views, such as
DBA_SQLSET
,DBA_SQLSET_BINDS
,DBA_SQLSET_STATEMENTS
, andDBA_SQLSET_REFERENCES
views. - Information about captured execution plans for statements in SQL Tuning sets are displayed in the
DBA_SQLSET_PLANS
andUSER_SQLSET_PLANS
views. - SQL profile information is displayed in the
DBA_SQL_PROFILES
view. TheTYPE
parameter indicates if the SQL profile has been created manually by the SQL Setup Assistant (ifTYPE
=MANUAL
) or automatically by the auto tuning SQL (ifTYPE
=AUTO
). - Progress of enforcement Advisor information are displayed in the
V$ADVISOR_PROGRESS
view.
- Information Advisor views, such as
-
SQL tuning set for SQLID specific
Hello
Is it possible to create the SQL tuning set the specific SQLID for?
Thanks in advance!you have a code or a package to do that?
As long as these statements are in AWR or the cursor cache, you can use
DBMS_SQLTUNE.SELECT_CURSOR_CACHE
or
DBMS_SQLTUNE.SELECT_WORKLOAD_REPOSITORY
For example, something like this:
begin DBMS_SQLTUNE.CREATE_SQLSET( sqlset_name => 'my_tuning_set', description => 'my tuning set'); end; / DECLARE baseline_cursor DBMS_SQLTUNE.SQLSET_CURSOR; BEGIN OPEN baseline_cursor FOR SELECT VALUE(p) FROM TABLE(DBMS_SQLTUNE.SELECT_CURSOR_CACHE (basic_filter => 'sql_id in (''1'',''2'',''3'')', attribute_list => 'ALL' )) p; DBMS_SQLTUNE.LOAD_SQLSET( sqlset_name => 'my_tuning_set', populate_cursor => baseline_cursor); END; /
-
SQL Tuning sets and SQL Tuning Advisor.
Hello
We run oracle11g r2 where under win server 2008 R2.
How can I find out when Tuning SQL and SQL Tuning games advisors are enabled in my database.
Is Oracle11g has default setting YES for this tuning packs
Thank you
It seems you found somone activated of sets and the setting of advisers. as others have said, theyre part of the D & T and theyre always there but only, you become eligible for a permit after that you use. This will tell you the first time they have been used if at all, the key here for you field be FIRST_USAGE_DATE that must be completed only if detected_usages > 0
fixed lines 180
Col name format a30
SELECT name, version, detected_usages, FIRST_USAGE_DATE, last_usage_date
of DBA_FEATURE_USAGE_STATISTICS
where upper (NAME) like '% % TUNING '.
-
Types of return ORA-06504 PL/SQL result set query or variables do not match
I reproduced with a bunch of proc a simple. How to do this? I tested it using the tool DEVELOPER PL/SQL for oracle. Is the tool the problem?
create or replace package pkg_test is
(Test_it) PROCEDURE
po_cursor OUT NOCOPY sys_refcursor
)
;
end pkg_test;
create or replace package body is pkg_test
PROCEDURE test_it (po_cursor OUT NOCOPY sys_refcursor)
AS
PROCEDURE open_out_cursor
IS
BEGIN
OPEN FOR Po_cursor
SELECT enum, ename FROM employee
;
END open_out_cursor;
BEGIN
open_out_cursor;
END test_it;
end pkg_test;
create or replace procedure test_proc
is
v_emp_cursor sys_refcursor;
type t_emp_in is record
(
enum employee.enum%TYPE,
Ename employee.ename%TYPE
);
v_emp_rec t_emp_in;
Start
pkg_test.test_it (v_emp_cursor);
LOOP
extract the v_emp_cursor in v_emp_rec; -Error ORA-06504
EXIT WHEN v_emp_cursor % NOTFOUND;
DBMS_OUTPUT. Put_line (' number of emp = ' | v_emp_rec.enum);
DBMS_OUTPUT. Put_line (' name of emp = ' | v_emp_rec.ename);
END LOOP;
close v_emp_cursor;
end test_proc;Jin
SQL> create or replace package pkg_test is 2 PROCEDURE test_it ( 3 po_cursor OUT NOCOPY sys_refcursor 4 ) 5 ; 6 end pkg_test; 7 / Package created. SQL> create or replace package body pkg_test is 2 PROCEDURE test_it ( po_cursor OUT NOCOPY sys_refcursor ) 3 AS 4 PROCEDURE open_out_cursor 5 IS 6 BEGIN 7 OPEN po_cursor FOR 8 SELECT empno,ename FROM emp 9 ; 10 END open_out_cursor; 11 BEGIN 12 open_out_cursor; 13 END test_it; 14 end pkg_test; 15 / Package body created. 1 create or replace procedure test_proc 2 is 3 v_emp_cursor sys_refcursor; 4 type t_emp_in is record 5 ( 6 enum emp.empno%TYPE, 7 ename emp.ename%TYPE 8 ); 9 v_emp_rec t_emp_in; 10 begin 11 pkg_test.test_it(v_emp_cursor) ; 12 LOOP 13 fetch v_emp_cursor into v_emp_rec.enum,v_emp_rec.ename; 14 EXIT WHEN v_emp_cursor%NOTFOUND; 15 DBMS_OUTPUT.PUT_LINE ('emp number = ' || v_emp_rec.enum); 16 DBMS_OUTPUT.PUT_LINE ('emp name = ' || v_emp_rec.ename); 17 END LOOP; 18 close v_emp_cursor; 19* end test_proc; SQL> / Procedure created.
and you want to learn more about slider REF... :)
PL/SQL 101: understanding of the Ref Cursor
PL/SQL 101: Understand the Ref CursorPublished by: babaravi on October 10, 2009 09:22
-
ORA-06502: PL / SQL: numeric or value error: character string buffer too small
Dear friends,
We have a package customized for FTP PLSQL.
I get ORA-06502: PL/SQL: digital or value error: character string buffer too small when the FTP service running.
The FTP function call the HOST function that is in fact to launch the above mentioned error.
Here is the code for FTP and HOST functions.FUNCTION HOST(text_in IN VARCHAR2, result_out IN OUT VARCHAR2) RETURN BOOLEAN IS ret boolean; drun boolean; hid number; BEGIN dbms_output.put_line('host1 begin'); ret := HOST(text_in,result_out,hid,drun,1); if not drun then dbms_output.put_line('not derun'); return false; end if; dbms_output.put_line('after if'); return ret; END HOST;
FUNCTION GET_ENV(env IN VARCHAR2) RETURN VARCHAR2 IS res boolean; out varchar2(256); BEGIN res := HOST('echo '||env,out); return out; END GET_ENV;
FUNCTION HOST(text_in IN VARCHAR2, result_out IN OUT VARCHAR2, hostid IN OUT NUMBER , demrunning IN OUT boolean, maxlines IN NUMBER DEFAULT NULL) RETURN BOOLEAN IS tempid number; tempstat varchar2(10); n number; m number; retry number; mult number; timestamp_date date; lv_result_out varchar2(200); BEGIN --result_out := NULL; --fcxh76 demrunning := true; dbms_output.put_line('host2 begin'); select XXAR_SHELL_CMD_S.nextval into tempid from dual; hostid := tempid; dbms_pipe.pack_message(tempid); n := dbms_pipe.send_message('CMD'); dbms_pipe.pack_message(abs(maxlines)); dbms_pipe.pack_message(rtrim(text_in)); n := dbms_pipe.send_message ('CMD'||rtrim(to_char(tempid)),0); m := dbms_pipe.receive_message('CMDSTAT'||rtrim(to_char(tempid)),5); if m = 1 then demrunning := false; dbms_output.put_line('m=1'); result_out := 'ERROR : GLCC0005 presumed not running'; dbms_output.put_line('result_out - '||result_out); return FALSE; elsif m = 0 then dbms_pipe.unpack_message(tempstat); end if; if tempstat = 'ERROR' then dbms_output.put_line('tempstat = ERROR'); result_out := NULL; dbms_output.put_line('after result out'); return FALSE; end if; <<CHECK_AGAIN>> m := dbms_pipe.receive_message('RSLT'||rtrim(to_char(tempid)),0); if m <> 0 then goto CHECK_AGAIN; end if; if m = 0 then dbms_pipe.unpack_message(result_out); dbms_pipe.purge('RSLT'||rtrim(to_char(tempid))); return TRUE; else result_out := 'ERROR : Call to GLCC0006 failed'; return FALSE; end if; END HOST;
Here is the PLSQL block that I will carry out and also the output on this blockFUNCTION FTP (program_name in VARCHAR2, source_file in VARCHAR2, dest_file in VARCHAR2 default NULL) RETURN BOOLEAN AS fd utl_file.file_type; res boolean; res1 boolean; out varchar2(256); out1 varchar2(256); ftp_dnsname varchar2(50); ftp_user varchar2(50); ftp_pass varchar2(50); ftp_pre_opt varchar2(150); ftp_post_opt varchar2(150); ftp_override varchar2(150); destination_file varchar2(50); ftp_command varchar2(2000); ftp_main varchar2(2000); proc_id varchar2(10); fderr varchar2(100); rec varchar2(1024); temp_buf varchar2(100); base_source varchar2(100); log_dir varchar2(100) := get_env('$APPLCSF')||'/log'; fndc_logfile_dir varchar2(100) := 'FNDC_LOGFILE_DIR'; i number ; ftp_tried boolean; begin ftp_tried := false; dbms_output.put_line('begin'); for ftp_rec in ( select attribute1, attribute2, attribute3, attribute4, nvl(attribute5,' ') attribute5, nvl(attribute6,' ') attribute6, nvl(rtrim(attribute7),'put') attribute7 from fnd_flex_values where flex_value_set_id in (select flex_value_set_id from fnd_flex_value_sets where flex_value_set_name = 'CPC_FTPS' ) and flex_value like program_name ) LOOP dbms_output.put_line('Looping'); ftp_tried := true; ftp_dnsname := ftp_rec.attribute1; ftp_user := ftp_rec.attribute2; ftp_pass := ftp_rec.attribute3; destination_file := ftp_rec.attribute4; if dest_file is not null then destination_file := dest_file; end if; if destination_file is null then destination_file := base_name(source_file); end if; ftp_pre_opt := ftp_rec.attribute5; ftp_post_opt := ftp_rec.attribute6; ftp_override := lower(ftp_rec.attribute7); dbms_output.put_line('host'); res := HOST('echo $$',proc_id); dbms_output.put_line('proc_id - '||proc_id); dbms_output.put_line('after host'); base_source := rtrim(base_name(source_file)); dbms_output.put_line('host 1'); res := HOST('> '||log_dir||'/ftpcmd.'||proc_id || ' ; chmod 777 '||log_dir||'/ftpcmd.'||proc_id,out1); dbms_output.put_line('host 2'); res := HOST('> '||log_dir||'/ftpmain.'||proc_id || ' ; chmod 777 '||log_dir||'/ftpmain.'||proc_id,out1); dbms_output.put_line('host 3'); res := HOST('> '||log_dir||'/ftplog.'||proc_id || ' ; chmod 777 '||log_dir||'/ftplog.'||proc_id,out1); dbms_output.put_line('host completed'); ...... ...... ......
Output:declare lv_ftp_result boolean; begin lv_ftp_result := u.FTP('XXAR_REV_PA', ' ' || '/u07/app/qaoa083a/data/outgoing/xxar/PARECREV' || '/' || 'REVENUE_20120319014318.dat','REVENUE_20120319014318.dat'); IF lv_ftp_result THEN dbms_output.put_line('True'); ELSE dbms_output.put_line('False'); END IF; exception when others then dbms_output.put_line('in exception - '||sqlerrm); end;
The flow of execution goes like this:host1 begin host2 begin m=1 result_out - ERROR : GLCC0005 presumed not running not derun begin Looping host host1 begin host2 begin m=1 in exception - ORA-06502: PL/SQL: numeric or value error: character string buffer too small
1 FTP function called from PL/SQL block
2 inside of the FTP service, the Sub statement calls the HOST function
3. This HOST function in turn calls another function of overloaded HOST (code shown above).log_dir varchar2(100) := get_env('$APPLCSF')||'/log';
4. in the function overloaded with the HOST, the following statements are executed successfully, and FALSE is returned by the function
5. the remaining code in the FTP service is running and the HOST function is called again using the Sub statementdbms_output.put_line('m=1'); result_out := 'ERROR : GLCC0005 presumed not running'; dbms_output.put_line('result_out - '||result_out);
6.again, this HOST function in turn calls another function of overloaded HOST (code posted above).res := HOST('echo $$',proc_id);
7. this time, in the function overloaded host, ORA-06502 is thrown when the following statement is executed and the execution stops here that this exception is unhandled.
This statement is very successfully in the previous call to the function of HOST (step 4), but it fails now.result_out := 'ERROR : GLCC0005 presumed not running';
Any idea on why this error occurs in this scenario? Because the issue of memory?
DB Info:
Kind regardsOracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production PL/SQL Release 11.2.0.1.0 - Production
Anthony
Published by: Anthony Alix on March 20, 2012 08:53Hello
HOST (1) calls the function of MODERATOR (2) with his second parameter as result_out
The first time you call the function of host (1) in the function get_env you use
... out varchar2(256); BEGIN res := HOST('echo '||env,out); ...
out is big enough varchar2 (256)
The second time you call (1) HOST of the FTP function as:
... ftp_main varchar2(2000); proc_id varchar2(10); fderr varchar2(100); ... ... res := HOST('echo $$',proc_id); dbms_output.put_line('proc_id - '||proc_id); ...
Here, use you proc_id which is varchar2 (10)
And it's not big enough!
Kind regards
Peter
-
ORA-06502: PL/SQL: digital or value error: character buffer t string
I understand the error, but I don't know where is the case,
The error
Exception: ORA-06502: PL/SQL: digital or value error: character buffer t string
Little OO
I know that to be here: but it makes no sense I got anought space, I got same increse VARCHAR2 (42); for VARCHAR2 (100);
I guess my question is is there a way to debug, so I can see exactly which variable creates the problem.
There is a lot of code, I hate to put all the code here, please help I'm stuck!
PROCEDURE process2 ( v_aidy_code IN faismgr.rorstat.rorstat_aidy_code%TYPE ) IS v_filename1 VARCHAR2 (42); v_filename2 VARCHAR2 (42); v_path VARCHAR2 (26); v_file_out1 UTL_FILE.file_type; v_file_out2 UTL_FILE.file_type; w_pidm faismgr.rorstat.rorstat_pidm%TYPE; w_match1_no NUMBER; w_match2_no NUMBER; w_match3_no NUMBER; w_match4_no NUMBER; w_match5_no NUMBER; w_match6_no NUMBER; w_match7_no NUMBER; w_match8_no NUMBER; w_pidm_check faismgr.rorstat.rorstat_pidm%TYPE; w_ssn_check saturn.spbpers.spbpers_ssn%TYPE; w_idoc_id_no_check NUMBER; w_pidm_no NUMBER; w_comment ryridoc_cover.nomatch_comment%TYPE; w_ryridoc_insert VARCHAR2 (1); w_tgrp_code faismgr.rorstat.rorstat_tgrp_code%TYPE; w_ntf VARCHAR2 (1); d_space5 VARCHAR2 (5); w_no_recs NUMBER; w_no_1recs NUMBER; w_no_2recs NUMBER; w_no_notprocessed NUMBER; w_no_questionable NUMBER; w_no_subsequent VARCHAR2 (1); BEGIN --v_path := '/' || SUBSTR (database_name, 1, 4) ---- || '/u02/sct/banner/bandev2/middlebury/dat_files'; v_path := 'MIDD_DATA' ; v_filename1 := 'idoc_nomatch' || TO_CHAR (SYSDATE, 'yyyymonddhhmiss') || '.lis'; v_filename2 := 'idoc_error' || TO_CHAR (SYSDATE, 'yyyymonddhhmiss') || '.lis'; v_file_out1 := UTL_FILE.fopen (v_path, v_filename1, 'w'); v_file_out2 := UTL_FILE.fopen (v_path, v_filename2, 'w'); d_space5 := ' '; w_no_recs := 0; w_no_1recs := 0; w_no_2recs := 0; w_no_notprocessed := 0; w_no_questionable := 0; w_match1_no := 0; w_match2_no := 0; w_match3_no := 0; w_match4_no := 0; w_match5_no := 0; w_match6_no := 0; w_match7_no := 0; w_match8_no := 0;
Certainly an improvement, you are now thank yourself.
You are welcome, regardless of the problem.
Concerning
Peter -
ORA-01194 and ORA-00604 when using backup controlfile set #2
Oracle 11.2.0.1 database version
Enterprise Linux 5.4
Database is in archivelog mode.
I'm trying to recover a database according to a backup controlfile to trace #2. Create the controlfile works very well, but recover the database fails.
From what I understand, the recovery fails because it cannot roll forward - 39 sequence is in the online missing redo log file. However, the database opens with the restlogs option and I understand that it should use the archivelogs in order to roll back. Since it is a new controlfile he does not know the archivelogs, but he does not accept to register or use archivelog files.
The recovery as shown in set #2 doesn't seem to work as expected. Any ideas?
Following errors:
Thank youSQL> CREATE CONTROLFILE REUSE DATABASE "RCAT" RESETLOGS ARCHIVELOG etc. Control file created. Tyring to register on of the archivelogs does not work: SQL> ALTER DATABASE REGISTER LOGFILE '/u02/fra/RCAT/archivelog/2010_09_19/o1_mf_1_33_69bfo5tx_.arc'; ALTER DATABASE REGISTER LOGFILE '/u02/fra/RCAT/archivelog/2010_09_19/o1_mf_1_33_69bfo5tx_.arc' * ERROR at line 1: ORA-00604: error occurred at recursive SQL level Applying an existing archivelog during recovery does not work: SQL> recover database using backup controlfile until cancel Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /u02/fra/RCAT/archivelog/2010_09_19/o1_mf_1_33_69bfo5tx_.arc ORA-00310: archived log contains sequence 33; sequence 39 required ORA-00334: archived log: '/u02/fra/RCAT/archivelog/2010_09_19/o1_mf_1_33_69bfo5tx_.arc' ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below ORA-01194: file 1 needs more recovery to be consistent ORA-01110: data file 1: '/u02/RCAT/datafile/o1_mf_system_6959kz7l_.dbf' ls -l /u02/fra/RCAT/archivelog/2010_09_19: -rw-r----- 1 oracle dba 49313280 Sep 19 00:01 o1_mf_1_33_69bfo5tx_.arc -rw-r----- 1 oracle dba 312320 Sep 19 00:03 o1_mf_1_34_69bft63b_.arc -rw-r----- 1 oracle dba 20343808 Sep 19 02:10 o1_mf_1_35_69bo6y6j_.arc -rw-r----- 1 oracle dba 40960 Sep 19 02:12 o1_mf_1_36_69boc9t8_.arc -rw-r----- 1 oracle dba 20992 Sep 19 02:13 o1_mf_1_37_69bofng4_.arc -rw-r----- 1 oracle dba 794624 Sep 19 02:15 o1_mf_1_38_69bokwbf_.arc
MarkusMarkus Waldorf wrote:
I think that I am aware and do not suggest to use the hidden setting.What worries me is that the value #2 of the controlfile to trace the contours of the database backup can be recovered even with the lack of recovery online newspapers, but apparently this is not the case. What I also don't understand, is why he simply not restore using the information of the archivelogs. The database was not shut down properly, but isn't always the case when you lose again-online newspapers?
Here is the text of the controlfile.sql
-Set #2. RESETLOGS case
--
-The following commands will create a new control file and use
-to open the database.
-The data used by the Recovery Manager will be lost.
-The content of online newspapers will be lost and all backups
-be invalidated. Use this option only if online newspapers are damaged.Published by: Markus Waldorf Sep 20, 2010 09:34
You are right. But it is especially the case.perform, create the new database and will stop immediately (without demolition) and remove newspapers online OS level. And try to recover the database using backup controlfile until cancel or just recover database until cancel then enter Word Cancel and resetlogs option database open. It will work. Because it actually do not need any recovery operation. But your case you need to recover the database. You consider backup restore las and perform incomplete recovery. I think you can do the first test.
-
FRM - 40735:when - button-trigger pressed raised unhandled exception ORA-24247
Hi all
I use the 10g release2 form I'm having a problem
When I use the following stored procedure in form so I get this
error.
FRM - 40735:when - button-trigger pressed raised unhandled exception ORA-24247
but the same code works fine when I use in SQLPLUS.
and it is used in form release button when pressed.CREATE OR REPLACE PROCEDURE mail_attach (dir1 VARCHAR2, filename VARCHAR2) AS l_output utl_file.file_type; l_file RAW(32767); l_size NUMBER; BLOCK NUMBER; b BOOLEAN; l_start NUMBER := 1; TYPE ARRAY IS TABLE OF VARCHAR2(255); l_data ARRAY := ARRAY([email protected]'); BEGIN UTL_FILE.FGETATTR(dir1, filename, b, l_size, BLOCK); l_output := utl_file.fopen('BACKUP', 'code.txt', 'r' ); utl_file.get_raw(l_output, l_file, l_size); utl_file.fclose( l_output ); FOR i IN l_start .. l_data.COUNT LOOP UTL_MAIL.SEND_ATTACH_RAW ( sender => 'Mailer', recipients => l_data(i), subject => 'Data for ' || TO_CHAR((SYSDATE-1),'DD-MON-YYYY'), attachment => l_file, message => 'Dear User, Please find attached the upload data for the period mentioned in the subject line.', att_inline => FALSE, att_filename => filename); l_start := l_start + 1; END LOOP; END;
BEGIN mail_attach('UTL_PATH','code.txt'); message('FIle send successfully'); message('File send successfully'); END;
Hello
Try the following...
SQL> show user; USER is "SYS" SQL> GRANT EXECUTE ON DBMS_FGA TO MAIL; Grant succeeded. SQL> GRANT CREATE PROCEDURE, DROP ANY PROCEDURE TO MAIL; Grant succeeded. SQL> GRANT EXECUTE ON UTL_TCP TO MAIL; Grant succeeded. SQL> GRANT EXECUTE ON UTL_SMTP TO MAIL; Grant succeeded. SQL> GRANT EXECUTE ON UTL_ENCODE TO MAIL; Grant succeeded. SQL> GRANT EXECUTE ON DBMS_NETWORK_ACL_ADMIN TO MAIL; Grant succeeded
Sarah.
-
Query SQL and Exception ORA-01722
Hello
I have a table called t_lookup that contains three columns of the argument lookup_value, Description and Lookup_Type they are all of type varchar2. If I run the query, its working fine below
SELECT *.
FROM (SELECT lookup_value
*, To_Number (Description) Dd *.
OF t_Lookup
WHERE Lookup_Type = 'CALENDAR') Tab ;
Here is the result
Lookup_value argument... DD
---------------------------------------.
January... 1
February... 2
March......................... 3
April........................... 4
May........................... 5
June.......................... 6
July........................... 7
August... 8
September... 9
October... 10
November... 11
December... 12
But when I run
SELECT *.
FROM (SELECT lookup_value
*, To_Number (Description) Dd *.
OF t_Lookup
WHERE Lookup_Type = 'CALENDAR') tab
AND Dd = 9;
then he throws exception ORA
ORA-01722: invalid number
Can someone help me on this in order to understand the cause of this problem? Oracle server that I use is "Oracle9i Release 9.2.0.8.0".
Thank youI guess it is expected that some of the descriptions will have non-numeric data, right?
Assuming that this is the case, the success or failure of the request depends on how the optimizer can choose to run your query. If it happens to run TO_NUMBER function before it filters a row with non-numeric data, you will get an error. When chasing the TO_NUMBER filtering all lines with non-numeric data, the query will be successful. Because query plans are subject to change, especially when you finally upgrade, you probably don't want just to find a SQL query that works, you will need to make sure that the query plan never changes or that the query is formulated in such a way that it will never fail.
My first thought would be to know if you really need store digital data in a field of VARCHAR2 in the first place. I guess it's a kind of generic lookup table (which causes a series of questions, what is a). Can we at least keep string, date and numbers given in separate columns?
Except, you can create your own function to PL/SQL that converts a string to a number and catches the exception?
CREATE OR REPLACE FUNCTION my_to_number( p_arg IN varchar2 ) RETURN NUMBER IS l_num NUMBER; BEGIN l_num := to_number( p_arg ); RETURN l_num; EXCEPTION WHEN others THEN RETURN NULL; END;
Who will ensure that the request is successful, regardless of the plan. Note that you probably want to catch just the error ORA-01722, not others, in your actual code - this is just a sample.
Except that, you will need to do something to strengthen stability in the query plan. A stored outline, which forces the query to use the query plan that does not generate an error.
Justin
-
FRM - 40735:when - button-trigger pressed raised unhandled exception ORA-01841
Hi all
I m this error FRM-40735: when pressed to shutter raised unhandled exception ORA-01841
and relaxation that I wrote is like that: -.
DECLARE
CURSOR I IS SELECT SANCDATE, REFNO, PRINCIPALAMT, SANCAMT, TOTINSTALMENT, RATERECOVERY, AMTRECOVERED, INSTALMENTRECOVERED,.
STARTYEARMM, ENDYEARMM
OF PRMALOAN
WHERE EMPNO =: PRMALOAN. EMPNO
AND EARNINGDEDUCTION =: PRMALOAN. EARNINGDEDUCTION
AND PAYCALPERIOD IS SET TO NULL;
d date: = to_date('200908','yyyymm');
date of s;
f date;
BEGIN
go_block ('prmaloan2');
OPEN I;
LOOP
I GET: PRMALOAN2. SANCDATE,: PRMALOAN2. REFNO,: PRMALOAN2. PRINCIPALAMT,: PRMALOAN2. SANCAMT,: PRMALOAN2. TOTINSTALMENT,
: PRMALOAN2. RATERECOVERY,: PRMALOAN2. AMTRECOVERED,: PRMALOAN2. INSTALMENTRECOVERED,: PRMALOAN2. STARTYEARMM,: PRMALOAN2. ENDYEARMM;
s: = to_date (':prmaloan2.startyearmm ','yyyymm ');
e: = to_date (':prmaloan2.endyearmm ','yyyymm ');
If
e a null value
then
: prmaloan2. TEXT_ITEM164: = MONTHS_BETWEEN (d, s);
exit when I % notfound;
next_record;
end if;
end loop;
proximity I;
END;
Please help me to remove this errorHello!
s:=to_date(':prmaloan2.startyearmm','yyyymm'); e:=to_date(':prmaloan2.endyearmm','yyyymm');
won't. Replace:
s:=to_date( :prmaloan2.startyearmm, 'yyyymm' ); e:=to_date( :prmaloan2.endyearmm, 'yyyymm');
Concerning
-
Cannot access Firefox sync. My email address is not accepted when I try to set up a new account or enter an account that I may have. Frustrating, because I need to move my favorites to a new computer. Thanks in advance.
Ignore this message until all characters for your e-mail address are typed on the input field.
-
FRM-40735 when-pressed to release raised unhandled exception ora-06502 button?
I write the following procedure
PROCEDURE p73_fragment_metar (p_metar in varchar2, varchar2, out p_dy Code_P varchar2, p_hr out varchar2,)
p_dd number, p_ff series, p_tt number of p_dp number, p_qnh number.
p_mn out varchar2, p_year out varchar2)
IS
-p_metar varchar2 (500);
str_date_code Varchar2 (500);
code varchar2 (10);
DY varchar2 (10);
HR varchar2 (10);
str_dd_ff Varchar2 (500);
JJ varchar2 (10);
VARCHAR2 (10) FF.;
str_tt_dp varchar2 (500);
TT varchar2 (10);
VARCHAR2 (10) DP;
qnh_str varchar2 (500);
QNH varchar2 (10);DAT varchar2 (20);
MNTH varchar2 (20);
VARCHAR2 (10) years;
BEGIN
-p_metar: = 'OJAM 171600Z 32010KT 5000 HZ SCT030 11/05 Q1023 NOSIG';
str_date_code: = substr (p_metar, 1, length (DelimStr.GetString (p_metar, 1, FALSE, 'Z')) + 2);
Code: = substr (str_date_code, 1, length (str_date_code)-9);
Code_P: = code;dy: = substr (str_date_code, length-7 (str_date_code), 2);
p_dy: = dy;HR: = substr (str_date_code, length-5 (str_date_code), 4);
p_hr: = h;
-- --------------------------------------------------------------------------------------
-str_dd_ff: = substr (p_metar, 1, length (DelimStr.GetString (p_metar, 1, FALSE, 'KT')) + 0);
-dd: = substr (str_date_code, length-5 (str_dd_ff), 3);
DD: = substr (p_metar, 14, 3);
p_dd: = to_number (dd);FF: = substr (p_metar, 17, 2);
p_ff: = to_number (ff);-- --------------------------------------------------------------------------------------
str_tt_dp: = substr (p_metar, 1, length (DelimStr.GetString (p_metar, 1, FALSE, ' /')) + 3);TT: = substr (str_tt_dp, length-5 (str_tt_dp), 3);
p_tt: = to_number (tt);DP: = substr (str_tt_dp, length (str_tt_dp)-1, 3);
p_dp: = to_number (dp);
-- -------------------------------------------------------------------------------------
qnh_str: = substr (p_metar, 1, length (DelimStr.GetString (p_metar, 1, FALSE, 'Q')) + 5);
QNH: = substr (qnh_str, length (qnh_str)-3, 5);
p_qnh: = to_number (qnh);-- -------------------------------------------------------------------------------------
Select to_char (sysdate) in DUAL from SWD;
month: = substr (dat, length (dat)-5, 3);
p_mn: = mnth;
years: = '20'. substr (dat, length (dat)-1, 3);
p_year: = years;
-- ---------------------------------------------------------------------------------
/ * p05_show_alert_message (code);
p05_show_alert_message (dy);
p05_show_alert_message (HR);
p05_show_alert_message (DD);
p05_show_alert_message (FF);
p05_show_alert_message (TT);
p05_show_alert_message (DP);
p05_show_alert_message (QNH);
p05_show_alert_message (MNTH);
p05_show_alert_message (years); * / This loaded message to be sure and beach t each variable is it has the correct value
END;
I try to call hollow a trigger when the button as followsDeclare
p_metar varchar2 (500);
Code_P varchar2 (10);
p_dy varchar2 (10);
p_hr varchar2 (10);p_dd number (4.4);
p_ff number (4.4);p_tt number (4.4);
p_dp number (4.4);
p_qnh number (4.4);p_mn varchar2 (20);
p_year varchar (10);Begin
p_metar: = 'OJAM 171600Z 32010KT 5000 HZ SCT030 11/05 Q1023 NOSIG';
p73_fragment_metar (p_metar, Code_P, p_dy, p_hr, p_dd, p_ff, p_tt, p_dp, p_qnh, p_mn, p_year);END;
When the p73_fragment_metar PROCEDURE is called, I receive the following error message:
FRM-40735 when-pressed to release raised unhandled exception ora-06502 button?Don't know if this is the reason, but are you sure that it is correct
p_dd number (4.4);
This means that you put a number with no figures before the commae and 4 digits after the decimal point, means you can't store something like 1 in it.
-
FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06508
Hi all
Pending Production, we have a problem on invoice AP Workbench, gives an error (FRM-40735 after query Trigger on level Bill) when we recover the existing data of the invoice is entered.
For this we have compiled the invalid objects and applied the patch according to metalink id [ID 1209736.1]
After that we came up with new error FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06508.
Can someone help us
Thank you
SAISAI,
Thanks for the update and share the solution.
Hussein
Maybe you are looking for
-
Wireless LAN not working after restart
Hey My all new laptop suddenly deleted earlier today and when I restarted it I noticed that my wifi is not working. It is also asking me to install a new driver, the network controller? I'm confused that everything worked well and all of a sudden it'
-
Apple does not accept my password Apple ID in my iPhone
Hello guys I have a problem with my Apple ID My ID apple won't accept the password on my iPhone (iOS 9.2) 5s but when I connect my 3rd iPad (iOS 9.2), it can so my iPhone stuck on iCloud because unable to connect #SorryForBadEnglish
-
Error code: 080070424 (cannot install updates)
whenever I turn on my PC I get a window saying "windows cannot verify the update. When I do it manually, I get "error (s) Found: Code 80070424 Windows Update encountered an unknown error." I have followed all appropriate assistance, but it still does
-
The turn of my computer in the start menu has changed to Shut Down
Can someone tell me how I can get check it off my computer back in the start menu? I now have what looks like the old classic style of 'Shut Down' with the screen following with a "Shut down Windows" dialog box. Shut Down using works well but I prefe
-
Operating system does not support Microsoft Fix - It
Try to download the microsoft fix - it. Impossible Solution Center to-said response system does not support. How can I get my system to support?