PLS-00378: invalid compilation unit Error
The following statement copied from oracle documentation but its raising error, any idea please ?
CREATE FUNCTION getBooks(a clob) RETURN bookset_t;
LINE/COL ERROR
-------- ------------------------------------------------0/0 PLS-00378: invalid compilation unit for this
release of PL/SQL
My Oracle Version is :
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
Best Regards,
Luqman
I presume that you are referring to the example contained in the following link.
http://www.lc.leidenuniv.nl/awcourse/oracle/appdev.920/a96624/08_subs.htm#19677
The example appears incomplete to me. The example does include the definition of the bookset_t type, but there still must be more to the getBooks function and I don't see anything to link the Catalogs table to the bookSet_t type. I have submitted the question to Tom Kyte. When I receive a response, I will provide a link to that response here.
Similar Messages
-
SVM - metainit "invalid unit" error
Hi guru,
I am working on Solaris 10 servers with containers (Small zone) and I want to mirror the data in some file-system in containers between 2 SunStorEdge 3510 and without umounting file-systems.
So I try to mirror soft partitions between old and new 3510 but I have an error message "invalid unit" when I want to mirror with metainit command :
small-zone# df -Zk | grep appli
/dev/md/dsk/d500 5162078 4266829 843629 84% /export/zones/test/<small-zone>/root/appli5
small-zone#
At the beginning, I have :
d500 Is a soft partition on the c1t40d10s6 disk in the old 3510 (Used by /appli5 file-system)
d30 Is a 400 Go soft partition on stripped disks c1t40d25s6 and c1t40d26s6 in the new 3510
d300 Is a 300 Go soft partition on d30 used by another container.
As I read in the good faq http://sysunconfig.net/unixtips/soft-partitions.html ...
It is not possible to serve soft partition directly as a submirror, so I create simple concat/stripe before mirroring :
d502 is the concat/stripe sodt partition with the existing data (It work fine with IO) :
# metainit -f d502 1 1 d500
d502: Concat/Stripe is setup
d50 is the mirror, so we can construct the first submirror :
# metainit d50 -m d502
d50: Mirror is setup
d501 is the soft partition that will receive data on the new 3510, it's size is bigger than the old one (d500)
# metainit d501 -p d30 8G
d501: Soft Partition is setup
And here is my problem and the error message when I want to make the concat/stripe partition on d501 :
# metainit -f d511 1 1 d501
metainit: <global-zone>: d511: invalid unit
So I resume here all my partitions :
# metastat -p | egrep "d50|d30"
d50 -m d502 1
d502 1 1 d500
d500 -p c1t40d10s6 -o 188747785 -b 10485760
d501 -p d30 -o 629154816 -b 16777216
d30 1 2 c1t40d25s6 c1t40d26s6 -i 1024b
d300 -p d30 -o 8192 -b 629145600
Thank's for your reply if you have any idea.
Best regards.Hi all,
I have another metainit "invalid unit" error. I would like to move data from d4011 soft partition to the new and biggest d4511 soft partition because d100 mirror is full without dismount the file-system.
My configuration is :
# metastat -p d4011
d4011 -p d100 -o 245387488 -b 2097152
d100 -m d101 d102 1
d101 1 1 c1t3d0s0
d102 1 1 c1t5d0s0
# metastat -p d4511
d4511 -p c3t45d1s6 -o 583024589 -b 4194304
I want to mirror d4011 with d4511, but am not able to construct a new concat/stripe d4021 on d4011 sp, do you have any solution to this problem :
# metainit -f d4021 1 1 d4011
metainit: pcy002sge: d4011: invalid unit
Regards. -
Pls suggest a reason for a compile time error
the following program gives a compile time error bcoz of the statement
((State)this).val=this.val. if u could suggest why?
public class Mainc
public static void main(String args[])
State st=new State();
System.out.println(st.getvalue());
State.Memento mem= st.memfunc();
st.altervalue();
System.out.println(st.getvalue());
mem.restore();
System.out.println(st.getvalue());
public static class State
protected int val=11;
int getvalue()
return val;
void altervalue()
val=(val+7)%31;
Memento memfunc()
return new Memento();
class Memento
int val;
Memento()
this.val=state.this.val;
void restore()
((State)this).val=this.val;
}The statement :
((State)this).val
tries to cast Memento into its super class State which is inorrect [former is not latter's subclass]
restore method should be as follows:
void restore()
State.this.val=this.val;
} -
Hi expert,
We are trying the validate the PA_TIME_CLIENT_EXTN package body. It is giving the below error.
0/0 PL/SQL: Compilation unit analysis terminated
1/14 PLS-00905: object APPS.PA_TIME_CLIENT_EXTN is invalid
1/14 PLS-00304: cannot compile body of 'PA_TIME_CLIENT_EXTN' without
its specification
My environment details are as below.
Oracle apps version: 11.5.10.2
DB version : 11.2.0.1
OS version : IBM AIX 6.1
Please help me on this.
ThanksThis error is usually seen when you have a different datatype specification in your package specification and your package body. I think that is some thing you might want to check first.
Regards,
Johan Louwers -
PLS-00304: cannot compile body of package without its specification
Hi all,
While compiling the below pasted package , I got the following error msg.
PL/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 invalidBut I believe that have declared package and ppackage body specification correctly. Please could anyone help me to find out the error
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 ERRORHi,
PLS-00304: cannot compile body of 'EDR_RPT_CLASS_BY_TAWT_PACKAGE'
without its specificationThis error usually indicates an issue with used datatypes in a package spec. that differs from a package body.
Check your spec:
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; However in your package body:
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 NUMBERReturn number in spec. vs. return varchar2 in body..
That won't compile, either return a number or a varchar2 in both. (spec and body). -
Invalid cursor state error while executing the prepared statement
hai friends,
following code showing the invalid cursor state error while executing the second prepared statement.
pls anyone help me
String query = "select * from order_particulars where order_no=" + orderno + " order by sno"; psmt1 = conEntry.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); rs1 = psmt1.executeQuery(); rs1.last(); intRowCount = rs1.getRow(); particularsdata = new Object[intRowCount][6]; rs1.beforeFirst(); if (intRowCount >= 1) { for (int i = 0; rs1.next(); i++) { particularsdata[0] = i + 1;
particularsdata[i][1] = rs1.getString(3);
particularsdata[i][2] = Double.parseDouble(rs1.getString(4));
rs1.close();
psmt1.close();
query = "SELECT sum(delqty) FROM billdetails,billparticulars WHERE order_no= " + orderno + " and " +
"billdetails.bill_no = billparticulars.bill_no GROUP BY particulars ORDER BY sno";
psmt1 = conEntry.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
rs1 = psmt1.executeQuery(); //error showing while executing this lineAlso .. Why using arrays instead of collections? Shifting the cursor all the way forth and back to get the count is fairly terrible.
With regard to the problem: either there's a nasty bug in the JDBC driver used, or you actually aren't running the compiled class version of the posted code. -
PLS-00487: Invalid reference to variable ' expression '
oracle database 10G
OS unix
One of procedure is giving error PLS-00487: Invalid reference to variable '<expression>' while compilation in above database while it is compiling
successfully in other database.
Is there any database error?PLS-00487: Invalid reference to variable "string"
Cause: A variable was referenced in a way that is inconsistent with its datatype. For example, a scalar variable might have been mistakenly referenced as a record, as follows: DECLARE CURSOR emp_cur IS SELECT empno, ename, sal FROM emp; emp_rec emp_cur%ROWTYPE; my_sal NUMBER(7,2); BEGIN ... total_sal := total_sal + my_sal.sal; -- invalid ...
Action: Check the spelling of the variable name. Make sure the variable was declared properly and that the declaration and reference are consistent regarding datatype.
Most probably the compiler "sees" some other type variable with the same name first which in the other database doesn't exist or is out of scope.
Regards
Etbin -
Apex PL/SQL: Compilation unit analysis terminated
HI,
Does any one help me on this.
while i compile my function, it compiles successfully. but show errors showing
menuid in 'TY_MENUIDS'; -- this line shows the error
PLS-00201: identifier 'TY_MENUIDS' must be declared
'TY_MENUIDS' is TYPE which has created inside the same schema
line 0 position 0 PL/SQL: Compilation unit analysis terminated
Thanks
Logaa
Edited by: Logaa on Aug 11, 2009 11:39 PMHi Gussay,
Thanks for your reply.
i have created type of object.
CREATE OR REPLACE TYPE "TY_NSN_MENUITEMS" AS OBJECT(id NUMBER, menuid VARCHAR2(100))
then i have create a type of TY_NSN_MENUITEMS
CREATE OR REPLACE TYPE "TY_NSN_MENUIDS" AS VARRAY(500) OF TY_NSN_MENUITEMS
then i have refered this TY_NSN_MENUIDS inside my function . in declaration part it shows me the error.
The function which i have created inside my APEX->OBJECTBROWSER->SCHEMA-> MYFUNCTION
thanks
Logaa
Edited by: Logaa on Aug 12, 2009 10:49 PM -
PLS-00923: native compilation failed: Visual Studio not
hi,
I'm using oracle 10g version 10.2.0.1 running on windows xp pro service pack 3. I'm trying to switch from interpreted to native compilation, and here are the parameters I've set:
plsql_native_library_dir = D:\oracle\product\10.2.0\db_1\plsql
plsql_code_type = NATIVE
plsql_native_library_subdir_count = 0
plsql_compiler_flags = NATIVE, NON_DEBUG
Now I'm trying to run the following statements:
ALTER SESSION SET plsql_code_type = 'NATIVE';
CREATE OR REPLACE PROCEDURE test_speed AS
v_number NUMBER;
BEGIN
FOR i IN 1 .. 1000000 LOOP
v_number := i / 1000;
END LOOP;
END;
SET TIMING ON
SQL> EXEC test_speed;
BEGIN test_speed; END;
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00905: object SYS.TEST_SPEED is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Elapsed: 00:00:00.03
SQL> show err
Errors for PROCEDURE TEST_SPEED:
LINE/COL ERROR
0/0 PLS-00923: native compilation failed: Visual Studio not
found::Could not open registry key
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\VISUALSTUDIO\7.1\SETUP:No
error
I have search for the error in google but I can't find anything useful. What do I need to set-up/change to achieve my goals.
Thanks and God bless,
Chrishi,
I'm using oracle 10g version 10.2.0.1 running on windows xp pro service pack 3. I'm trying to switch from interpreted to native compilation, and here are the parameters I've set:
plsql_native_library_dir = D:\oracle\product\10.2.0\db_1\plsql
plsql_code_type = NATIVE
plsql_native_library_subdir_count = 0
plsql_compiler_flags = NATIVE, NON_DEBUG
Now I'm trying to run the following statements:
ALTER SESSION SET plsql_code_type = 'NATIVE';
CREATE OR REPLACE PROCEDURE test_speed AS
v_number NUMBER;
BEGIN
FOR i IN 1 .. 1000000 LOOP
v_number := i / 1000;
END LOOP;
END;
SET TIMING ON
SQL> EXEC test_speed;
BEGIN test_speed; END;
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00905: object SYS.TEST_SPEED is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Elapsed: 00:00:00.03
SQL> show err
Errors for PROCEDURE TEST_SPEED:
LINE/COL ERROR
0/0 PLS-00923: native compilation failed: Visual Studio not
found::Could not open registry key
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\VISUALSTUDIO\7.1\SETUP:No
error
I have search for the error in google but I can't find anything useful. What do I need to set-up/change to achieve my goals.
Thanks and God bless,
Chris -
Invalid File Name Errors when syncing to Ipod
Ever since an update last fall I have been getting Invalid file name errors when I try to sync my ipod. A window would pop up saying "Windows could not copy 'SONGNAME' to the iPod 'IPODNAME' because an unkown error occurred (-37)." I would press OK and another window would immediately pop up that would say, "Attempting to copy to the disk 'IPODNAME' failed. the file name is invalid or too long."
The windows would keep popping up countless times until the sync would just seem to time out and stop.
The problem songs would have no problem playing in iTunes.
Prior to the update this did not happen. No new songs were added around this time and nothing was changed to my file directory structure. I was too busy to troubleshoot this problem at the time and hoped that another update would fix it. Well, here I am many months and updates later and still no fix. After fiddling with iTunes and resetting my Ipod multiple times (goodbye saved angry bird games)I have found out that:
1. By writing down the file name when the error windows pop up I can get a partial list of the problem file names. I could not get a complete list of the problem files because the sync would time out before a full list could be compiled (the list appears to be in the hundreds).
2. If I changed the name of the file by adding OR deleting one character, remapping the song in itunes, the song would then sync properly.
3. If I changed the name of the file, remapped the location of the file within iTunes, changed the name of the file BACK to the original name that iTunes supposedly had a problem with, and then remapped the location of the song within iTunes, the song would then sync properly
4. If I moved the song to a different directory without changing the file name, remapped the song within iTunes, the song would sync properly.
5. If I moved the song to a different directory without changing the file name, remapped the song within iTunes, moved the file BACK to the original directory, remapped the song again, the song would sync properly.
6. If I renamed the file and then named it back to the original file name WITHOUT remapping the file location in iTunes, the song would still not sync properly
7. If I moved the file into a different directory and then back again without remapping the file location, the song would still not sync properly.
8. Changing or deleting the tags has no effect at all.
9. File name lengths are already under 200 characters and there are no special characters used.
So, to sum up, I have found out a way to fix the issue. The problem is, that there are hundreds of songs that appear to be affected and renaming or moving every single one individually and then remapping is extremely inefficient and ignores the cause of the problem. I also did not want to delete the itunes library and then add all of the songs back in because I have many custom playlists that I have spent hours creating and I do not want to delete them.
Is there a better way to fix the problem? Especially if someone knows the root cause?I got a procmon log file and examined it. I have the file and I could also provide you with that or screenshots of it.
There is nothing unusual about it. I can see entires in which CR has successfully opened the report and has cached in a c:\windows\temp.
However there is one or two non-successful entries that may be related, especially that examining the stack trace brings us to a call to get_ProductLocaleID():
- A call to read reg entry HKU\S-1-5-20\Software\Business Objects\Suite 12.0\Crystal Reports\Locale fails with NAME NOT FOUND.
- immediately after that and from the same process (w3wp.ex) there is a call to open directory "c:\" which is logged as ACCESS DENIED.
Any subsequent unsuccessful calls seem to be results of exception handling in the debug code.
Does this point to any setup issues with CR? We always run the redistributable x86 runtime when installing it. -
Invalid factory calender error in creating subcontrating po
hello all,
during creation of subcontracting po,system shows the error message "invalid factory calender error".
i have checked the assignment in oy05.seems ok.
pls provide some input.
regards
sumit simran.Hi,
Please check the path.
IMG>Enterprise Structure>Definition>Logistics - General>Define, copy, delete, check plant-->Define Plant.
Here you can find the which factory calender is assigned to your plant.
Then go to Tcode SCAL , select the Holiday calender and edit it . Double click on your holiday calender and change it i.e valid From year to To year. Go back , select the factory calender and edit it , give valid From year to To year.
Thanks. -
Invalid table name error ....
Hi,
I have written a function which takes table name dynamically and if column emp_id is null for more than 0 records then 1 is returned else 0 .
My problem is when i compile iam getting invalid table name error .
Below is my function :
create or replace
FUNCTION f_table ( tab_name in varchar2 ) return number is
l_count number;
begin
select count(*) into l_count from tab_name where emp_id is null;
if l_count >0 then
return 1;
else
return 0;
end if;
end;
Please help ...
Thanks in advance ..Looks fine to me, you could use sign() for the last part:
CREATE OR REPLACE FUNCTION f_table (tab_name IN VARCHAR2)
RETURN NUMBER
IS
l_count NUMBER;
v_sql VARCHAR2 (2000);
BEGIN
v_sql := 'SELECT COUNT (*) FROM ' || tab_name || ' WHERE emp_id IS NULL';
EXECUTE IMMEDIATE v_sql
INTO l_count;
RETURN sign(l_count);
END;And if you have large tables, you could consider not counting it all, and do something like this:
CREATE OR REPLACE FUNCTION f_table (tab_name IN VARCHAR2)
RETURN NUMBER
IS
l_count NUMBER;
v_sql VARCHAR2 (2000);
BEGIN
v_sql := 'SELECT COUNT (*) FROM ' || tab_name || ' WHERE emp_id IS NULL AND rownum = 1';
EXECUTE IMMEDIATE v_sql
INTO l_count;
RETURN l_count;
END;Regards
Peter -
LabVIEW 4.0 Invalid Page Fault Errors
I've got myself stumped on this problem - we had a LabVIEW based PC/DAQ system that started giving invalid page fault errors and crashing in Win95. This may have been concident with a revision to a vi file. To rectify the problem I've tried the following:
1. Reinstall LabVIEW 4.0 with NI-DAQ 6.6
2. Wipe HD, reinstall Win95, LV 40, NIDAQ 6.6
3. Full HD scan and MEMTEST86 memory test
4. Install on another PC
The PCs are P5-60 Gateways with 128 MB of RAM. DAQ config is 1 AT-AO-10 and 1 AT-MIO-16DE-10
Nothing seems to help. With a reinstall of LV40, I can get it to run, but once I copy the .vi files back into User.lib LV crashes.
Does LV40 look in User.lib upon startup and crash if it finds something it doesn't like? A corrupted vi?
Thanks!Blair Hogg wrote:
...guess the next step is to go in and load each .vi manually to see if there is one that is causing problems. Hopefully some of you out there are finding this somewhat interesting, and I'm not just cluttering up the forum...
Hi Blair Hogg,
I like your sence of humor ;-) Don't worry, even if nobody reads your
thread (well... I just did) you need to write MUCH more for it to be
considered clutter. Now, if you had created 25 duplicates of the same
thread, then we would be talking about cluttering...
I'm curious about this issue even thought NI only supports LabVIEW two
versions back - officially. My guess is that a VI is corrupted and
kills LabVIEW when the VI loads. Therefore I do aggree that the
procedure from now on is to load every single VI one by one and then
notice what VI will make LabVIEW crash. I might be able to repair that
VI if you submit it to the thread.
Another thing to try is to mass compile the user.lib. The log after the
mass compile will show if any VIs were bad or had problems getting
compiled.
Well, I hope you find the source for this issue - even if I'm the only one that cares ;-)
Have Fun!
- Philip Courtois, Thinkbot Solutions -
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
Oracle 9.2 client ORA 8.1.7 Server:
Trying to run an SP in SQL navigator ( or PL/SQL)
I get the following error(s)
ORA-06550: line 6, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 6, column 3:
++++++++++++++++++++++++++++++++++++++++++++
Here's the Package and Proc Code with the errors at the end.
It seems not to like a Ref Cursor, but I'm not experienced enough to know the reason.
ANy Help would be very appreciated: AJACODE
++++++++++++++++++++++++++++++++++++++++++++
--Package Spec
Package RPT_NB_GUI_Param_Get_PKG
IS
TYPE rc_Params_gettbl IS RECORD (
o_QueryID Number,
o_ParameterID Number,
o_Param VARCHAR2 (20),
o_Param_Type VARCHAR2 (50),
o_Param_QueryID Number
TYPE rc_params IS REF CURSOR RETURN rc_Params_gettbl;
END; -- Package Specification RPT_NB_GUI_Param_Get_PKG
--+++++++++++++++++++++++++++++++++++++++++
-- Proc
Procedure RPT_NB_GUI_Param_Get_PROC
p_QueryID in Number ,
rc_ParamsGet IN OUT RPT_NB_GUI_Param_Get_PKG.rc_Params)
IS
-- Purpose: To generate Parameters for GUI
-- MODIFICATION HISTORY
-- Person Date Comments
-- AJ Grasso 04/11/2003 Created
BEGIN
OPEN rc_ParamsGet For
SELECT
QP.QueryID
,P.ParameterID
,P.Parameter
,PT.Parameter_Type
,PQ.Parameter_QueryID
FROM
rpt_Query_Parameter QP, rpt_Parameter P, rpt_Parameter_Type PT, rpt_parameter_query PQ
WHERE --inner join rpt_Parameter P ON
(QP.ParameterID = P.ParameterID)
AND --inner join rpt_Parameter_Type PT ON
(QP.Parameter_TypeID = PT.Parameter_TypeID)
AND --left outer join rpt_parameter_query PQ ON
(QP.Parameter_queryID = PQ.parameter_queryID)
AND (QP.QueryID = p_QueryID) ;
END; -- RPT_NB_GUI_Param_Get_PROC
-- ERRORS
-- +++++++++++++++++
ORA-06550: line 6, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 6, column 3:
PL/SQL: Statement ignored
ORA-06550: line 7, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 7, column 3:
PL/SQL: Statement ignored
ORA-06550: line 8, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 8, column 3:
PL/SQL: Statement ignored
ORA-06550: line 9, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 9, column 3:
PL/SQL: Statement ignored
ORA-06550: line 10, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 10, column 3:
PL/SQL: Statement ignored
ORA-06550: line 16, column 74:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 16, column 3:
PL/SQL: Statement ignored
ORA-06550: line 17, column 78:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 17, column 3:
PL/SQL: Statement ignored
ORA-06550: line 18, column 71:Oracle 9.2 client ORA 8.1.7 Server:
Trying to run an SP in SQL navigator ( or PL/SQL)
I get the following error(s)
ORA-06550: line 6, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 6, column 3:
++++++++++++++++++++++++++++++++++++++++++++
Here's the Package and Proc Code with the errors at the end.
It seems not to like a Ref Cursor, but I'm not experienced enough to know the reason.
ANy Help would be very appreciated: AJACODE
++++++++++++++++++++++++++++++++++++++++++++
--Package Spec
Package RPT_NB_GUI_Param_Get_PKG
IS
TYPE rc_Params_gettbl IS RECORD (
o_QueryID Number,
o_ParameterID Number,
o_Param VARCHAR2 (20),
o_Param_Type VARCHAR2 (50),
o_Param_QueryID Number
TYPE rc_params IS REF CURSOR RETURN rc_Params_gettbl;
END; -- Package Specification RPT_NB_GUI_Param_Get_PKG
--+++++++++++++++++++++++++++++++++++++++++
-- Proc
Procedure RPT_NB_GUI_Param_Get_PROC
p_QueryID in Number ,
rc_ParamsGet IN OUT RPT_NB_GUI_Param_Get_PKG.rc_Params)
IS
-- Purpose: To generate Parameters for GUI
-- MODIFICATION HISTORY
-- Person Date Comments
-- AJ Grasso 04/11/2003 Created
BEGIN
OPEN rc_ParamsGet For
SELECT
QP.QueryID
,P.ParameterID
,P.Parameter
,PT.Parameter_Type
,PQ.Parameter_QueryID
FROM
rpt_Query_Parameter QP, rpt_Parameter P, rpt_Parameter_Type PT, rpt_parameter_query PQ
WHERE --inner join rpt_Parameter P ON
(QP.ParameterID = P.ParameterID)
AND --inner join rpt_Parameter_Type PT ON
(QP.Parameter_TypeID = PT.Parameter_TypeID)
AND --left outer join rpt_parameter_query PQ ON
(QP.Parameter_queryID = PQ.parameter_queryID)
AND (QP.QueryID = p_QueryID) ;
END; -- RPT_NB_GUI_Param_Get_PROC
-- ERRORS
-- +++++++++++++++++
ORA-06550: line 6, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 6, column 3:
PL/SQL: Statement ignored
ORA-06550: line 7, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 7, column 3:
PL/SQL: Statement ignored
ORA-06550: line 8, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 8, column 3:
PL/SQL: Statement ignored
ORA-06550: line 9, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 9, column 3:
PL/SQL: Statement ignored
ORA-06550: line 10, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 10, column 3:
PL/SQL: Statement ignored
ORA-06550: line 16, column 74:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 16, column 3:
PL/SQL: Statement ignored
ORA-06550: line 17, column 78:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 17, column 3:
PL/SQL: Statement ignored
ORA-06550: line 18, column 71: -
PLS-00330: invalid use of type name or subtype name
I am relatively new to Sql and am in the process of learning, so please bear with me. I am trying to create a trigger for the Invoices table that displays the vendor_name, invoice_number, and payment_total after the payment_total has been increased. I have discovered that I must use a compound trigger due to a mutating-table error and ended up with this:
CREATE OR REPLACE TRIGGER invoices_after_update_payment
FOR UPDATE OF payment_total
ON invoices
COMPOUND TRIGGER
TYPE invoice_numbers_table IS TABLE OF VARCHAR2(50);
TYPE payment_totals_table IS TABLE OF NUMBER;
TYPE vendor_names_table IS TABLE OF VARCHAR2(50);
TYPE summary_payments_table IS TABLE OF NUMBER INDEX BY VARCHAR2(50);
TYPE summary_names_table IS TABLE OF NUMBER INDEX BY VARCHAR2(50);
invoice_numbers invoice_numbers_table;
payment_totals payment_totals_table;
vendor_names vendor_names_table;
payment_summarys summary_payments_table;
name_summarys summary_names_table;
AFTER STATEMENT IS
invoice_number VARCHAR2(50);
payment_total NUMBER;
vendor_name VARCHAR2(50);
BEGIN
SELECT i.invoice_number, i.payment_total, v.vendor_name
BULK COLLECT INTO invoice_numbers, payment_totals, vendor_names
FROM invoices i JOIN vendors v
ON i.vendor_id = v.vendor_id
GROUP BY i.invoice_number;
FOR i IN 1..invoice_numbers.COUNT() LOOP
invoice_number := invoice_numbers(i);
payment_total := payment_totals(i);
vendor_name := vendor_names(i);
summary_payments_table(invoice_number) := payment_total;
summary_names_table(invoice_number) := vendor_name;
END LOOP;
END AFTER STATEMENT;
AFTER EACH ROW IS
temp_payment_total NUMBER;
vendor_name VARCHAR2(50);
BEGIN
temp_payment_total := payment_summarys(:new.invoice_number);
vendor_name := name_summarys(:new.invoice_number);
IF (:new.payment_total > temp_payment_total) THEN
DBMS_OUTPUT.PUT_LINE('Vendor Name: ' || vendor_name || ', Invoice Number: ' || :new.invoice_number || ', Payment Total: ' || :new.payment_total);
END IF;
END AFTER EACH ROW;
END;
/The code that I am using to update the table is:
UPDATE invoices
SET payment_total = 508
WHERE invoice_number = 'QP58872'At this point, I am getting an error report saying:
29/7 PLS-00330: invalid use of type name or subtype name
29/7 PL/SQL: Statement ignored
30/7 PLS-00330: invalid use of type name or subtype name
30/7 PL/SQL: Statement ignoredWhat does the error code entail? I have looked it up but can't seem to pin it. Any help would be greatly appreciated and I am open to any suggestions for improving my current code.
I am using Oracle Database 11g Express Edition on Windows 7. I am not sure if it is relevant, but I am also using Sql Developer. If you need any further information, I will do my best to provide what I can.
Thanks!
Edited by: 927811 on Apr 15, 2012 11:54 PM
Edited by: 927811 on Apr 15, 2012 11:56 PMI took your advice and removed the exception handling. There is no point in it being there. I also checked the timing points and you are correct. So, I changed my AFTER STATEMENT to BEFORE STATEMENT, which I had been thinking about doing anyways. It just seemed logical to me. That brings me to where I am now. I ran my update again and got back this error, It is the same as the one before, but for a different line (?)
Error starting at line 1 in command:
UPDATE invoices
SET payment_total = 510
WHERE invoice_number = 'QP58872'
Error report:
SQL Error: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "AP.INVOICES_AFTER_UPDATE_PAYMENT", line 30
ORA-04088: error during execution of trigger 'AP.INVOICES_AFTER_UPDATE_PAYMENT'
06502. 00000 - "PL/SQL: numeric or value error%s"
*Cause:
*Action:Also, to make sure you are clear as to what my code now looks like:
SET SERVEROUTPUT ON;
CREATE OR REPLACE TRIGGER invoices_after_update_payment
FOR UPDATE OF payment_total
ON invoices
COMPOUND TRIGGER
TYPE invoice_numbers_table IS TABLE OF VARCHAR2(50);
TYPE payment_totals_table IS TABLE OF NUMBER;
TYPE vendor_names_table IS TABLE OF VARCHAR2(50);
TYPE summary_payments_table IS TABLE OF NUMBER INDEX BY VARCHAR2(50);
TYPE summary_names_table IS TABLE OF NUMBER INDEX BY VARCHAR2(50);
invoice_numbers invoice_numbers_table;
payment_totals payment_totals_table;
vendor_names vendor_names_table;
payment_summarys summary_payments_table;
name_summarys summary_names_table;
BEFORE STATEMENT IS
invoice_number VARCHAR2(50);
payment_total NUMBER;
vendor_name VARCHAR2(50);
BEGIN
SELECT i.invoice_number, i.payment_total, v.vendor_name
BULK COLLECT INTO invoice_numbers, payment_totals, vendor_names
FROM invoices i JOIN vendors v
ON i.vendor_id = v.vendor_id
GROUP BY i.invoice_number, i.payment_total, v.vendor_name;
FOR i IN 1..invoice_numbers.COUNT() LOOP
invoice_number := invoice_numbers(i);
payment_total := payment_totals(i);
vendor_name := vendor_names(i);
payment_summarys(invoice_number) := payment_total;
name_summarys(invoice_number) := vendor_name;
END LOOP;
END BEFORE STATEMENT;
AFTER EACH ROW IS
temp_payment_total NUMBER;
vendor_name VARCHAR2(50);
BEGIN
temp_payment_total := payment_summarys(:new.invoice_number);
vendor_name := name_summarys(:new.invoice_number);
IF (:new.payment_total > temp_payment_total) THEN
DBMS_OUTPUT.PUT_LINE('Vendor Name: ' || vendor_name || ', Invoice Number: ' || :new.invoice_number || ', Payment Total: ' || :new.payment_total);
END IF;
END AFTER EACH ROW;
END;
/Thanks for the help!
Maybe you are looking for
-
Structure changes in the LBWE, where does the field pool come from MCVBUK
Example: Customising Cockpit, lbwe > 2lis_11_vascl > Maintain structure In lbwe the field 'pool' for MCVBUK does not have all the fields that I can see if I look at Structure MCVBUK using se11 such as FKSTK, FKSAK. What does this depend on
-
I had to move ITunes from my husband's computer to mine after he lost his IPod and then his computer had a virus about 6 months ago. Most of the items in the library have a checkmark next to them and when I attempt to synch to my IPod 5th generation
-
Cannot Access video clips from external hard drive
I have been using PE9 for six to nine months. My normal workflow has been to create a separate project file on a 500g external HD. This file includes all video clips (.mov files) and the Project.PREL file. This worked great until just recently. I c
-
What are SYS.ORA_TEMP_1_DS_% tables?
Hi, in my 11.2.0.2 database sometimes I see that there are some mysterious temporary tables with the same name like 'SYS.ORA_TEMP_1_DS_%'. I'm not running any dbms_stats function. The mentioned temporary tables appears and disappears intermittently s
-
Hi All, will this query result give an info about why my profit period is different in the report between balance sheet and profit and loss: SELECT distinct case when T0.transtype = 60 then 'Goods Issue' when T0.transtype = 59 then 'Goods Receipt' wh