oracle 创建存储过程和执行存储过程语句(以及清空表数据的特殊写法)
create or replace procedure bid_bidding_docm_headers_1_s is
begin
EXECUTE IMMEDIATE ‘truncate table bid_bidding_docm_headers_1’;
INSERT INTO bid_bidding_docm_headers_1
SELECT dh.bid_header_id,bid_entrustment_pkg.get_bidder_desc(dh.bidder_id,
dh.bidder_company_id) AS bidder_desc
FROM bid_bidding_docm_lines dl,
bid_entrustment_headers eh,
bid_bidding_docm_headers dh
WHERE dl.bid_header_id = dh.bid_header_id
AND eh.entrustment_header_id = dh.entrustment_header_id
AND dl.success_bid_quantity IS NOT NULL
AND eh.STATUS = ‘FINISHED’
AND dl.bidding_submit_flag = ‘Y’;
end bid_bidding_docm_headers_1_s;
begin
bid_bidding_docm_headers_1_s;
end;