Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL/SQL: ORA-01744: inappropriate INTO

591556Oct 20 2007 — edited Oct 21 2007

I have this part of the stored procedure, trying to use one select query to fill in 2 variables, got error 'PL/SQL: ORA-01744: inappropriate INTO', please help, thanks in advance

--print summary of subsection
select  t.*  from (select count(membership.id) into v_tot_mem_by_trainer,
sum((membership_plan.monthly_price- membership.monthly_discount) * round(months_between(sysdate, membership.join_date),0)) into v_tot_rev_by_trainer
from membership, membership_plan
where membership.trainer_id =  r_trainer.trainer_id and
membership.membership_plan_id = membership_plan.id) t;

this is the original select query that has no problem

select t.*  from (select count(membership.id) as total_number_of_members,
sum((membership_plan.monthly_price- membership.monthly_discount) * round(months_between(sysdate, membership.join_date),0)) as total_membership_payment
from membership, membership_plan
where membership.membership_plan_id = membership_plan.id) t;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 18 2007
Added on Oct 20 2007
6 comments
12,378 views