I am attempting to create a stored proc (my first using Oracle)... It gives me 2 blasted error messages. Please tell what I am missing... I cannot see it. I have counted my columns and I get equal counts on the select and the insert.(arrrgggghhh!!!)
Error Message
1 Line 21 Col 1 PL/SQL: SQL Statement ignored
1 Line 21 Col 13 PL/SQL: ORA-00947: not enough values
CREATE OR REPLACE PROCEDURE sp_createpayrecords
(t_trade_date IN varchar2,
t_settle_date IN varchar2,
t_initials IN char,
t_cusip IN char,
t_trade_number IN char
)
AS
BEGIN
INSERT INTO wt_payfile
(
trade_date ,trade_number ,settle_date,
account_number ,account_name ,rep_id,
executing_rep , cusip ,gross,
id ,description ,prod_code,
net ,eid ,team_name
)
SELECT
t_trade_date ,t_trade_number ,t_settle_date,
acct_no ,name1 ,payto_rep,
payto_rep ,t_cusip ,pay_gross,
t_initials+ CASE WHEN FC_FLAG='Y' THEN 'OLB' ELSE 'NET'
END id,
CASE WHEN FC_FLAG='Y' THEN 'FC' ELSE 'LB'
END + ' W TRADE' description,
CASE WHEN FC_FLAG='Y' THEN '5921' ELSE '5940'
END prod_code,
pay_net ,employee_no ,team_name
FROM wt_commissions;
END;
[blue]Kathy,
Bus Sys Analyst[/blue]
"I am always doing that which I can not do, in order that I may learn how to do it."– Pablo Picasso
The person who says it can't be done shouldn't interrupt the person who is doing it.—Chinese Proverb
Error Message
1 Line 21 Col 1 PL/SQL: SQL Statement ignored
1 Line 21 Col 13 PL/SQL: ORA-00947: not enough values
CREATE OR REPLACE PROCEDURE sp_createpayrecords
(t_trade_date IN varchar2,
t_settle_date IN varchar2,
t_initials IN char,
t_cusip IN char,
t_trade_number IN char
)
AS
BEGIN
INSERT INTO wt_payfile
(
trade_date ,trade_number ,settle_date,
account_number ,account_name ,rep_id,
executing_rep , cusip ,gross,
id ,description ,prod_code,
net ,eid ,team_name
)
SELECT
t_trade_date ,t_trade_number ,t_settle_date,
acct_no ,name1 ,payto_rep,
payto_rep ,t_cusip ,pay_gross,
t_initials+ CASE WHEN FC_FLAG='Y' THEN 'OLB' ELSE 'NET'
END id,
CASE WHEN FC_FLAG='Y' THEN 'FC' ELSE 'LB'
END + ' W TRADE' description,
CASE WHEN FC_FLAG='Y' THEN '5921' ELSE '5940'
END prod_code,
pay_net ,employee_no ,team_name
FROM wt_commissions;
END;
[blue]Kathy,
Bus Sys Analyst[/blue]
"I am always doing that which I can not do, in order that I may learn how to do it."– Pablo Picasso
The person who says it can't be done shouldn't interrupt the person who is doing it.—Chinese Proverb