资源描述:
《创建一个PLSQL报表.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、创建一个PL/SQL报表—采购订单打印1、在PL/SQLDeveloper中,创建一个程序包:命名为QPO_PRINT_你名字拼音的缩写_PKG:1、删除Packagespecification中的预置代码(须保留第一行create和最后一行end的代码),然后在Packagespecification中添加代码:PROCEDUREprint_po(errbufOUTVARCHAR2,retcodeOUTNUMBER,p_segment1INVARCHAR2);该过程将作为系统内PL/SQL类型并发请求的执行过程。其中OUT类型的参数errbuf和retcode是系统要求的固定参数,所有PL/
2、SQL类型并发请求的执行过程都必须具有这两个参数。errbuf参数的内容将在日志文件中输出,效果与调用过程fnd_file.put_line输出文本到日志文件相同。retcode参数的值将决定并发请求的完成状态,0为正常(默认值即为0)、1为警告、2为错误。效果与调用过程fnd_concurrent.set_completion_status设置请求的完成状态相同。2、删除Packagebody中的预置代码(须保留第一行create和最后一行end的代码),然后在Packagebody中添加代码:PROCEDUREprint_po(errbufOUTVARCHAR2,retcodeOUTNUM
3、BER,p_segment1INVARCHAR2)ISCURSORc_po_headerISSELECTph.segment1,ph.comments,pv.vendor_name,pvs.vendor_site_code,ppx.last_name,hlb.location_codebill_to_location_code,hls.location_codeship_to_location_code,po_headers_sv3.get_po_status(ph.po_header_id)statusFROMpo_headers_allph,po_vendorspv,po_vendor_s
4、ites_allpvs,hr_locations_allhlb,hr_locations_allhls,per_people_xppxWHEREph.segment1=p_segment1ANDph.vendor_id=pv.vendor_id(+)ANDph.vendor_site_id=pvs.vendor_site_id(+)ANDph.bill_to_location_id=hlb.location_id(+)ANDph.ship_to_location_id=hls.location_id(+)ANDph.agent_id=ppx.person_id;CURSORc_distribu
5、tionsISSELECTpl.line_num
6、
7、'-'
8、
9、pll.shipment_num
10、
11、'-'
12、
13、pd.distribution_numline_number,msi.segment1item_num,pl.item_description,pl.unit_meas_lookup_code,pl.unit_price,mp.organization_code,pd.quantity_ordered,to_char(pll.need_by_date,'YYYY/MM/DD')need_by_date,ppa.segment1project_number,pt.task_number,p
14、d.expenditure_type,to_char(pd.expenditure_item_date,'YYYY/MM/DD')expenditure_item_date,gcc1.segment1
15、
16、'.'
17、
18、gcc1.segment2
19、
20、'.'
21、
22、gcc1.segment3
23、
24、'.'
25、
26、gcc1.segment4
27、
28、'.'
29、
30、gcc1.segment5
31、
32、'.'
33、
34、gcc1.segment6
35、
36、'.'
37、
38、gcc1.segment7expense_acct_code,gcc2.segment1
39、
40、'.'
41、
42、gcc2.segment2
43、
44、'.'
45、
46、gcc2.segment3
47、
48、'.'
49、
50、gc
51、c2.segment4
52、
53、'.'
54、
55、gcc2.segment5
56、
57、'.'
58、
59、gcc2.segment6
60、
61、'.'
62、
63、gcc2.segment7accrual_acct_code,gcc3.segment1
64、
65、'.'
66、
67、gcc3.segment2
68、
69、'.'
70、
71、gcc3.segment3
72、
73、'.'
74、
75、gcc3.segment4
76、
77、'.'
78、
79、gcc3.segment5
80、
81、'.'
82、
83、gcc3.segmen