No idea what I'm missing?

No idea what I'm missing?

{case}
DECLARE
CURSOR c_deductions (VARCHAR, cp_payno NUMBER cp_year) IS
SELECT pay_period,
pay_group,
check_date,
Sum (soc_sec_gross) as SOC_SEC_GROSS,
Sum (medicare_gross) as MEDICARE_GROSS,
Sum (Gross) as GROSS
OF baninst1.pzvdedn
WHERE pay_year = cp_year
AND pay_period = cp_payno
Pay_period GROUP, pay_group, check_date
ORDER BY pay_period, pay_group, check_date;
v_Data c_deductions % ROWTYPE;
BEGIN
DBMS_OUTPUT. Put_line ('pay_period, pay_group, check_date, soc_sec_gross, medicare_gross,' |)
"brute");
OPEN c_deductions.
SEEK c_deductions INTO v_Data;
C_deductions % FOUND LOOP
DBMS_OUTPUT. Put_line (v_Data.pay_period | ',' | v_Data.pay_group | ',' | v_Data.check_date | ',' | v_Data.soc_sec_gross | ',' |)
v_Data.medicare_gross | ',' | v_Data.gross | «, ») ;
SEEK c_deductions INTO v_Data;
END LOOP;
CLOSE C_deductions;
END;
/

OPEN c_deductions.
*
ERROR on line 18:
ORA-06550: line 18, column 2:
PLS-00306: wrong number or types of arguments in the call to 'C_DEDUCTIONS '.
ORA-06550: line 18, column 2:
PL/SQL: SQL statement ignored
{case}

Published by: user5737516 on December 7, 2009 12:55
Opsss I see it now! Thank you

Hello

If you declare the cursor with 2 parameters, like you did,

CURSOR c_deductions(cp_year VARCHAR, cp_payno NUMBER) IS

you will need to open with 2 parameters.
You try to open it with 0:

OPEN c_deductions;

Remove the statement parameters, or add them to the OPEN statement, for example:

OPEN c_deductions (this_year, this_payno);

You're also missing formatting, that keeps me from looking at the code again. Indent the statements to show the extent of BEGIN = END, LOOP-END LOOP, multiline statements and so forth.
When publishing text formatted on this site, type the 6 characters:

(small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

Tags: Database

Similar Questions

Maybe you are looking for