在實際的項目開發中我們需要通過VB(或其他語言工具)調用Oracle程序包內的存儲過程返回結果集
一
CREATE TABLE
SerialNo INT PRIMARY KEY
ServiceID VARCHAR(
SMContent VARCHAR(
SendTarget VARCHAR(
Priority SMALLINT
RCompleteTimeBegin DATE
RCompleteTimeEnd DATE
RCompleteHourBegin SMALLINT
RCompleteHourEnd SMALLINT
RequestTime DATE
RoadBy SMALLINT
SendTargetDesc VARCHAR(
FeeValue FLOAT
Pad
Pad
Pad
Pad
Pad
);
Create sequence
CREATE OR REPLACE TRIGGER
INSERT ON
FOR EACH ROW begin
select SendSNo
end;
Insert SM_Send_SM_List (SMCOntent) values(
Insert SM_Send_SM_List (SMCOntent) values(
CREATE OR REPLACE PACKAGE
is
type tSerialNo is table of sm_send_sm_list
index by binary_integer;
type tServiceID is table of sm_send_sm_list
index by binary_integer;
type tSMContent is table of sm_send_sm_list
index by binary_integer;
type tSendTarget is table of sm_send_sm_list
index by binary_integer;
type tPriority is table of sm_send_sm_list
index by binary_integer;
type tRCompleteTimeBegin is table of sm_send_sm_list
index by binary_integer;
type tRCompleteTimeEnd is table of sm_send_sm_list
index by binary_integer;
type tRCompleteHourBegin is table of sm_send_sm_list
index by binary_integer;
type tRCompleteHourEnd is table of sm_send_sm_list
index by binary_integer;
type tRequestTime is table of sm_send_sm_list
index by binary_integer;
type tRoadBy is table of sm_send_sm_list
index by binary_integer;
type tSendTargetDesc is table of sm_send_sm_list
index by binary_integer;
type tFeeValue is table of sm_send_sm_list
index by binary_integer;
type tPad
index by binary_integer;
type tPad
index by binary_integer;
type tPad
index by binary_integer;
type tPad
index by binary_integer;
type tPad
index by binary_integer;
type tCount is table of number
index by binary_integer;
procedure GetSendSM
(v_NowByMinute in Number
v_SerialNo out tSerialNo
v_ServiceID out tServiceID
v_SMContent out tSMContent
v_SendTarget out tSendTarget
v_Priority out tPriority
v_RCompleteTimeBegin out tRCompleteTimeBegin
v_RCompleteTimeEnd out tRCompleteTimeEnd
v_RCompleteHourBegin out tRCompleteHourBegin
v_RCompleteHourEnd out tRCompleteHourEnd
v_RequestTime out tRequestTime
v_RoadBy out tRoadBy
v_SendTargetDesc out tSendTargetDesc
v_FeeValue out tFeeValue
v_Pad
v_Pad
v_Pad
v_Pad
v_Pad
v_Count out tCount
;
end;
/
CREATE OR REPLACE PACKAGE BODY
is
procedure GetSendSM
(v_NowByMinute in Number
v_SerialNo out tSerialNo
v_ServiceID out tServiceID
v_SMContent out tSMContent
v_SendTarget out tSendTarget
v_Priority out tPriority
v_RCompleteTimeBegin out tRCompleteTimeBegin
v_RCompleteTimeEnd out tRCompleteTimeEnd
v_RCompleteHourBegin out tRCompleteHourBegin
v_RCompleteHourEnd out tRCompleteHourEnd
v_RequestTime out tRequestTime
v_RoadBy out tRoadBy
v_SendTargetDesc out tSendTargetDesc
v_FeeValue out tFeeValue
v_Pad
v_Pad
v_Pad
v_Pad
v_Pad
v_Count out tcount)
is
cursor sendsm_cur is
select * from sm_send_sm_list
where RCompleteHourBegin<=v_NowByMinute and
RCompleteHourEnd>=v_NowByMinute and (RCompleteTimeBegin is null or
RCompleteTimeBegin<=sysdate)
and (RCompleteTimeEnd is null or RCompleteTimeEnd>=sysdate
and RowNum<
smcount number default
begin
for sm in sendsm_cur
loop
v_SerialNo(smcount):=sm
v_ServiceID(smcount):=sm
v_SMContent(smcount):=sm
v_SendTarget(smcount):=sm
v_Priority(smcount):=sm
v_RCompleteTimeBegin(smcount):=sm
v_RCompleteTimeEnd(smcount):=sm
v_RCompleteHourBegin(smcount):=sm
v_RCompleteHourEnd(smcount):=sm
v_RequestTime(smcount):=sm
v_RoadBy(smcount):=sm
v_SendTargetDesc(smcount):=sm
v_FeeValue(smcount):=sm
v_Pad
v_Pad
v_Pad
v_Pad
v_Pad
From:http://tw.wingwit.com/Article/program/Oracle/201311/18179.html