compilation packages or procedures
HelloI am compiling a package, procedures, etc. The query returns with invalids. I show error. How to retrieve more detailed information on why the package/procedure/view are invalid?
DECLARE
v_status VARCHAR2(10);
v_cmd VARCHAR2(150);
Cursor rw_objects
IS
Select object_name,object_type,status,owner
From dba_objects
WHERE UPPER(object_type) IN ('VIEW','PROCEDURE','FUNCTION','PACKAGE', 'PACKAGE BODY','TRIGGER','SYNONYM')
AND owner = UPPER('&&DW_SCHEMA')
AND status = 'INVALID';
BEGIN
FOR t IN rw_objects
LOOP
IF t.object_type ; IN ('SYNONYM','VIEW','TRIGGER','PROCEDURE','FUNCTION') THEN
v_cmd := 'ALTER ' || t.object_type || ' ' || t.owner||'.'||t.object_name || ' COMPILE ';
execute immediate v_cmd;
ELSIF
t.object_type ; = ('PACKAGE') THEN
v_cmd := 'ALTER PACKAGE ' || ' ' || t.owner||'.'||t.object_name || ' COMPILE PACKAGE';
execute immediate v_cmd;
ELSIF
t.object_type ; = ('PACKAGE BODY') THEN
v_cmd := 'ALTER PACKAGE ' || ' ' || t.owner||'.'||t.object_name || ' COMPILE BODY';
execute immediate v_cmd;
dbms_output.put_line( rpad( t.object_type || ' ' || t.object_name, 50, ' ' ) || ' VALID ');
END IF;
END LOOP;
END;
/
SELECT object_name, object_type, status
FROM dba_objects
WHERE STATUS = 'INVALID'
AND UPPER(object_type) IN ('VIEW','PROCEDURE','FUNCTION','PACKAGE', 'PACKAGE BODY','TRIGGER','SYNONYM')
AND owner = UPPER('&&DW_SCHEMA')
ORDER by object_type;
show errors;
Here are the results.OBJECT_NAME OBJECT_TYPE STATUS
-------------------------------------------------------------------------------- ------------------- -------
PM206 PACKAGE BODY INVALID
DW_BE_DFACT_TB_REFRESH_HANDLER PACKAGE BODY INVALID
DW_BE_DFACT_TB_INITIAL_HANDLER PACKAGE BODY INVALID
CHART_HANDLER PACKAGE BODY INVALID
DW_CRS_HANDLER PACKAGE BODY INVALID
DELETE_UPDATE_PROC PROCEDURE INVALID
DW_CBS_PROC PROCEDURE INVALID
DW_GL_DFACT_VW VIEW INVALID
8 rows selected.
No errors.
What helps?
If you guessed it working you must post what the problem was and how you fixed it and give credit to those who have been helping you.
Then mark the ANSWERED thread.
Tags: Database
Similar Questions
-
Bug so that the editing and compilation of the procedure
Bug so that the editing and compilation of the procedure in Sql Developer 1.5.4
the error is
ORA-00904 'ATTRIBUTE' is not a valid identifier
Published by: user4448643 on March 16, 2009 05:09I get the same thing, it happens when I compile on our 9i database (Oracle9i Enterprise Edition Release * 9.2.0.4.0 *-Production). Even opened a package for editing gives error.
Compilation on our 10g database does not give an error (Oracle Database 10g Enterprise Edition Release * 10.2.0.4.0 *-64bi).
-
How to check the column updated whereby the package or procedure?
Hi all
Can someone help me how to check the column updated by which the package or procedure
A.Mahesh
Hello.
You can check what object is a reference to the table of the column:
Select *.
of all_dependencies d
where d.REFERENCED_NAME = '
. ' And you can find all the links to the object source data column:
Select *.
of s all_source
where s.name = "
." and s.OWNER = '
. ' and s.TYPE = "
." and as s.TEXT '%
%' -
Find out all the package and procedure names linked using an array of specifc
I have 25 packages
(DBA_SOURCE is not objective).
Each package contains 30-35 procedures
I need to find all packages and procedures
Each procedure handles the Tables from 5 to 20 according to the need of business rule.
I need the entire package and related procedure names where a specific Table name isQuick response appreciated.
Thank you and best regards,It is difficult to help you if you do not want to read what is suggested. The utldtree.sql script will do what you want. Read the first part of the script and it will tell you what it does and how it works:
>
REM $Header: utldtree.sql, v 1.2 1992/10/26 16:24:44 $ RKOOI Stab
REM
REM Copyright (c) 1991 by Oracle Corporation
REM NAME
REM deptree.sql - Show objects recursively depends on given object
REM DESCRIPTION
REM This procedure, temp and table will allow you to see all
Objects REM (recursively) depends on the given object.
REM Note: you will see the objects for which you have permission.
Examples of rem:
REM run deptree_fill ('procedure', 'scott', 'billing');
REM select * from deptree by seq #;
REM
REM Execute deptree_fill ('table', 'scott', 'emp');
REM select * from deptree by seq #;
REM
REM run deptree_fill ("package body ', 'scott', 'accts_payable'");
REM select * from deptree by seq #;
REM
Way prettier REM to display this information only
REM select * from deptree by seq #;
REM is
REM select * from ideptree;
REM This shows the relationship of dependence via indentation. View
REM that no order by clause is necessary with ideptree.
REM RETURNS>
Did you notice the part that says? :
>
REM Execute deptree_fill ('table', 'scott', 'emp');
REM select * from deptree by seq #;>
If you supply a table name, it will display the objects that depend on this table just as you said you want.
Please try this script. -
Recommended Solaris Package upgrade procedure
We would like to know the recommended Application Package upgrade procedure. We followed the procedure as defined in the Application Packaging Developer's Guide.
Currently, we have followed the following procedure during the upgrade:
1. check if the old version is available.
2. If it is available, run the pkgrm command to remove the old package as indicated in the Application Packaging Developer's Guide. But because the package names are the same and we execute the pkgrm since the script preinstall, in some systems, command is not allow to remove the old package because it is run from scope of pkgadd command. The following error message if poster during package verification step is performed
[audit class < none >]
pkgadd: ERROR: entry into the content file to < / opt/XXXXxxxx/jre >
3. we cannot manually delete the old package first because it will completely delete the file. We need to migrate some files of the old version again. Therefore, the old files during the upgrade.
Please suggest a suitable procedure to handle this.What exactly do you do? You mean the Oracle Forms running Solaris or upgrade upgrade $somethingelse on Solaris?
If you want to upgrade anythinge else then forms this is the wrong place to ask for help:SQL> r 1 begin 2 if 'Oracle Forms' = 'Oracle Solaris' then 3 dbms_output.put_line('This is the RIGHT place to ask'); 4 else 5 dbms_output.put_line('This is the WRONG place to ask'); 6 end if; 7* end; This is the WRONG place to ask PL/SQL procedure successfully completed.
See? My database tells me that it is in the wrong place, so it must be true: p
You can choose one of the forums of Solaris:
http://forums.Oracle.com/forums/category.jspa?categoryID=303And please include information such as the Version of Intel platform and what exactly you want to do it again as well.
see you soon
-
compilation of stored procedure
The procedure can be stored below.
I need to declare varchar2 with a number such as varchar2 (30)
How can I do and how to compile the stored procedure to display the output.
number variable t1
date variable t2
test exec ('345', 'test', 'ECE','' 2008-09-10: t1: t2);
I am facing problems
Create or REPLACE procedure (eno vARCHAR2
ename VARCHAR2
dept VARCHAR2
Join_date DATE
sno ON NUMBER
End_date DATE
)
IS
BEGIN
SELECT SNO, end_date IN sno, end_date of EMPLOYEE
WHERE EMPLOYEE_NO = eno;
EXCEPTION
WHEN NO_DATA_FOUND THEN
SNO: = NULL;
End_date: = NULL;
WHILE OTHERS THEN
SNO: = NULL;
End_date: = NULL;
END;
/Your case,
satyaki> satyaki>ed Wrote file afiedt.buf 1 cREATE OR REPLACE PROCEDURE Sample (carrier_code vARCHAR2 2 ,vessel_name VARCHAR2 3 ,voyage_no VARCHAR2 4 ,port_code VARCHAR2 5 ,eta_date DATE 6 ,tmp_rotation OUT NUMBER 7 ,tmp_eta_date OUT DATE 8 ) 9 IS 10 BEGIN 11 SELECT ROTN,ETA_DATE INTO 12 tmp_rotation,tmp_eta_date 13 FROM Sample1 14 WHERE LINE_CODE = carrier_code 15 AND VESS_NAME = vessel_name 16 AND VOYAGE_NO = voyage_no 17 AND PORT_CODE = port_code 18 AND SAIL_DATE IS NULL 19 AND VOYAGE_TYPE = 0; 20 EXCEPTION 21 WHEN NO_DATA_FOUND THEN 22 tmp_rotation := NULL; 23 tmp_eta_date := NULL; 24 WHEN OTHERS THEN 25 tmp_rotation := NULL; 26 tmp_eta_date := NULL; 27* END; 28 / Procedure created. Elapsed: 00:00:02.33 satyaki> satyaki> satyaki> satyaki>declare 2 t1 number(10); 3 t2 date; 4 begin 5 Sample('MSK','DUBAI','5645','J',null,t1,t2); 6 dbms_output.put_line('SNO: '||t1||' - '||' END_DATE: '||t2); 7 exception 8 when others then 9 dbms_output.put_line(sqlerrm); 10 end; 11 / SNO: - END_DATE: PL/SQL procedure successfully completed. Elapsed: 00:00:01.04 satyaki> satyaki> satyaki> satyaki>SELECT ROTN,ETA_DATE 2 FROM Sample1 3 WHERE LINE_CODE = 'MSK' 4 AND VESS_NAME = 'DUBAI' 5 AND VOYAGE_NO = '5645' 6 AND PORT_CODE = 'J' 7 AND SAIL_DATE IS NULL 8 AND VOYAGE_TYPE = 0; ROTN ETA_DATE ---------- --------- 623930 23-APR-08 Elapsed: 00:00:00.16 satyaki>
And now to change your query to->
satyaki> satyaki>cREATE OR REPLACE PROCEDURE Sample (carrier_code vARCHAR2 2 ,vessel_name VARCHAR2 3 ,voyage_no VARCHAR2 4 ,port_code VARCHAR2 5 ,eta_date DATE 6 ,tmp_rotation OUT NUMBER 7 ,tmp_eta_date OUT DATE 8 ) 9 IS 10 11 cursor c1 12 is 13 SELECT ROTN,ETA_DATE 14 FROM Sample1 15 WHERE LINE_CODE = carrier_code 16 AND VESS_NAME = vessel_name 17 AND VOYAGE_NO = voyage_no 18 AND PORT_CODE = port_code 19 AND SAIL_DATE IS NULL 20 AND VOYAGE_TYPE = 0; 21 22 r1 c1%rowtype; 23 24 BEGIN 25 26 for r1 in c1 27 loop 28 tmp_rotation := r1.ROTN; 29 tmp_eta_date := r1.ETA_DATE; 30 end loop; 31 32 EXCEPTION 33 WHEN NO_DATA_FOUND THEN 34 tmp_rotation := NULL; 35 tmp_eta_date := NULL; 36 WHEN OTHERS THEN 37 tmp_rotation := NULL; 38 tmp_eta_date := NULL; 39 dbms_output.put_line(sqlerrm); 40 END; 41 / Procedure created. Elapsed: 00:00:01.96 satyaki> satyaki> satyaki>declare 2 t1 number(10); 3 t2 date; 4 begin 5 Sample('MSK','DUBAI','5645','J',null,t1,t2); 6 dbms_output.put_line('SNO: '||t1||' - '||' END_DATE: '||t2); 7 exception 8 when others then 9 dbms_output.put_line(sqlerrm); 10 end; 11 / SNO: 623930 - END_DATE: 23-APR-08 PL/SQL procedure successfully completed. Elapsed: 00:00:00.17 satyaki> satyaki> satyaki>SELECT ROTN,ETA_DATE 2 FROM Sample1 3 WHERE LINE_CODE = 'MSK' 4 AND VESS_NAME = 'DUBAI' 5 AND VOYAGE_NO = '5645' 6 AND PORT_CODE = 'J' 7 AND SAIL_DATE IS NULL 8 AND VOYAGE_TYPE = 0; ROTN ETA_DATE ---------- --------- 623930 23-APR-08 Elapsed: 00:00:00.06 satyaki>
Hope this will help.
Kind regards.
LOULOU.
-
PLS-00304: cannot compile <; package >; body without its specification
Hi all
When compiling the below pasted together, I got the following error msg.
But me, which forfeit and ppackage specification of the body properly. Please could someone help me find the errorPL/SQL: Compilation unit analysis terminated PLS-00304: cannot compile body of 'EDR_RPT_CLASS_BY_TAWT_PACKAGE' without its specification PLS-00905: object HDOT.EDR_RPT_CLASS_BY_TAWT_PACKAGE is invalid
CREATE OR REPLACE PACKAGE edr_rpt_class_by_tawt_package AS PROCEDURE edr_rpt_gen_class_by_tawt ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, report_data OUT SYS_REFCURSOR, chart_data OUT SYS_REFCURSOR, footer_data OUT SYS_REFCURSOR ); PROCEDURE edr_rpt_gen_class_by_fawt ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, report_data OUT SYS_REFCURSOR, chart_data OUT SYS_REFCURSOR, footer_data OUT SYS_REFCURSOR ); PROCEDURE edr_rpt_gen_class_by_sawt ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, report_data OUT SYS_REFCURSOR, chart_data OUT SYS_REFCURSOR, footer_data OUT SYS_REFCURSOR ); PROCEDURE edr_rpt_gen_class_by_triawt ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, report_data OUT SYS_REFCURSOR, chart_data OUT SYS_REFCURSOR, footer_data OUT SYS_REFCURSOR ); PROCEDURE edr_rpt_gen_class_by_qawt ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, report_data OUT SYS_REFCURSOR, chart_data OUT SYS_REFCURSOR, footer_data OUT SYS_REFCURSOR ); FUNCTION class_count ( in_lane_id edr_rpt_by_ranges_output.lane_id%TYPE, in_direction_id edr_rpt_by_ranges_output.direction_id%TYPE, in_interval_start_date_time edr_rpt_by_ranges_output.interval_start_date_time%TYPE, in_interval_end_date_time edr_rpt_by_ranges_output.interval_start_date_time%TYPE, in_axle_wt_min edr_cls_by_tawt_report_data.group_weight%TYPE, iin_axle_wt_max edr_cls_by_tawt_report_data.group_weight%TYPE, in_class_min edr_cls_by_tawt_report_data.vehicle_class%TYPE, in_class_max edr_cls_by_tawt_report_data.vehicle_class%TYPE ) RETURN VARCHAR2; END edr_rpt_class_by_tawt_package; / CREATE OR REPLACE PACKAGE BODY edr_rpt_class_by_tawt_package AS c_front_axle_only CONSTANT axle_class.group_type%TYPE := -1; c_axle_single_group_type CONSTANT axle_class.group_type%TYPE := 1; c_axle_tandem_group_type CONSTANT axle_class.group_type%TYPE := 2; c_axle_tridem_group_type CONSTANT axle_class.group_type%TYPE := 3; c_axle_quadrem_group_type CONSTANT axle_class.group_type%TYPE := 4; c_kips_conversion_unit_id CONSTANT units.unit_id%TYPE := 8; v_report_axle_group_type axle_class.group_type%TYPE := 0; FUNCTION class_count ( in_lane_id edr_rpt_by_ranges_output.lane_id%TYPE, in_direction_id edr_rpt_by_ranges_output.direction_id%TYPE, in_interval_start_date_time edr_rpt_by_ranges_output.interval_start_date_time%TYPE, in_interval_end_date_time edr_rpt_by_ranges_output.interval_start_date_time%TYPE, in_axle_wt_min edr_cls_by_tawt_report_data.group_weight%TYPE, in_axle_wt_max edr_cls_by_tawt_report_data.group_weight%TYPE, in_class_min edr_cls_by_tawt_report_data.vehicle_class%TYPE, in_class_max edr_cls_by_tawt_report_data.vehicle_class%TYPE ) RETURN NUMBER IS my_count_result NUMBER(18); BEGIN SELECT NVL(SUM(vehicle_count), 0 ) INTO my_count_result FROM ( SELECT site_lane_id FROM edr_rpt_tmp_report_lanes WHERE edr_rpt_tmp_report_lanes.output_lane_id = in_lane_id AND edr_rpt_tmp_report_lanes.output_direction_id = in_direction_id ) report_lanes JOIN edr_cls_by_tawt_report_data ON edr_cls_by_tawt_report_data.site_lane_id = report_lanes.site_lane_id WHERE edr_cls_by_tawt_report_data.bin_start_date_time >= in_interval_start_date_time AND edr_cls_by_tawt_report_data.bin_start_date_time < in_interval_end_date_time AND edr_cls_by_tawt_report_data.group_weight >= in_axle_wt_min AND edr_cls_by_tawt_report_data.group_weight < in_axle_wt_max AND edr_cls_by_tawt_report_data.vehicle_class >= in_class_min AND edr_cls_by_tawt_report_data.vehicle_class <= in_class_max ; RETURN my_count_result; END; FUNCTION get_row_class_counts_text RETURN VARCHAR2 IS my_row_counts_text VARCHAR2(10000); my_row_counts_entry VARCHAR2(10000); CURSOR row_counts_text IS SELECT 'edr_rpt_class_by_tawt_package.class_count(' ||'lane_id, ' ||'direction_id, ' ||'interval_start_date_time, ' ||'interval_end_date_time, ' ||'range_low, ' ||'range_high, ' || class_id || ', ' || class_id || ') "'|| class_id || '"' FROM edr_rpt_tmp_report_classes ORDER BY class_id; BEGIN my_row_counts_text := ''; my_row_counts_entry := ''; -- generate the speed ranges function calls OPEN row_counts_text; LOOP FETCH row_counts_text INTO my_row_counts_entry; EXIT WHEN row_counts_text%NOTFOUND; my_row_counts_text := my_row_counts_text || ', ' || my_row_counts_entry; END LOOP; CLOSE row_counts_text; RETURN my_row_counts_text; END; FUNCTION get_row_totals_text RETURN VARCHAR2 IS my_row_count_total_text VARCHAR2(10000); BEGIN my_row_count_total_text := ''; -- generate the 'total' column function call SELECT 'edr_rpt_class_by_tawt_package.class_count(' ||'lane_id, ' ||'direction_id, ' ||'interval_start_date_time, ' ||'interval_end_date_time, ' ||'range_low, ' ||'range_high, ' || MIN(class_id) || ', ' || MAX(class_id) || ') " "' INTO my_row_count_total_text FROM edr_rpt_tmp_report_classes; RETURN ', ' || my_row_count_total_text; END; PROCEDURE apply_default_awt_ranges(in_report_parameter_id IN NUMBER) IS my_awt_ranges_count NUMBER(4); BEGIN SELECT nvl(count(1),0) INTO my_awt_ranges_count FROM report_range_parameters WHERE REPORT_PARAMETER_ID = in_report_parameter_id AND REPORT_PARAMETER_GROUP = 'AXLE_GROUP' AND REPORT_PARAMETER_NAME = 'AXLE_NAME'; IF ( my_awt_ranges_count = 0 ) THEN INSERT INTO report_range_parameters (REPORT_PARAMETER_ID, REPORT_PARAMETER_GROUP, REPORT_PARAMETER_NAME, REPORT_PARAMETER_MIN_VALUE, REPORT_PARAMETER_MAX_VALUE) VALUES (in_report_parameter_id, 'AXLE_GROUP', 'AXLE_NAME', '0', '2'); VALUES (in_report_parameter_id, 'AXLE_GROUP', 'AXLE_NAME', '30', '32'); END IF; END; PROCEDURE edr_class_by_tawt_use_per_veh ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, in_good_status_mask IN NUMBER ) IS max_axle_group_value NUMBER(12); BEGIN DELETE FROM edr_cls_by_tawt_report_data; COMMIT; INSERT INTO edr_cls_by_tawt_report_data ( site_id, site_lane_id, site_direction_id, site_direction_name, bin_start_date_time, group_weight, bin_id, bin_value ) SELECT site_id, site_lane_id, site_direction_id, site_direction_name, date_time, group_weight, vehicle_class, COUNT(vehicle_class) FROM ( SELECT edr_cls_by_tawt_per_veh_data.* FROM edr_cls_by_tawt_per_veh_data GROUP BY date_time, site_lane_id, group_weight, vehicle_class, site_id, site_direction_id, site_direction_name; END edr_class_by_tawt_use_per_veh; PROCEDURE edr_class_by_tawt_data_type ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, in_good_status_mask IN NUMBER, in_data_type IN VARCHAR2, out_data_type_used OUT VARCHAR2 ) IS my_bin_entry_count NUMBER(12,0); my_veh_entry_count NUMBER(12,0); BEGIN IF(UPPER(in_data_type) = 'BINNED') THEN -- Axle information can only be read from Per Vehicle data records -- - using bins-only is not a supported option RAISE_APPLICATION_ERROR(-20101,'Binned data cannot be used for this report.'); ELSIF (UPPER(in_data_type) = 'PERVEHICLE') OR (UPPER(in_data_type) = 'COMBINED') THEN out_data_type_used := 'Per Vehicle (All Vehicles)'; edr_class_by_tawt_use_per_veh( in_report_parameter_id, in_good_status_mask ); ELSE RAISE_APPLICATION_ERROR(-20101,'The data type specified is not recognized.'); END IF; END edr_class_by_tawt_data_type; PROCEDURE edr_class_by_tawt_get_veh_data ( in_report_parameter_id IN NUMBER, in_site_id IN NUMBER, in_start_date_time IN TIMESTAMP, in_end_date_time IN TIMESTAMP, in_report_level_min IN NUMBER, in_report_level_max IN NUMBER ) IS BEGIN DELETE FROM edr_cls_by_tawt_per_veh_data; INSERT INTO edr_cls_by_tawt_per_veh_data ( site_id, site_lane_id, site_direction_id, site_direction_name, record_id, date_time, group_weight, vehicle_class, group_number, vehicle_status, vehicle_error_count, axle_violations_count, group_type ) SELECT axle_info.site_id, axle_info.site_lane_id, axle_info.site_direction_id, axle_info.site_direction_name, axle_info.record_id, axle_info.datetime, axle_info.group_weight, axle_info.v_class, axle_info.group_number, NVL((SELECT SUM(status_code) FROM traffic_status WHERE traffic_status.record_id = axle_info.record_id), 0) vehicle_status, NVL((SELECT COUNT(error_code) FROM traffic_error WHERE traffic_error.record_id = axle_info.record_id), 0) vehicle_error_count, NVL((SELECT COUNT(1) FROM axle_weight_violation WHERE axle_weight_violation.record_id = axle_info.record_id), 0) axle_violations_count, axle_info.group_type FROM (SELECT site_to_data_source_lane_v.site_id, site_to_data_source_lane_v.site_lane_id, site_to_data_source_lane_v.site_direction_id, site_to_data_source_lane_v.site_direction_name, traffic_record.record_id, traffic_record.datetime, NVL(traffic_class.v_class, 0) v_class, NVL(axle_class.group_type, 0) group_type, NVL(axle_class.group_number, 0) group_number, NVL(TRUNC(sum(convert_units(axle.weight_unit_id, c_kips_conversion_unit_id, axle.axle_weight ) ) ), 0 ) group_weight FROM traffic_record JOIN site_to_data_source_lane_v ON traffic_record.data_source_id = site_to_data_source_lane_v.data_source_id AND traffic_record.lane = site_to_data_source_lane_v.data_source_lane_id GROUP BY site_to_data_source_lane_v.site_id, site_to_data_source_lane_v.site_lane_id, site_to_data_source_lane_v.site_direction_id, site_to_data_source_lane_v.site_direction_name, traffic_record.record_id, traffic_record.datetime, traffic_class.v_class, axle_class.group_type, axle_class.group_number ) axle_info END edr_class_by_tawt_get_veh_data; PROCEDURE gen_class_by_axle_type ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, report_data OUT SYS_REFCURSOR, chart_data OUT SYS_REFCURSOR, footer_data OUT SYS_REFCURSOR ) AS BEGIN apply_default_awt_ranges(in_report_parameter_id); my_date_format_mask := edr_rpt_generic_package.edr_rpt_get_date_format_mask(in_report_parameter_id); my_start_date_time := edr_rpt_generic_package.edr_rpt_get_start_date_time(in_report_parameter_id, my_date_format_mask); my_end_date_time := edr_rpt_generic_package.edr_rpt_get_end_date_time(in_report_parameter_id, my_date_format_mask); my_lane_grouping := edr_rpt_generic_package.edr_rpt_get_lane_grouping(in_report_parameter_id); my_site_id := edr_rpt_generic_package.edr_rpt_get_site_id(in_report_parameter_id); my_selected_data_type := edr_rpt_generic_package.edr_rpt_get_data_type(in_report_parameter_id); -- ensure selected classes and lanes temp tables have been populated edr_rpt_generic_package.edr_rpt_gen_tmp_lanes(in_report_parameter_id); edr_rpt_generic_package.edr_rpt_gen_tmp_classes(in_report_parameter_id); edr_rpt_generic_package.edr_rpt_gen_tmp_speed_ranges(in_report_parameter_id); my_good_weight_statuses_mask := edr_rpt_generic_package.get_good_weight_status_mask(in_report_parameter_id); edr_rpt_generic_package.edr_rpt_gen_inclusion_table ( in_report_parameter_id, my_date_format_mask, my_start_date_time, my_end_date_time ); edr_rpt_generic_package.edr_rpt_gen_grouping_table ( in_report_parameter_id, my_date_format_mask, my_start_date_time, my_end_date_time ); edr_class_by_tawt_get_veh_data ( in_report_parameter_id, my_site_id, my_start_date_time, my_end_date_time, 0, --Hardcoded until reclassification is supported. 0 --Hardcoded until reclassification is supported. ); edr_class_by_tawt_data_type ( in_report_parameter_id, my_good_weight_statuses_mask, my_selected_data_type, my_used_data_type ); edr_rpt_generic_package.gen_rpt_by_ranges_output_table ( in_report_parameter_id, 'AXLE_GROUP', 'AXLE_NAME' ); COMMIT; my_report_data_statement := ' SELECT rank "Rank", ' || ' row_type "Row Type", ' || ' interval_start_date_time "Date", ' || ' interval_start_date_time, ' || ' range_label "Chart X-Axis", ' || ' lane_id "Group Id" , ' || ' ''None'' "Group Name", ' || ' range_label "Speed (mph)" ' || get_row_class_counts_text || get_row_totals_text || ' FROM edr_rpt_by_ranges_output ' || ' ORDER BY lane_id, ' || ' direction_id, ' || ' interval_start_date_time, ' || ' range_high, ' || ' rank, ' || ' range_low' ; dbms_output.put_line('SQL start------------------------'); dbms_output.put_line(my_report_data_statement); dbms_output.put_line('SQL end--------------------------'); my_chart_data_statement := ' SELECT range_low "X Axis", ' || ' lane_id "Group" ' || get_row_class_counts_text || ' FROM ' || ' ( ' || ' SELECT lane_id, ' || ' direction_id, ' || ' range_low, ' || ' range_high, ' || ' min(interval_start_date_time) interval_start_date_time, ' || ' max(interval_end_date_time) interval_end_date_time ' || ' FROM edr_rpt_by_ranges_output ' || ' WHERE rank = 1 ' || ' GROUP BY lane_id, direction_id, range_low, range_high ' || ' ) ' || ' order by "Group", range_low ' ; dbms_output.put_line('SQL start------------------------'); dbms_output.put_line(my_chart_data_statement); dbms_output.put_line('SQL end--------------------------'); SELECT my_used_data_type INTO my_data_type_used FROM SYS.DUAL; SELECT NVL(COUNT(DISTINCT record_id), 0) INTO my_per_vehicle_total FROM edr_cls_by_tawt_per_veh_data; SELECT NVL(COUNT(DISTINCT record_id), 0) INTO my_status_vehicle_total FROM edr_cls_by_tawt_per_veh_data WHERE vehicle_status > 0 AND vehicle_error_count = 0; SELECT NVL(COUNT(DISTINCT record_id), 0) INTO my_error_vehicle_total FROM edr_cls_by_tawt_per_veh_data WHERE vehicle_error_count > 0; SELECT NVL(COUNT(DISTINCT record_id), 0) INTO my_status_clear_total FROM edr_cls_by_tawt_per_veh_data WHERE vehicle_status = 0 AND vehicle_error_count = 0; SELECT NVL(COUNT(1), 0) INTO my_binned_vehicle_total FROM edr_cls_by_tawt_per_veh_data; SELECT NVL(COUNT(1), 0) INTO my_good_weight_total FROM edr_cls_by_tawt_per_veh_data WHERE vehicle_error_count = 0 AND BITAND(vehicle_status, my_good_weight_statuses_mask) = 0; -- insert vehicle totals into the temporary table DELETE FROM edr_rpt_tmp_veh_totals_table; INSERT INTO edr_rpt_tmp_veh_totals_table SELECT my_data_type_used, my_per_vehicle_total, my_binned_vehicle_total, my_error_vehicle_total, my_status_vehicle_total, my_good_weight_total, my_status_clear_total FROM SYS.DUAL; -- execute the query into the output refcursor OPEN report_data FOR my_report_data_statement; OPEN chart_data FOR my_chart_data_statement; OPEN footer_data FOR SELECT data_type_used, per_vehicle_total, binned_vehicle_total, error_vehicle_total, status_vehicle_total, good_weight_total, status_clear_total FROM edr_rpt_tmp_veh_totals_table; END gen_class_by_axle_type; PROCEDURE edr_rpt_gen_class_by_sawt ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, report_data OUT SYS_REFCURSOR, chart_data OUT SYS_REFCURSOR, footer_data OUT SYS_REFCURSOR ) AS BEGIN v_report_axle_group_type := c_axle_single_group_type; gen_class_by_axle_type(in_report_parameter_id, report_data, chart_data, footer_data); END; PROCEDURE edr_rpt_gen_class_by_fawt ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, report_data OUT SYS_REFCURSOR, chart_data OUT SYS_REFCURSOR, footer_data OUT SYS_REFCURSOR ) AS BEGIN v_report_axle_group_type := c_front_axle_only ; gen_class_by_axle_type(in_report_parameter_id, report_data, chart_data, footer_data); END; PROCEDURE edr_rpt_gen_class_by_tawt ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, report_data OUT SYS_REFCURSOR, chart_data OUT SYS_REFCURSOR, footer_data OUT SYS_REFCURSOR ) AS BEGIN v_report_axle_group_type := c_axle_tandem_group_type; gen_class_by_axle_type(in_report_parameter_id, report_data, chart_data, footer_data); END; PROCEDURE edr_rpt_gen_class_by_triawt ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, report_data OUT SYS_REFCURSOR, chart_data OUT SYS_REFCURSOR, footer_data OUT SYS_REFCURSOR ) AS BEGIN v_report_axle_group_type := c_axle_tridem_group_type; gen_class_by_axle_type(in_report_parameter_id, report_data, chart_data, footer_data); END; PROCEDURE edr_rpt_gen_class_by_qawt ( in_report_parameter_id IN report_tasks.report_task_id%TYPE, report_data OUT SYS_REFCURSOR, chart_data OUT SYS_REFCURSOR, footer_data OUT SYS_REFCURSOR ) AS BEGIN v_report_axle_group_type := c_axle_quadrem_group_type; gen_class_by_axle_type(in_report_parameter_id, report_data, chart_data, footer_data); END; END edr_rpt_class_by_tawt_package; / LIST SHOW ERROR
FUNCTION RETURN VARCHAR2 class_count in package specifications and
FUNCTION RETURN NUMBER class_count in the package body.
change the type of data SERVICE class_count -
Original title: Windows Installer Package
When you try to install itunes, I get a pop up box that says: there is an error with the windows package install and it will not continue with the download. I went online to download the package to install to my computer (Windows Vista) and when it starts to download get an error stating that "the procedure requires a rise." What it means? I assume this has something to do with security in the administrative account that I am signed on the label on when problems occur. Thank you!
Hello
1 did you change on your computer before this problem?2 - is a problem only with itunes?Follow the suggestions and check if that helps.
Method 1
a.Right click the download file.
b.Select run as administrator.
Method 2
You can follow the procedure in the article.
Problems installing and uninstalling programs on Windows computers
http://support.Microsoft.com/kb/2438651#reso2 -
The UI very often hangs when I am compiling a package when "calculation of bread crumbs for... < package name >."
Developer SQL gets stuck and I have to kill him and open it again.
Is this a known issue?
In the past he blocked from time to time, but now with the new version, it becomes unusable.
you run an Early Adopter, pick up 4.1.0.19 on OTN
the question of the breadcrumb is gone
-
Compile with stored procedure errors
Hi guys, I just start SQL so forgive me if I ask stupid questions real. That's the problem I have right now, as I said in my title.
It's my procedure.sql
CREATE OR REPLACE PROCEDURE check IS
no_of_duplicates NUMBER: = 0;
BEGIN
SELECT COUNT (*) IN no_of_duplicates
THE EMPLOYEE
WHERE E # =.
(select E # PILOT)
WHERE THERE ARE
(SELECT E # MECHANIC)
WHERE DRIVER. L # = MECHANIC. L#));
IF no_of_duplicates: = 0 THEN dbms_output.put_line ('OK');
ON THE OTHER
SELECT E #, NAME OF THE EMPLOYEE
WHERE E # =.
(SELECT E # PILOT)
WHERE THERE ARE
(SELECT E # MECHANIC)
WHERE DRIVER. L # = MECHANIC. L#));
END IF;
END check;
/
While trying to create the procedure, it gives me compilation errors. I took with this for hours and can't seem to find anything wrong with it. Can someone point me in the right direction? Thank you!
Hello
Once again, your postal code. The error occurs when you call the procedure, but you have not posted the code that calls the procedure and causes the error.
When I do this in SQL * more:
SET SERVEROUTPUT ON ENCAPSULATED FORMAT
EXEC check;The procedure that you have posted works perfectly (i.e., displayed the e # is, exactly as it was designed to do).
Display the e # and the name consists of BULK COLLECT both the e # name in separate collections, like this:
CREATE OR REPLACE PROCEDURE check IS
TYPE e #_table IS the TABLE OF THE employee.e#%TYPE;
e # e _list #_table;TYPE name_table IS TABLE OF THE employee.name%TYPE;
name_list name_table;
BEGIN
SELECT e #, name
E LOOSE COLLECTION #_list, name_list
The EMPLOYEE
WHERE e # (IN)
SELECT d.e #.
DRIVER d
JOIN m mechanic ON d.e # m.e = #.
);
E IF #_list. COUNT = 0
THEN
dbms_output.put_line ('OK, there without duplicate of illict");
ELSE - that is to say, e #_list. COUNTY <> 0
dbms_output.put_line (' the following employees are drivers and mechanics :');)
J IN 1.e #_list. COUNTY LOOP - I displays parentheses sometimes hard on the OTN site
dbms_output.put (TO_CHAR (e #_list (j)))
'999999999999'
)
);
dbms_output.put (' ');
dbms_output.put_line (name_list (j));
END LOOP;
END IF;
END check;
/
DISPLAY ERRORSThis is the result I get when I run the procedure above with your sample data:
The following employees are drivers and mechanics:
1 John Smith
You will notice I did several other changes in your code, sometimes because they are much more practical and sometimes just to show you different ways to do the same thing, that you may or may not want to use in this problem.
For example, you were doing the same query (with only very slight differences) 2 times: once to get the no_of_duplicates and then a second time to get the actual data. I don't know if it's the most effective way to do what you need. Say that there are 1000 rows in the result. You get all the 1000 once just to get the total number (that you do not need, if all you worry at this point is if there is), then to get the data. When you make a COLLECTION in BULK, you get automatically the COUNTY anyway, so why not not COLLECTING in BULK, and then use this count to see what to do next. If the NUMBER is greater than 0, then you already have the data, and you do not need to fetch it again. In addition, repeating (essentially) the same code is a maintenance problem. If you need to make a change, you must make the same change to several places. At best, it's a pain; but it is the exactly the kind of mistake that is easy to miss in trials, and you could have the code that runs for weeks in Production before you notice that it sometimes gives false results.
Another example: e # is a NUMBER. If it is possible to convert numbers in VARCHAR2s and save these VARCHAR2s in a VARCHAR2 collection, would be unwise more just to store them in a collection of NUMBER?
-
Difference between the use of IS and HAVE when creating a Package or procedure
Hello
Has had an interview in one of the company.
They asked me that, "What is the difference between IS and as in the creation of package or Stored Procedure Usage?".
I checked the package creation with same IS and YOU, but there is no problem.
Kindly clarify me on this.
Many thanks in advance.
Kind regards
Shiva961805 wrote:
If this is the case, why oracle is allowing us to use and HAVE? Instead he could have allowed us to use AS single.
No. I like IS more What did. Not to mention what the Ada (the mother of PL/SQL language), use.
PL/SQL is allow that you use IS or ACE.
A possible reason for PL/SQL support this, is influence of syntax for the SQL language. The ANSI SQL syntax uses YOU. And the SQL language can be used natively inside code PL, due to the integration of SQL, PL/SQL.
Use IS or ACE.
Many (?) use definitions of package fror YOU and IS for the definitions of the procedure and function. Not necessary from a perspective of language syntax, but serves to highlight the differences between a package signature and that of the procedures, functions, and methods.
-
error when you try to compile this stored procedure
I get this error message
Testing_sp PROCEDURE compiled
WARNING: the execution is completed with warning
can I do this...
See the err;
and:
17/23 PL/SQL: ORA-00932: inconsistent data types: expected NUMBER obtained -
16/1 PL/SQL: statement ignored
I can't understand why.
I checked all the columns at TEST_TMP_TBL
they are all varchar2
CREATE OR REPLACE PROCEDURE testing_sp
AS
XML CLOB.
xml2 VARCHAR2 (150);
BEGIN
SELECT ' <? XML version = "1.0" encoding ="' | utl_i18n.map_charset (value) | "" ? > '
IN xml2
OF nls_database_parameters
Setting WHERE = 'NLS_CHARACTERSET ";
SELECT
XMLElement ("APPLICATION",
XMLAttributes ('TEST', "Name")
, XMLElement ("TESTPAGE",
XMLAgg)
XMLElement ("PROJ",
XMLAttributes (NVL("ORDERS",' ') AS ORDERS,
NVL("SUB_PART",' ') AS SUB_PART,
NVL("SUB_SUB",' ') AS SUB_SUB,
NVL("DESC",' ') AS DESC,
NVL("ADD",' ') AS ADD,
NVL("NUMB",' ') YOU NUMB
),
XMLForest)
NVL("ORDERS",' ') STOPPED,
NVL("SUB_PART",' ') AS SUB_PART,
NVL("SUB_SUB",' ') AS SUB_SUB,
NVL("DESC",' ') AS DESC,
NVL("ADD",' ') AS ADD,
NVL("NUMB",' ') YOU NUMB
)
)
)
)
)
in xml
OF TEST_TMP_TBL;
DBMS_XSLPROCESSOR.clob2file (xml2: xml, 'dir', 'testing.xml');
EXCEPTION
while others then
Rollback;
end;
Let me know if you have an idea, I would almost give my first born of an answer to this (not really sure)SQL > DECLARE
2 v_xml CLOB.
3 - v_xml XMLTYPE.
4 BEGIN
5 SELECT XMLELEMENT ("Emp") IN v_xml FROM DUAL;
6 DBMS_OUTPUT. Put_line (v_xml);
7 END;
8
9.
SELECT XMLELEMENT ("Emp") IN the v_xml FROM DUAL;
*
ERROR on line 5:
ORA-06550: line 5, column 21:
PL/SQL: ORA-00932: inconsistent data types: expected NUMBER obtained -
ORA-06550: line 5, column 2:
PL/SQL: SQL statement ignorednow change the variable for XMLTYPE data type;
SQL > DECLARE
2 - v_xml CLOB.
3 v_xml XMLTYPE.
4 BEGIN
5 SELECT XMLELEMENT ("Emp") IN v_xml FROM DUAL;
6 DBMS_OUTPUT. Put_line (v_xml);
7 END;
8
9.PL/SQL procedure successfully completed.
-
n packages practical procedures
Hello
I am a beginner as s/n...
I want to learn more about procedures/packages...
y at - it online to practice?Salvation;
Please use google, you can find a lot of good site. Try this
Search
Respect of
HELIOS -
How cretae package, the procedures and the trigers
Hi I want to create package
In this package of three procedures
In each procedure want to create trigers
How can I do?Yes, we can call this procedure in relaxation
by including threshold in a block of relaxationprocedure_name(param1,param2);
concerning
Hitesh -
Packages, function, procedure to access a table
Hello all;
Is this possible. I read that somewhere but I don't know if it is possible
Is that what I can write a simple sql statement that basically allows you to determine what packages, functions or procedures are the call or access a table
A simple example will help you.
Also any help is appreciated. Thank you.You can use the DBA_DEPENDENCIES (or ALL_DEPENDENCIES or USER_DEPENDENCIES depending on the situation). For example, to display all objects that reference the table EMP from the SCOTT schema
SQL> select owner, name, type 2 from dba_dependencies 3 where referenced_owner = 'SCOTT' 4 and referenced_name = 'EMP' 5 and referenced_type = 'TABLE'; OWNER NAME TYPE ------------------------------ ------------------------------ ------------------ SCOTT PKG_EMP PACKAGE BODY SCOTT V VIEW SCOTT V2 VIEW SCOTT EMP_PIPE FUNCTION SCOTT GIVE_RAISE PROCEDURE SCOTT P_DIRS PROCEDURE SCOTT TRG_AUD_EMP TRIGGER SCOTT ONECUR_PKG PACKAGE SCOTT V1 VIEW SCOTT VW_EMP VIEW SCOTT F2 FUNCTION OWNER NAME TYPE ------------------------------ ------------------------------ ------------------ SCOTT PKG_EMP PACKAGE SCOTT IN_UBCC FUNCTION SCOTT GET_MAX_ROWSCN FUNCTION 14 rows selected.
Justin
Maybe you are looking for
-
Printer says "incompatible print cartridge".
Was the impression of many prints, then error "incompatible print cartridge". Sound the same I use.
-
copied fraudulent system.
Help, I was sold a fraudulent operating system! What can I do? I bought a tour July 18, 2012. In the week following the purchase and take, I flipped. I saw 'black screen, blue screen, out of service '. The person who put the Tower together told me
-
Function of package of call per line in the statement INSERT INTO SELECT
HelloI wrote the following SQL insert.INSERT the Table_A (Col_A, Col_B, Col_C)SELECT Col_A, Col_B, (SELECT PACKAGE1. DOUBLE FUNC())FROM Table_AWHERE Col_A = "AAA".PACKAGE1. Func() is a function to create numbers using the sequence.The result isCol_a
-
The permissions of the shared folder on linux using kerberos hosts
I'm having a lot of trouble with permissions on a shared folder.The root of the problem is that the uid/gid of the user of the host are different from those of the guest user. The guest user performs authentication kerberos and if their uid/guid appe
-
How to display a document without spill on artificial intelligence
I posted this on the Adobe forum earlier. Surprisingly, I can't find this message in my story because it seems that this forum is now now only a certain amount of history. I was a member of the forum since 2004, but all my posts except the very rec