报告生成选项卡错误
我有一个使用 util 文件和游标的程序,我必须以代码中给出的格式为表 cl_masd_ payment 生成报告
我已经编写了该程序,但它仍然给出错误...不知道问题是什么
任何帮助都会受到高度赞赏。
Anand
我写的程序是这样的:
CREATE OR REPLACE PROCEDURE p_Anand_REP
IS
pnum_id varchar2(12);
p_labmat_acc varchar2(30);
p_pmt_dt date;
p_tot_amt number(9,2);
p_sd_amt number(10);
p_labmat_amt number(15);
p_add varchar2(100);
p_util_rec utl_file.file_type;
CURSOR cur_pmt_anand
IS
select rpad(ma_cons,10,' ')||rpad(ma_cons_chk_dgt,10,' '),
rpad(ma_ac_lab,10,' ')||rpad(ma_ac_mat,10,' '),
ma_pmt_dt,
ma_pmt_amt,
ma_sd_amt,
rpad(ma_sc_amt_lab,10,' ')||rpad(ma_sc_amt_mat,10,' '),
rpad(ma_add_one,40,' ')||rpad(ma_add_two,40,' ')||rpad(ma_add_three,40,' ')||rpad(ma_add_four,40,' ')||rpad(ma_add_five,40,' ')||rpad(ma_add_six,40,' ')
from cl_masd_payments
where ma_cons=9600100100;
order by ma_pmt_dt;
BEGIN
p_util_rec:=utl_file.fopen('/san3/work/test1/ananda/plsql','PAY_REP','w');
OPEN cur_pmt_anand;
utl_file.put_line(p_util_rec,'CONS_NO/CD LAB/MAT_ACC PMT_DT PMT_AMT SD_AMT LAB/MAT_AMT NAME_ADDR ');
LOOP
fetch cur_pmt_anand into pnum_id,p_labmat_acc,p_pmt_dt,p_tot_amt,p_sd_amt,p_labmat_amt,p_add;
BEGIN
utl_file.put_line(p_util_rec,rpad(pnum_id,15,' ')||rpad(p_labmat_acc,15,' ')||rpad(p_pmt_dt,15,' ')||rpad(p_tot_amt,15,' ')||rpad(p_sd_amt,15,' ')||rpad(p_labmat_amt,15,' ')||rpad(p_add,15,' '));
exit when cur_pmt_anand%NOTFOUND;
END LOOP;
utl_file.fclose(p_util_rec);
CLOSE cur_pmt_anand;
END p_Anand_REP;
/
I have a procedure using a util file and cursor where i have to generate a report for the table cl_masd_payments in the format given in the code
I have written the procedure but its still giving errors...don know what is the problem
Any help will be highly appreciated.
Anand
The procedure i have written is such:
CREATE OR REPLACE PROCEDURE p_Anand_REP
IS
pnum_id varchar2(12);
p_labmat_acc varchar2(30);
p_pmt_dt date;
p_tot_amt number(9,2);
p_sd_amt number(10);
p_labmat_amt number(15);
p_add varchar2(100);
p_util_rec utl_file.file_type;
CURSOR cur_pmt_anand
IS
select rpad(ma_cons,10,' ')||rpad(ma_cons_chk_dgt,10,' '),
rpad(ma_ac_lab,10,' ')||rpad(ma_ac_mat,10,' '),
ma_pmt_dt,
ma_pmt_amt,
ma_sd_amt,
rpad(ma_sc_amt_lab,10,' ')||rpad(ma_sc_amt_mat,10,' '),
rpad(ma_add_one,40,' ')||rpad(ma_add_two,40,' ')||rpad(ma_add_three,40,' ')||rpad(ma_add_four,40,' ')||rpad(ma_add_five,40,' ')||rpad(ma_add_six,40,' ')
from cl_masd_payments
where ma_cons=9600100100;
order by ma_pmt_dt;
BEGIN
p_util_rec:=utl_file.fopen('/san3/work/test1/ananda/plsql','PAY_REP','w');
OPEN cur_pmt_anand;
utl_file.put_line(p_util_rec,'CONS_NO/CD LAB/MAT_ACC PMT_DT PMT_AMT SD_AMT LAB/MAT_AMT NAME_ADDR ');
LOOP
fetch cur_pmt_anand into pnum_id,p_labmat_acc,p_pmt_dt,p_tot_amt,p_sd_amt,p_labmat_amt,p_add;
BEGIN
utl_file.put_line(p_util_rec,rpad(pnum_id,15,' ')||rpad(p_labmat_acc,15,' ')||rpad(p_pmt_dt,15,' ')||rpad(p_tot_amt,15,' ')||rpad(p_sd_amt,15,' ')||rpad(p_labmat_amt,15,' ')||rpad(p_add,15,' '));
exit when cur_pmt_anand%NOTFOUND;
END LOOP;
utl_file.fclose(p_util_rec);
CLOSE cur_pmt_anand;
END p_Anand_REP;
/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的过程包含语法错误,这是您的过程的格式化版本:
Your procedure contains syntax errors, this is a formatted version of your procedure: