Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error in code with cursor

Status
Not open for further replies.

murphyhg

Technical User
Mar 1, 2006
98
US
When I try and package this stored procedure I get an error.

Error report:
ORA-06550: line 2, column 1:
PLS-00905: object moveproduct is invalid
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:


create or replace
procedure moveproduct is

cursor cPrograms is
select * from program;

cursor cProducts(vprogramid number) is
select * from nis_sample.price_list where program_id = vprogramid;

begin

for a in cPrograms loop

for b in cProducts(a.programid) loop

insert into product(
productid, isactive, producttype, productname, productdescription, fee, feetype,
isproficiencytestrequired, special, remarks, testmethod, testmethodcount, designation, programid
)
values(
product_seq.nextval,
decode(b.active, 'Y', 1, 0),
b.fee_type,
b.title,
b.description,
b.fee,
b.fixed_or_variable,
decode(b.proficiency_test_reqd, 'Y', 1, 0),
b.special,
b.remarks,
b.test_method,
b.test_method_count,
b.desig,
a.programid
);

end loop;
 
Well, it's a little hard to tell what the problem really is since you did not include the error you are getting. But I do notice that you are missing an END LOOP and END in your code. The end of your code should look like
Code:
       end loop;
  
end loop;
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top