PLS-00363: expression 'I' cannot be used as an assignment target
Hello all
I have a Package and I have one procedure in it .
I have use dmlset inside this .
Inside that procedure I have a cursor and inside the FOR loop I have mentioned something .
FOR i IN 1 .. No_of_rec LOOP
If....
End if ;
i := i+1 ;
END LOOP;
I have mentioned before end loop i := i+1 ; when i execute this package it is showing this error .
"PLS-00363: expression 'I' cannot be used as an assignment target"
What could be the problem?
Of course,
My example is showing that index I in loop is same thing as parameter IN in procedure1. Its value, not reference. I is passed as VALUE to LOOP just like PARAM1 is passed as value to PROCEDURE1. Trying to assignment something to I or PARAM1 will generate same error.
Also another interesting example is
CREATE OR REPLACE
PROCEDURE procedure1(
param1 IN OUT NUMBER)
AS
BEGIN
param1 := 0;
END procedure1;
BEGIN
FOR i IN 1..3
LOOP
procedure1(i);
END LOOP;
END;
In this case procedure1 is correct but loop stmt is not. It will generate same error.
After doing this examples i also concluded that procedure cant return value it can modify existing value of variable which is declared (uninitialized or initialized, OUT or IN OUT ) in upper PLSQL block (named or unnamed PLSQL block)
Similar Messages
-
Hi everybody. I wrote de following type
create or replace TYPE ALMACEN AS OBJECT
id_almacen number(10),
descripcion varchar2(40),
existencias number(6),
precio number(4),
member function movimiento (p_num number) return boolean
create or replace TYPE BODY ALMACEN AS
member function movimiento (p_num number) return boolean AS
v_inf boolean;
n number(6);
BEGIN
if self.existencias+p_num>=0 then
self.existencias:=existencias+p_num;
return TRUE;
else return FALSE;
end if;
END movimiento;
END;
I have Oracle 11g release I.
In previous releases it worked, but now SQLDeveloper marks
self.existencias:=existencias+p_num;
Error PLS 00363 expression "string" cannot be used as an assignment target in sentence
Please, What's wrong?
Thanking in advanceHi,
Not quite a PL/SQL XML question but anyway...
Since the member function modifies the object instance, the implicit argument "self" must be declared explicitly as "IN OUT" :
member function movimiento (self in out nocopy almacen, p_num number) return boolean -
PLS-00363: expression cannot be used as an assignment target
Hi,
Oralce9.2
when I run the insert procedure I get the below error:
Procedure
PROCEDURE proc_one_insert(col1 IN OUT numeric,
col2 IN num,
col3 IN numeric
BEGIN
execute immediate proc_one_insert(2,1,111);
END;
Error
PLS-00363: expression '2' cannot be used as an assignment target
How to solve the above error ?
With Regards
Edited by: user640001 on Dec 2, 2010 3:04 AMArun has shown you an example using PL/SQL. If you want to do something similar in other languages you have to use their style of variable declaration e.g. if you wanted to do it through SQL*Plus, you need to declare the variable within SQL*Plus itself and bind that into your calls e.g.
SQL> create procedure p_inout (p_val in out number) is
2 begin
3 p_val := p_val*10;
4 end;
5 /
Procedure created.
SQL> var mynum number
SQL> exec :mynum := 10;
PL/SQL procedure successfully completed.
SQL> print mynum
MYNUM
10
SQL> exec p_inout(:mynum);
PL/SQL procedure successfully completed.
SQL> print mynum
MYNUM
100
SQL> -
PLS-00363: expression '' cannot be used as an assignment target - HELP :-(
Hi Guys,
This is a procedure I have in the body of a package:
PROCEDURE SUM_EVENTS (p_trial_no IN NUMBER,
p_country_resion IN VARCHAR2,
p_loc_no IN NUMBER,
p_setup_flag IN VARCHAR2,
p_event_changed IN OUT NUMBER) ISWhen I call this in SQLplus with this:
exec DB_CALC.sum_events(340,'USA',1,'Y',3700);I get this:
ERROR at line 1:
ORA-06550: line 1, column 54:
PLS-00363: expression '3700' cannot be used as an assignment target
ORA-06550: line 1, column 7:
PL/SQL: Statement ignoredAny ideas what I'm doing wrong?
Thanks!p_event_changed is declared as an IN OUT parameter. You need to provide a variable in which the OUT values can be written to..
something like
declare
out_val number := 3700;
begin
DB_CALC.sum_events(340,'USA',1,'Y',out_val);
end; -
'PLS-00363: expression..' error when executing a stored procedure with in o
Hello,
I'm trying to run a PLSQL script containing an ORACLE API but its failing on compilation with the message:
'PLS-00363: expression '<expression>' cannot be used as an assignment target'.
As far as I understand its connected to my IN-OUT parameters but I can't figure out which (I must admit I'm still hiking up a steep learning curve here and I've cut and pasted someone elses example and modified it).
I would be most grateful if one of you pro's could read through my code and advise..
many thanks,
Steveni guess you are trying to store value in your IN parameter.
here is an example
SQL> create or replace procedure pr(p in integer)
2 as
3 begin
4 p := 1;
5 end;
6 /
Warning: Procedure created with compilation errors.
SQL> show err
Errors for PROCEDURE PR:
LINE/COL ERROR
4/2 PL/SQL: Statement ignored
4/2 PLS-00363: expression 'P' cannot be used as an assignment targetSee it also gives the exact line in which the error has occurred. so see that and fix it.
Edited by: Karthick_Arp on Feb 12, 2009 1:57 AM -
Hello,
I'm trying to run a PLSQL script containing an ORACLE API but its failing on compilation with the message:
'PLS-00363: expression '<expression>' cannot be used as an assignment target'.
As far as I understand its connected to my IN-OUT parameters but I can't figure out which (I must admit I'm still hiking up a steep learning curve here and I've cut and pasted someone elses example and modified it).
I would be most grateful if one of you pro's could read through my code and advise..
SET serveroutput ON SIZE 1000000 FORMAT WRAPPED
SET verify OFF
SET feedback OFF
DECLARE
error_msg varchar2(2000) := '';
l_status varchar2(10) := 'True';
l_validate_cnt number;
l_ass_count number;
l_business_group_id number := 0;
l_validate BOOLEAN DEFAULT FALSE;
l_city varchar2(30);
l_mode varchar2(20) := 'UPDATE';
l_sup_join_date date;
l_organization_id hr_organization_units.organization_id%type;
l_person_id per_all_people_f.person_id%type;
l_object_version_number per_all_assignments_f.object_version_number%type;
l_job_id per_jobs.job_id%type;
l_position_id per_positions.position_id%type;
l_location_id number := 233; -- number;
l_grade_id number := 3; -- per_grades.grade_id%type;
l_supervisor_id number := 2; -- per_all_assignments_f.supervisor_id%type;
l_assignment_status_type_id number;
l_pay_basis_id number := 33;
l_join_date date;
l_assignment_id per_all_assignments_f.assignment_id%type;
l_soft_coding_keyflex_id per_all_assignments_f.soft_coding_keyflex_id%type;
l_people_group_id per_all_assignments_f.people_group_id%type;
l_payroll_id per_all_assignments_f.payroll_id%type;
l_effective_start_date per_all_assignments_f.effective_start_date%type;
l_effective_end_date per_all_assignments_f.effective_end_date%type;
l_assignment_sequence per_all_assignments_f.assignment_sequence%type;
l_comment_id per_all_assignments_f.comment_id%type;
l_concatenated_segments varchar2(240);
l_group_name varchar2(100);
l_other_manager_warning boolean;
l_org_now_no_manager_warning boolean;
l_spp_delete_warning boolean;
l_entries_changed_warning varchar2(200);
l_tax_district_changed_warning boolean;
l_special_ceiling_step_id number;
l_no_managers_warning boolean;
l_other_manager_warnings boolean;
l_cagr_grade_def_id number;
l_cagr_concatenated_segments varchar2(100);
l_total_records number := 0;
l_success_records number := 0;
l_failure_records number := 0;
BEGIN
dbms_output.put_line('#############################################################');
dbms_output.put_line('Data Migration Of Employee Assignments :');
dbms_output.put_line('#############################################################');
dbms_output.put_line('Start Time : ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS'));
l_person_id := null;
l_object_version_number := null;
l_organization_id := 0;
l_location_id := null;
l_grade_id := null;
l_job_id := null;
l_position_id := null;
l_supervisor_id := null;
l_assignment_status_type_id := null;
error_msg := null;
l_status := 'True';
hr_assignment_api.update_emp_asg_criteria
p_validate => l_validate
,p_effective_date => sysdate --to_date('11-Jan-2009','DD-MON-YYYY')
,p_datetrack_update_mode => l_mode
,p_assignment_id => l_assignment_id
,p_object_version_number => l_object_version_number +1
,p_organization_id => l_organization_id
,p_location_id => l_location_id --assignment_v.location_id
,p_grade_id => l_grade_id
,p_job_id => l_job_id
,p_position_id => l_position_id
,p_payroll_id => l_payroll_id --21--hardcoding this you should change this
-- ,p_segment1 => assignment_v.people_group
-- ,p_employment_category => assignment_v.employee_category
,p_pay_basis_id => l_pay_basis_id
,p_special_ceiling_step_id => l_special_ceiling_step_id
,p_people_group_id => l_people_group_id
,p_group_name => l_group_name
,p_org_now_no_manager_warning => l_org_now_no_manager_warning
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_other_manager_warning => l_other_manager_warning
,p_spp_delete_warning => l_spp_delete_warning
,p_entries_changed_warning => l_entries_changed_warning
,p_tax_district_changed_warning => l_tax_district_changed_warning
hr_assignment_api.update_emp_asg
p_validate => l_validate --false
,p_effective_date => to_date('11-Jan-2009','DD-MON-YYYY') --assignment_v.date_of_change
,p_datetrack_update_mode => 'CORRECTION'
,p_assignment_id => l_assignment_id
,p_object_version_number => l_object_version_number
,p_supervisor_id => l_supervisor_id
,p_normal_hours => '7.5'
,p_frequency => 'D'
,p_time_normal_start => '09:30'
,p_time_normal_finish => '17:30'
,p_soft_coding_keyflex_id => l_soft_coding_keyflex_id
,p_comment_id => l_comment_id
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_concatenated_segments => l_concatenated_segments
,p_no_managers_warning => l_no_managers_warning
,p_other_manager_warning => l_other_manager_warnings
,p_cagr_grade_def_id => l_cagr_grade_def_id
,p_cagr_concatenated_segments => l_cagr_concatenated_segments
dbms_output.put_line('End Time : ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS'));
dbms_output.put_line('
END;
commit;
exit;many thanks,
StevenThanks for the suggestions people. Here's the other API description requested:
PROCEDURE UPDATE_EMP_ASG
Argument Name Type In/Out Default?
P_VALIDATE BOOLEAN IN DEFAULT
P_EFFECTIVE_DATE DATE IN
P_DATETRACK_UPDATE_MODE VARCHAR2 IN
P_ASSIGNMENT_ID NUMBER IN
P_OBJECT_VERSION_NUMBER NUMBER IN/OUT
P_SUPERVISOR_ID NUMBER IN DEFAULT
P_ASSIGNMENT_NUMBER VARCHAR2 IN DEFAULT
P_CHANGE_REASON VARCHAR2 IN DEFAULT
P_ASSIGNMENT_STATUS_TYPE_ID NUMBER IN DEFAULT
P_COMMENTS VARCHAR2 IN DEFAULT
P_DATE_PROBATION_END DATE IN DEFAULT
P_DEFAULT_CODE_COMB_ID NUMBER IN DEFAULT
P_FREQUENCY VARCHAR2 IN DEFAULT
P_INTERNAL_ADDRESS_LINE VARCHAR2 IN DEFAULT
P_MANAGER_FLAG VARCHAR2 IN DEFAULT
P_NORMAL_HOURS NUMBER IN DEFAULT
P_PERF_REVIEW_PERIOD NUMBER IN DEFAULT
P_PERF_REVIEW_PERIOD_FREQUENCY VARCHAR2 IN DEFAULT
P_PROBATION_PERIOD NUMBER IN DEFAULT
P_PROBATION_UNIT VARCHAR2 IN DEFAULT
P_SAL_REVIEW_PERIOD NUMBER IN DEFAULT
P_SAL_REVIEW_PERIOD_FREQUENCY VARCHAR2 IN DEFAULT
P_SET_OF_BOOKS_ID NUMBER IN DEFAULT
P_SOURCE_TYPE VARCHAR2 IN DEFAULT
P_TIME_NORMAL_FINISH VARCHAR2 IN DEFAULT
P_TIME_NORMAL_START VARCHAR2 IN DEFAULT
P_BARGAINING_UNIT_CODE VARCHAR2 IN DEFAULT
P_LABOUR_UNION_MEMBER_FLAG VARCHAR2 IN DEFAULT
P_HOURLY_SALARIED_CODE VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE_CATEGORY VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE1 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE2 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE3 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE4 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE5 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE6 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE7 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE8 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE9 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE10 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE11 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE12 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE13 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE14 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE15 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE16 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE17 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE18 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE19 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE20 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE21 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE22 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE23 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE24 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE25 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE26 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE27 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE28 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE29 VARCHAR2 IN DEFAULT
P_ASS_ATTRIBUTE30 VARCHAR2 IN DEFAULT
P_TITLE VARCHAR2 IN DEFAULT
P_SEGMENT1 VARCHAR2 IN DEFAULT
P_SEGMENT2 VARCHAR2 IN DEFAULT
P_SEGMENT3 VARCHAR2 IN DEFAULT
P_SEGMENT4 VARCHAR2 IN DEFAULT
P_SEGMENT5 VARCHAR2 IN DEFAULT
P_SEGMENT6 VARCHAR2 IN DEFAULT
P_SEGMENT7 VARCHAR2 IN DEFAULT
P_SEGMENT8 VARCHAR2 IN DEFAULT
P_SEGMENT9 VARCHAR2 IN DEFAULT
P_SEGMENT10 VARCHAR2 IN DEFAULT
P_SEGMENT11 VARCHAR2 IN DEFAULT
P_SEGMENT12 VARCHAR2 IN DEFAULT
P_SEGMENT13 VARCHAR2 IN DEFAULT
P_SEGMENT14 VARCHAR2 IN DEFAULT
P_SEGMENT15 VARCHAR2 IN DEFAULT
P_SEGMENT16 VARCHAR2 IN DEFAULT
P_SEGMENT17 VARCHAR2 IN DEFAULT
P_SEGMENT18 VARCHAR2 IN DEFAULT
P_SEGMENT19 VARCHAR2 IN DEFAULT
P_SEGMENT20 VARCHAR2 IN DEFAULT
P_SEGMENT21 VARCHAR2 IN DEFAULT
P_SEGMENT22 VARCHAR2 IN DEFAULT
P_SEGMENT23 VARCHAR2 IN DEFAULT
P_SEGMENT24 VARCHAR2 IN DEFAULT
P_SEGMENT25 VARCHAR2 IN DEFAULT
P_SEGMENT26 VARCHAR2 IN DEFAULT
P_SEGMENT27 VARCHAR2 IN DEFAULT
P_SEGMENT28 VARCHAR2 IN DEFAULT
P_SEGMENT29 VARCHAR2 IN DEFAULT
P_SEGMENT30 VARCHAR2 IN DEFAULT
P_CONCAT_SEGMENTS VARCHAR2 IN DEFAULT
P_CONTRACT_ID NUMBER IN DEFAULT
P_ESTABLISHMENT_ID NUMBER IN DEFAULT
P_COLLECTIVE_AGREEMENT_ID NUMBER IN DEFAULT
P_CAGR_ID_FLEX_NUM NUMBER IN DEFAULT
P_CAG_SEGMENT1 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT2 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT3 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT4 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT5 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT6 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT7 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT8 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT9 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT10 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT11 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT12 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT13 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT14 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT15 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT16 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT17 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT18 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT19 VARCHAR2 IN DEFAULT
P_CAG_SEGMENT20 VARCHAR2 IN DEFAULT
P_NOTICE_PERIOD NUMBER IN DEFAULT
P_NOTICE_PERIOD_UOM VARCHAR2 IN DEFAULT
P_EMPLOYEE_CATEGORY VARCHAR2 IN DEFAULT
P_WORK_AT_HOME VARCHAR2 IN DEFAULT
P_JOB_POST_SOURCE_NAME VARCHAR2 IN DEFAULT
P_SUPERVISOR_ASSIGNMENT_ID NUMBER IN DEFAULT
P_CAGR_GRADE_DEF_ID NUMBER IN/OUT
P_CAGR_CONCATENATED_SEGMENTS VARCHAR2 OUT
P_CONCATENATED_SEGMENTS VARCHAR2 OUT
P_SOFT_CODING_KEYFLEX_ID NUMBER IN/OUT
P_COMMENT_ID NUMBER OUT
P_EFFECTIVE_START_DATE DATE OUT
P_EFFECTIVE_END_DATE DATE OUT
P_NO_MANAGERS_WARNING BOOLEAN OUT
P_OTHER_MANAGER_WARNING BOOLEAN OUT
P_HOURLY_SALARIED_WARNING BOOLEAN OUT
P_GSP_POST_PROCESS_WARNING VARCHAR2 OUT On looking on the web I've found that my latest error message - ORA-20001: The primary key specified is invalid
Cause: The primary key values specified are invalid and do not exist in
the schema.
Action: Check the primary key values... - relates to incorrect combination of person_id,object_version_number,effective_start_date and effective_end_date - all of which seem OK to me - her's my latest version of my code.. Many thanks again.
SET serveroutput ON SIZE 1000000 FORMAT WRAPPED
SET verify OFF
SET feedback OFF
DECLARE
error_msg varchar2(2000);
l_status varchar2(10);
l_validate_cnt number;
l_ass_count number;
l_validate BOOLEAN DEFAULT FALSE;
l_city varchar2(30);
l_mode varchar2(20) := 'UPDATE';
l_organization_id number;
l_effective_date date := '12-FEB-09';
l_person_id number := '29987';
l_object_version_number number := '3';
l_effective_start_date date := '12-FEB-09';
l_effective_end_date date := '12-FEB-56';
l_job_id per_jobs.job_id%type;
l_position_id per_positions.position_id%type;
l_location_id number;
l_grade_id number;
l_supervisor_id number;
l_assignment_status_type_id number;
l_pay_basis_id number;
l_join_date date;
l_soft_coding_keyflex_id number;
l_people_group_id per_all_assignments_f.people_group_id%type;
l_payroll_id per_all_assignments_f.payroll_id%type;
l_assignment_sequence per_all_assignments_f.assignment_sequence%type;
l_comment_id per_all_assignments_f.comment_id%type;
l_normal_end varchar2(15) := '17:30';
l_normal_start varchar2(15) := '09:30';
l_frequency varchar2(10) := 'D';
l_normal_hours varchar2(25) := '7.5';
l_assignment_id number := '29884';
l_gsp_post_process_warning varchar2(30);
l_entries_changed varchar2(30);
l_old_obj_ver_number per_addresses.OBJECT_VERSION_NUMBER%type;
l_segment1 varchar2(25);
l_segment2 varchar2(25);
l_segment3 varchar2(25);
l_concatenated_segments varchar2(240);
l_group_name varchar2(100);
l_other_manager_warning boolean;
l_org_now_no_manager_warning boolean;
l_spp_delete_warning boolean;
l_entries_changed_warning varchar2(200);
l_tax_district_changed_warning boolean;
l_special_ceiling_step_id number;
l_no_managers_warning boolean;
l_other_manager_warnings boolean;
l_cagr_grade_def_id number;
l_cagr_concatenated_segments varchar2(100);
l_datetrack_update_mod varchar2(10);
l_total_records number := 0;
l_success_records number := 0;
l_failure_records number := 0;
BEGIN
dbms_output.put_line('#############################################################');
dbms_output.put_line('Data Migration Of Employee Assignments :');
dbms_output.put_line('#############################################################');
dbms_output.put_line('Start Time : ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS'));
l_person_id := null;
l_object_version_number := null;
l_organization_id := null;
l_location_id := null;
l_grade_id := null;
l_job_id := null;
l_position_id := null;
l_supervisor_id := null;
l_assignment_status_type_id := null;
error_msg := null;
l_status := 'True';
hr_assignment_api.update_emp_asg_criteria (
p_effective_date => l_effective_date ,p_datetrack_update_mode => l_datetrack_update_mod ,p_assignment_id => l_assignment_id ,p_called_from_mass_update => NULL ,p_grade_id => l_grade_id ,p_position_id => l_position_id ,p_job_id => l_job_id ,p_payroll_id => l_payroll_id ,p_location_id => l_location_id ,p_organization_id => l_organization_id ,p_pay_basis_id => l_pay_basis_id
,p_segment1 => l_segment1
,p_segment2 => l_segment2
,p_segment3 => l_segment3 ,p_employment_category => NULL ,p_concat_segments => NULL ,p_contract_id => NULL ,p_establishment_id => NULL ,p_scl_segment1 => NULL ,p_grade_ladder_pgm_id => NULL ,p_supervisor_assignment_id => NULL ,p_object_version_number => l_old_obj_ver_number ,p_special_ceiling_step_id => l_special_ceiling_step_id ,p_people_group_id => l_people_group_id ,p_soft_coding_keyflex_id => l_soft_coding_keyflex_id ,p_group_name => l_group_name ,p_effective_start_date => l_effective_start_date ,p_effective_end_date => l_effective_end_date ,p_org_now_no_manager_warning => l_org_now_no_manager_warning ,p_other_manager_warning => l_other_manager_warning ,p_spp_delete_warning => l_spp_delete_warning ,p_entries_changed_warning => l_entries_changed ,p_tax_district_changed_warning => l_tax_district_changed_warning ,p_concatenated_segments => l_concatenated_segments ,p_gsp_post_process_warning => l_gsp_post_process_warning);
hr_assignment_api.update_emp_asg
p_validate => l_validate
,p_effective_date => l_effective_date
,p_datetrack_update_mode => l_datetrack_update_mod --'CORRECTION'
,p_assignment_id => l_assignment_id
,p_object_version_number => l_object_version_number
,p_supervisor_id => l_supervisor_id
,p_normal_hours => l_normal_hours --'7.5'
,p_frequency => l_frequency --'D'
,p_time_normal_start => l_normal_start --'09:30'
,p_time_normal_finish => l_normal_end --'17:30'
,p_soft_coding_keyflex_id => l_soft_coding_keyflex_id
,p_comment_id => l_comment_id
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_concatenated_segments => l_concatenated_segments
,p_no_managers_warning => l_no_managers_warning
,p_other_manager_warning => l_other_manager_warnings
,p_cagr_grade_def_id => l_cagr_grade_def_id
,p_cagr_concatenated_segments => l_cagr_concatenated_segments
dbms_output.put_line('End Time : ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS'));
dbms_output.put_line('
END;
commit;
exit; -
Objects containing objects.Expr cannot be used as an assignment.PLS-00363.
Hi,
My database: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0.
I'm working with Object types containing other object types, and I'm getting the error PLS-00363 (Expression cannot be used as an assignment).
I'm putting exlpicity all 'SELF' parameters as 'IN OUT', but still get the error...
CREATE OR REPLACE TYPE TYP_PERSON AS OBJECT (
strName VARCHAR2(100),
--+
CONSTRUCTOR FUNCTION TYP_PERSON RETURN SELF AS RESULT,
--+
MEMBER FUNCTION getName (SELF IN OUT TYP_PERSON) RETURN VARCHAR2,
MEMBER PROCEDURE setName (SELF IN OUT TYP_PERSON, pNewName VARCHAR2)
+) NOT FINAL;+
+/+
--+
CREATE OR REPLACE TYPE BODY TYP_PERSON AS
--+
CONSTRUCTOR FUNCTION TYP_PERSON RETURN SELF AS RESULT IS
BEGIN
SELF.strName := NULL;
RETURN;
END;
--+
MEMBER FUNCTION getName (SELF IN OUT TYP_PERSON) RETURN VARCHAR2 IS
BEGIN
RETURN SELF.strName;
END;
--+
MEMBER PROCEDURE setName (SELF IN OUT TYP_PERSON, pNewName VARCHAR2) IS
BEGIN
SELF.strName := pNewName;
END;
END;
+/+
--+
CREATE OR REPLACE TYPE TYP_PERSONS AS TABLE OF TYP_PERSON;
--+
CREATE OR REPLACE TYPE TYP_CREW AS OBJECT (
strName VARCHAR2(100),
persons TYP_PERSONS,
--+
CONSTRUCTOR FUNCTION TYP_CREW RETURN SELF AS RESULT,
--+
MEMBER FUNCTION getName (SELF IN OUT TYP_CREW) RETURN VARCHAR2,
MEMBER PROCEDURE setName (SELF IN OUT TYP_CREW, pNewName VARCHAR2),
--+
MEMBER PROCEDURE addPerson (SELF IN OUT TYP_CREW, pPersonName IN VARCHAR2),
MEMBER FUNCTION getPerson (SELF IN OUT TYP_CREW, pIndex IN NUMBER) RETURN TYP_PERSON,
MEMBER FUNCTION getPersons (SELF IN OUT TYP_CREW) RETURN TYP_PERSONS
+) NOT FINAL;+
+/+
--+
CREATE OR REPLACE TYPE BODY TYP_CREW AS
--+
CONSTRUCTOR FUNCTION TYP_CREW RETURN SELF AS RESULT IS
BEGIN
SELF.strName := NULL;
SELF.persons := TYP_PERSONS();
RETURN;
END;
--+
MEMBER FUNCTION getName (SELF IN OUT TYP_CREW) RETURN VARCHAR2 IS
BEGIN
RETURN SELF.strName;
END;
--+
MEMBER PROCEDURE setName (SELF IN OUT TYP_CREW, pNewName VARCHAR2) IS
BEGIN
SELF.strName := pNewName;
END;
MEMBER PROCEDURE addPerson (SELF IN OUT TYP_CREW, pPersonName IN VARCHAR2) IS
BEGIN
SELF.persons.EXTEND();
SELF.persons(SELF.persons.LAST) := TYP_PERSON(pPersonName);
END;
MEMBER FUNCTION getPerson (SELF IN OUT TYP_CREW, pIndex IN NUMBER) RETURN TYP_PERSON IS
BEGIN
IF SELF.persons.COUNT > 0 THEN
RETURN SELF.getPersons()(pIndex);
END IF;
RETURN NULL;
END;
MEMBER FUNCTION getPersons (SELF IN OUT TYP_CREW) RETURN TYP_PERSONS IS
BEGIN
RETURN SELF.persons;
END;
END;
+/+
--+
DECLARE
crew_one TYP_CREW;
BEGIN
crew_one := TYP_CREW();
crew_one.setName('The last crew on Earth');
crew_one.addPerson ('Michael Knight');
crew_one.addPerson ('Agent Mulder');
crew_one.addPerson ('Agent Scully');
crew_one.addPerson ('Frodo Bolson');
for i in crew_one.persons.FIRST..crew_one.persons.LAST LOOP
dbms_output.put_line('Person ['||i||']: '||crew_one.persons(i).getName());
end loop;
crew_one.getPerson(1).setName ('Michael Knight-----');
crew_one.getPerson(2).setName ('Agent Mulder---');
crew_one.getPerson(3).setName ('Agent Scully---');
crew_one.getPerson(4).setName ('Frodo Bolson----');
for i in crew_one.persons.FIRST..crew_one.persons.LAST LOOP
dbms_output.put_line('Person ['||i||']: '||crew_one.persons(i).getName());
end loop;
END;
How can I do this ParentObject().getChildObject().setChildFunction()?
Thanks in advance,
Donato.You completely misunderstand objects. Use:
DECLARE
crew_one TYP_CREW;
BEGIN
crew_one := TYP_CREW();
crew_one.setName('The last crew on Earth');
crew_one.addPerson ('Michael Knight');
crew_one.addPerson ('Agent Mulder');
crew_one.addPerson ('Agent Scully');
crew_one.addPerson ('Frodo Bolson');
for i in crew_one.persons.FIRST..crew_one.persons.LAST LOOP
dbms_output.put_line('Person ['||i||']: '||crew_one.persons(i).getName());
end loop;
TYP_PERSON.setName (crew_one.persons(1),'Michael Knight-----');
TYP_PERSON.setName (crew_one.persons(2),'Agent Mulder---');
TYP_PERSON.setName (crew_one.persons(3),'Agent Scully---');
TYP_PERSON.setName (crew_one.persons(4),'Frodo Bolson----');
for i in crew_one.persons.FIRST..crew_one.persons.LAST LOOP
dbms_output.put_line('Person ['||i||']: '||crew_one.persons(i).getName());
end loop;
END;
Person [1]: Michael Knight
Person [2]: Agent Mulder
Person [3]: Agent Scully
Person [4]: Frodo Bolson
Person [1]: Michael Knight-----
Person [2]: Agent Mulder---
Person [3]: Agent Scully---
Person [4]: Frodo Bolson----
PL/SQL procedure successfully completed.
SQL> SY. -
Expression cannot be used as an INTO-target of a SESELECT/FETCH Statement
Hello guys
Iam new to oracle and this my first post
I have written this code in sql
declare
2 cursor madecursor is select bus_id ,bus_destination ,seat_no ,
3 driver_name from bus for update of seat_no nowait ; myseat bus.seat_no%type
4 ; begin
5 for bus_id in madecursor loop
6 select myseat into bus.bus_id from bus where
7 bus_id = bus_id
8 ; if
9 myseat < 5 then
10 update bus set seat_no = seat_no*2 WHERE CURRENT OF madecursor
11 ; DBMS_OUTPUT.PUT_LINE('Updated');
12 end if ;
13 end loop;
14 end;
but I have the following errors:-
ERROR at line 6:
ORA-06550: line 6, column 27:
PLS-00403: expression 'BUS.BUS_ID' cannot be used as an INTO-target of a SELECT/FETCH statement
ORA-06550: line 6, column 2:
PL/SQL: SQL Statement ignored
please help me.
Thanks in advance.
user613283Firstly thank you for replies , I get use of your suggestions and change my code but still having errors please suggest.
SQL> declare
2 I_myseat bus.seat_no%type;
3 begin
4
5
6 select I_myseat into I_myseat from
7 bus where
8 bus_id = bus.bus_id
9 ;
10 if I_myseat < 5 then
11 update bus set seat_no = seat_no*2
12 where I_myseat<5
13 ; DBMS_OUTPUT.PUT_LINE('Updated');
14
15 end if;
16 end;
17 / declare
ERROR at line 1:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 6 -
PLS-00455: cursor 'CUR_1' cannot be used in dynamic SQL OPEN statement
create or replace function f_my_test_func
return refcur_pkg.refcur_t1
is
cur_1 refcur_pkg.refcur_t1;
begin
open cur_1
for
'select * from dept';
return cur_1;
exception
when others
then
insert into ddl_log (SQLTEXT)
values
('fucntion error');
end;I would suggest that cur_1 refcur_pkg.refcur_t1 is a stongly typed ref cursor i.e. it has RETURN dept%ROWTYPE or something similar in the declaration. You can't use strongly typed ref cursors with dynamic SQL in this way. The declaration should be weakly typed or just use sys_refcursor.
DTYLER_APP@pssdev2> DECLARE
2
3 TYPE t_Strong IS REF CURSOR RETURN dual%ROWTYPE;
4
5 lc_Strong t_Strong;
6
7 BEGIN
8
9 OPEN lc_Strong FOR
10 'SELECT * FROM dual';
11
12 END;
13 /
OPEN lc_Strong FOR
ERROR at line 9:
ORA-06550: line 9, column 10:
PLS-00455: cursor 'LC_STRONG' cannot be used in dynamic SQL OPEN statement
ORA-06550: line 9, column 5:
PL/SQL: Statement ignored
DTYLER_APP@pssdev2>
DTYLER_APP@pssdev2> DECLARE
2
3 TYPE t_Weak IS REF CURSOR;
4
5 lc_Weak t_Weak;
6
7 BEGIN
8
9 OPEN lc_Weak FOR
10 'SELECT * FROM dual';
11
12 END;
13 /
PL/SQL procedure successfully completed.
DTYLER_APP@pssdev2> DECLARE
2
3 lc_Weak sys_refcursor;
4
5 BEGIN
6
7 OPEN lc_Weak FOR
8 'SELECT * FROM dual';
9
10 END;
11 /
PL/SQL procedure successfully completed.
DTYLER_APP@pssdev2>HTH
David -
Re: PLS-00455: cursor 'CUR_1' cannot be used in dynamic SQL OPEN statement
create or replace package cognos_pk as /* Creates Package Header*/
TYPE project_type IS record( /* A record declaration is used to */
c1 NUMBER /* provide a definition of a record */
); /* that can be used by other variables*/
TYPE project_type1 IS REF CURSOR return project_type; /* Variable declaration */
procedure conosg_sp (result1 out project_type1); /* SP declaration */
end;
CREATE OR REPLACE PACKAGE BODY cognos_pk AS /* Name of package body must be same as header */
PROCEDURE conosg_sp(result1 OUT project_type1) IS
countrow number;
BEGIN
FOR X IN (SELECT TABLE_NAME
FROM USER_TAB_COLUMNS
WHERE COLUMN_NAME='PROC_STAT_CODE' AND TABLE_NAME LIKE 'INPT%')
LOOP
execute immediate 'select count(*) from '||X.TABLE_NAME ||' WHERE PROC_STAT_CODE <>10 ' into countrow;
--result1 := X.TABLE_NAME|| ROW_CNT;
-- dbms_output.put_line(result1 );
OPEN result1 for countrow;
END loop;
END;
end;
/This is my requirement ...
I want to count the table starting with Inpt and and proc stat _code =10 which is the column name in all the table.
i wan to return the count and the table name to be used in my cognos report.
Edited by: BluShadow on 10-May-2013 09:22
added {noformat}{noformat} tags around the code/data for readability (no accounting for OP's lack of formatting)1005181 wrote:
create or replace package cognos_pk as /* Creates Package Header*/
TYPE project_type IS record( /* A record declaration is used to */
c1 NUMBER /* provide a definition of a record */
); /* that can be used by other variables*/
TYPE project_type1 IS REF CURSOR return project_type; /* Variable declaration */
procedure conosg_sp (result1 out project_type1); /* SP declaration */
end;
CREATE OR REPLACE PACKAGE BODY cognos_pk AS /* Name of package body must be same as header */
PROCEDURE conosg_sp(result1 OUT project_type1) IS
countrow number;
BEGIN
FOR X IN (SELECT TABLE_NAME
FROM USER_TAB_COLUMNS
WHERE COLUMN_NAME='PROC_STAT_CODE' AND TABLE_NAME LIKE 'INPT%')
LOOP
execute immediate 'select count(*) from '||X.TABLE_NAME ||' WHERE PROC_STAT_CODE <>10 ' into countrow;
--result1 := X.TABLE_NAME|| ROW_CNT;
-- dbms_output.put_line(result1 );
OPEN result1 for countrow;
END loop;
END;
end;
/This is my requirement ...
I want to count the table starting with Inpt and and proc stat _code =10 which is the column name in all the table.
i wan to return the count and the table name to be used in my cognos report.The execute immediate statement you have, is doing the actual count and returning the count into the variable "countrow".
The subsequent OPEN statement for the ref cursor is trying to open a cursor, and is expecting an SQL query to do that, but you are passing it your numeric value instead.
All you need to open a ref cursor is:
e.g.
OPEN result1 for 'select count(*) from '||x.table_name||' where proc_stat_code != 10';However, your code is so seriously flawed in many ways.
a) you don't need to declare a type of "REF CURSOR" yourself. Oracle provides a type called "SYS_REFCURSOR" that you can use already.
b) Your procedure is supplying a single ref cursor as an OUT variable, yet it tries to loop through multiple tables and re-use the same ref cursor over and over. That's not going to work. You can only pass one thing out in your OUT parameter.
I don't know how congos expects it's results, but I assume a ref cursor is acceptable to it, so what you're actually looking for is to pass back a single ref cursor that is based on a query that can give the results for all your tables in one go.
There are various queries that can be used to count records on multiple tables e.g.
(ref. Laurent Schneider's blog: http://laurentschneider.com/wordpress/2007/04/how-do-i-store-the-counts-of-all-tables.html )
SQL> select
2 table_name,
3 to_number(
4 extractvalue(
5 xmltype(
6 dbms_xmlgen.getxml('select count(*) c from '||table_name))
7 ,'/ROWSET/ROW/C')) count
8 from user_tables
9 where iot_type != 'IOT_OVERFLOW'
10 or iot_type is null;
TABLE_NAME COUNT
DEPT 4
EMP 14
BONUS 0
SALGRADE 5You could therefore open your refcursor using a single query based on the above (adapting it for your own needs and restrictions). -
Help on ORA-06550 & PLS-00363 Error while running a procedure from a packag
Greeting All,
I ran the following procedure from a package on a command line in sqlplus:
SQL> exec QUALITY_ASSURANCE.COPY_SW_RESOURCES(2009,2010,9508);Where '2009' is the old fiscal year, '2010' is the new fiscal year and '9508' is the error code passed from the calling program. But, I received the following error messages:
ERROR at line 1:
ORA-06550: line 1, column 53:
PLS-00363: expression '9508' cannot be used as an assignment target
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Any thoughts, suggestions and/or advice to resolve these errors.
Thanks in advance.Orchid wrote:
Justin,
Thanks for your response and information. Yes, Theoa was correct the 3rd parameter is an OUT variable, and it is a numeric field. The procedure was called by a form as follows:
QUALITY_ASSURANCE.COPY_SW_RESOURCES(:BLK_CONTROL.FROMFY,:BLK_CONTROL.TOFY,V_ERR);But the form does not work so I am trying to isolate the problem by running the procedure by itself in sqlplus to make sure there is no problem with the procedure.
Yesterday, I was able to run the procedure in Toad for Oracle to a successful completion by providing the 3 parameters: (2009, 2010, null). Just wonder why I cannot run the same procedure with the same parameters on a command line in sqlplus as follows:
exec QUALITY_ASSURANCE.COPY_SW_RESOURCES(2009,2010,null);So, if I understand your suggestion correctly, in order to run the procedure with the 3 parameter successfully in sqlplus,
I have to declare the 3rd parameter in PL/SQL. That is to create a PL/SQL file as suggested and run the file, correct? CORRECT! -
While compiling new package i receive following error in this statement:
BEGIN
l_STATUS :=1;
SELECT NULL INTO DUMMY FROM EM_DA.OE62_INFO
WHERE p_ch_message_code_i IN ('0001','0002')
AND IZD=p_ch_izda_i
AND EN=p_ch_eno_i
AND PR=p_ch_pr_class_i
AND KL=p_ch_kl_id_i;
l_STATUS :=3;
EXCEPTION WHEN NO_DATA_FOUND THEN NULL;
END;
ERROR: PLS-00363: expression 'l_STATUS' cannot be used as an assignment target
Parameters in package body are declared;
DUMMY VARCHAR2,
l_status VARCHAR2)
Any help will be apreciated.
Regards,
Robert
Edited by: user8660054 on 31.8.2010 4:19jurgenk wrote:
Or declare the parameter as an OUT parameter.Just be aware that if you do change the parameter to be an OUT parameter, the calling program will have the value of its variable changed as well. If that is the intention, and it is not entirely clear form the code snippet posted, then that is fine, but if the calling program does not expect this behaviour, it will cause problems.
John -
Hello,
i've created a package, but at compile, i got pls-00363
create or replace package OSAPI_NI as
procedure my_proc(SID number, cod_prefix varchar2, numar varchar2);
end OSAPI_NI;
show errors package OSAPI_NI;
CREATE OR REPLACE PACKAGE BODY OSAPI_NI as
procedure my_proc(SID number, cod_prefix varchar2, numar varchar2) is
begin
SID := null;
cod_prefix := null;
numar := null;
end;
end OSAPI_NI;LINE/COL ERROR
4/5 PLS-00363: expression 'SID' cannot be used as an assignment target
4/5 PL/SQL: Statement ignored
5/5 PLS-00363: expression 'COD_PREFIX' cannot be used as an assignment target
5/5 PL/SQL: Statement ignored
6/5 PLS-00363: expression 'NUMAR' cannot be used as an assignment target
6/5 PL/SQL: Statement ignored
Why those cannot be null? This package is just for test..
Thanks!Since you are not specifying the mode of the three parameters of procedure my_proc, Oracle assumes the default, which is IN. You will have to define them as OUT.
CREATE OR REPLACE PACKAGE BODY OSAPI_NI as
procedure my_proc(SID OUT number, cod_prefix OUT varchar2, numar OUT varchar2) is
begin
SID := null;
cod_prefix := null;
numar := null;
end;
end OSAPI_NI; -
Error(120,9): PLS-00363:
hello guys,
i am facing an error about passing an out* parameter in procedure call.
the error is:
Error(120,9): PLS-00363: expression '<expression>' cannot be used as an assignment target
and the code is :
create or replace
PROCEDURE usp_abc
v_pct in number ,
v_pVt in number ,
vr_payagainst ,
vr_Todate
as
begin
usp_xyz (
v_pTrantype=>vr_payagainst,
v_pTrandate=>vr_Todate,
v_pcd=>v_pct,
v_pVd=>v_pVt,
*v_pLedgerID=>null*,-----------------> the line generating error
end;the parameter v_pLedgerID in procedure usp_xyz has been defined as
v_pLedgerID OUT NUMBER
could anyone help me in fixing that bug..
thank you very muchDid you look up the error message in the documentation?
PLS-00363: expression 'string' cannot be used as an assignment targetCause: A literal, constant, IN parameter, loop counter, or function call was mistakenly used as the target of an assignment. For example, the following statement is illegal because the assignment target, 30, is a literal: SELECT deptno INTO 30 FROM dept WHERE ... -- illegal
Action: Correct the statement by using a valid assignment target.>
If v_pLedgerID has been defined as an OUT parameter you can't assign a value to it when you call the procedure. Here is a simple example demonstrating this:
SQL > DECLARE
2 PROCEDURE test ( v_var OUT number)
3 AS
4 BEGIN
5 DBMS_OUTPUT.PUT_LINE(v_var);
6 END;
7 BEGIN
8 test(v_var => 30);
9 END;
10 /
test(v_var => 30);
ERROR at line 8:
ORA-06550: line 8, column 14:
PLS-00363: expression '30' cannot be used as an assignment target
ORA-06550: line 8, column 9:
PL/SQL: Statement ignored -
Migration from Form 4.5 to 6.0 PLS-00363
Hello everyone,
I have a pll in Form 4.5 and now want to migrate to Form 6.0. When I compile it appears an this error:
PLS-00363: expression str cannot be used as an assignment target
Cause: A literal, constant, IN parameter, loop counter, or function call was mistakenly used as the target of an assignment. For example, the following statement is illegal because the assignment target, 30, is a literal:
SELECT deptno INTO 30 FROM dept WHERE ... -- illegal
Action: Correct the statement by using a valid assignment target.
This is an example:
TYPE Tday IS RECORD(
num number(2);
month varchar(20);
year number(4);
FUNCTION get_day (day IN Tday,...)
Begin
c_error := calcultate_year(pyear);
day.year := year;
End;
What do I should to do?
Thanks for the help!
nullyou define day as an IN parameter, so you're not allowed to change it's value. You could define it as IN OUT.
Maybe you are looking for
-
Saving Lightroom Mobile synced photos to existing library system?
This should be really straightforward but I can't figure it out. When I import photos from my DSLR, Lightroom saves them into a library structure (Pictures > 2104 > 08 > 07). This works for me, as it keeps everything together in the one place, easy t
-
I downloaded the reader to my iPad with iOS6. I have a PDF file in Safari.
When I click on the box with the arrow at top left, the reader is not listed. I can't find anyway to put the file in the reader. Is there something I haven't done after the download of reader to get it to work? Thanks for any help.
-
My iPad 2 (with iOS 4.3.3) doesn't find the upgrade to iOS 5/6
I have an iPad 2 running iOS 4.3.3. It's connected to a MBP on Mountain Lion (10.8.2) with iTunes 11.0 installed, with the Apple account that always has been used for that iPad signed in. I can't find a way to make the iPad upgrade to iOS 5 / 6 (I do
-
Can an interactive form built in adobe acrobat work on an ipad? I seem to be having problems with the text fields showing up and even the dropdown does not select the option I want
-
Problem in Stringecho "no bytecode available"
Firstly, thanks for this initiative, I think its greaT! After following all the instructions in the Getting Started Page, I reached the 22nd Step(Windows) and wrote mxmlc.exe -library-path+=../stringecho.swc --target-player=10.0.0 EchoTest.as in the