第一步:定义PL/SQL的过程或包;
create or replace procedure output_html_report(ERRBUF OUT VARCHAR2,
ERRCODE OUT VARCHAR2,
VDATE1 IN VARCHAR2,
VDATE2 IN VARCHAR2 ) is
begin
fnd_file.put
(fnd_file.output,
'
'
);
fnd_file.put
(fnd_file.output,
'
PO_Number | PO_TYPE | Currency_code | PO_Status |
'
);
FOR rec IN (SELECT rownum,h.segment1, h.type_lookup_code, h.currency_code,
h.authorization_status
FROM po.po_headers_all h
WHERE h.org_id = 211
AND h.creation_date BETWEEN TO_DATE(trim(VDATE1), 'YYYY-MM-DD HH24:MI:SS' )
AND TO_DATE(trim(VDATE2), 'YYYY-MM-DD HH24:MI:SS' ))
LOOP
IF MOD(rec.rownum,4)=0 THEN
fnd_file.put (fnd_file.output,
'
' || rec.segment1 || ' |
' || rec.type_lookup_code || ' |
' || rec.currency_code || ' |
' || nvl(rec.authorization_status,' ') || ' |
'
);
ELSE
fnd_file.put (fnd_file.output,
'
' || rec.segment1 || ' |
' || rec.type_lookup_code || ' |
' || rec.currency_code || ' |
' || nvl(rec.authorization_status,' ') || ' |
'
);
END IF;
END LOOP;
fnd_file.put (fnd_file.output, '
');
fnd_file.put (fnd_file.output, '
');
end output_html_report;
第二步:定义并发请求;
第三步:执行并呈现结果;
阅读(3606) | 评论(0) | 转发(0) |