色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

使用VB調(diào)用Oracle程序包內(nèi)的存儲(chǔ)過程返回結(jié)果集

瀏覽:51日期:2023-11-19 16:13:19
在實(shí)際的項(xiàng)目開發(fā)中我們需要通過VB(或其他語(yǔ)言工具)調(diào)用Oracle程序包內(nèi)的存儲(chǔ)過程返回結(jié)果集.這里以短信運(yùn)營(yíng)平臺(tái)中的一個(gè)調(diào)用為例來說明這個(gè)過程,希望對(duì)你有所幫助.--一.使用SQL*Plus創(chuàng)建以下項(xiàng)目: --1.建表('OW_SMP'為方案名稱,下同)CREATE TABLE 'OW_SMP'.'SM_Send_SM_List'( SerialNo INT; PRIMARY KEY,;;--序列號(hào) ServiceID VARCHAR(50),;;;;;--服務(wù)ID(業(yè)務(wù)類型) SMContent VARCHAR(1000),;;;;--短信內(nèi)容 SendTarget VARCHAR(20),;;;;;--發(fā)送目標(biāo); Priority SMALLINT,;;;;;;--發(fā)送優(yōu)先級(jí) RCompleteTimeBegin DATE,;;;--要求完成日期(開始) RCompleteTimeEnd DATE,;;;;--要求完成日期(結(jié)束) RCompleteHourBegin SMALLINT,;;;--要求完成時(shí)間(開始) RCompleteHourEnd SMALLINT,;;;;--要求完成時(shí)間(結(jié)束) RequestTime DATE,;;;;;--發(fā)送請(qǐng)求時(shí)間 RoadBy SMALLINT,;;;;;;--發(fā)送通道(0:GSM模塊,1:短信網(wǎng)關(guān)) SendTargetDesc VARCHAR(100),;;;--發(fā)送目標(biāo)描述 FeeValue FLOAT,;;;;;;;--本條短信信息費(fèi)用(單位:分) Pad1 VARCHAR(50), Pad2 VARCHAR(100), Pad3 VARCHAR(200), Pad4 VARCHAR(500), Pad5 VARCHAR(1000));--2.建立自增序列Create sequence 'OW_SMP'.'SENDSNO';CREATE OR REPLACE TRIGGER 'OW_SMP'.'BFINERT_SM_SEND' BEFOREINSERT ON 'SM_SEND_SM_LIST' FOR EACH ROW begin select SendSNo.nextval into :new.serialno from dual;end;--3.插入數(shù)據(jù)Insert SM_Send_SM_List (SMCOntent) values('Happy New Year To Jakcy!');Insert SM_Send_SM_List (SMCOntent) values('Happy New Year To Wxl!');--4.建立程序包和包體CREATE OR REPLACE; PACKAGE 'OW_SMP'.'OW_SMP_PACKAGE';; is type tSerialNo is table of sm_send_sm_list.SerialNo%type index by binary_integer; type tServiceID is table of sm_send_sm_list.ServiceID%type index by binary_integer; type tSMContent is table of sm_send_sm_list.SMContent%type index by binary_integer; type tSendTarget is table of sm_send_sm_list.SendTarget%type index by binary_integer; type tPriority is table of sm_send_sm_list.Priority%type index by binary_integer; type tRCompleteTimeBegin is table of sm_send_sm_list.RCompleteTimeBegin%type index by binary_integer; type tRCompleteTimeEnd is table of sm_send_sm_list.RCompleteTimeEnd%type index by binary_integer type tRCompleteHourBegin is table of sm_send_sm_list.RCompleteHourBegin%type index by binary_integer; type tRCompleteHourEnd is table of sm_send_sm_list.RCompleteHourEnd%type index by binary_integer;;;; type tRequestTime is table of sm_send_sm_list.RequestTime%type index by binary_integer;;; type tRoadBy is table of sm_send_sm_list.RoadBy%type index by binary_integer;; type tSendTargetDesc is table of sm_send_sm_list.SendTargetDesc%type index by binary_integer; type tFeeValue is table of sm_send_sm_list.FeeValue%type index by binary_integer; type tPad1 is table of sm_send_sm_list.Pad1%type index by binary_integer;;;;; type tPad2 is table of sm_send_sm_list.Pad2%type index by binary_integer;;;;; type tPad3 is table of sm_send_sm_list.Pad3%type index by binary_integer;;;;; type tPad4 is table of sm_send_sm_list.Pad4%type index by binary_integer;;;;; type tPad5 is table of sm_send_sm_list.Pad5%type index by binary_integer; type tCount is table of number index by binary_integer; procedure GetSendSM (v_NowByMinutein 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_RCompleteTimeEndout tRCompleteTimeEnd, v_RCompleteHourBegin out tRCompleteHourBegin, v_RCompleteHourEndout tRCompleteHourEnd, v_RequestTime;;;;;out tRequestTime, v_RoadBy;;out tRoadBy, v_SendTargetDesc;;out tSendTargetDesc, v_FeeValueout tFeeValue, v_Pad1;;;;out tPad1, v_Pad2;;;;out tPad2, v_Pad3;;;;out tPad3, v_Pad4;;;;out tPad4, v_Pad5;;;;out tPad5, v_Count;out tCount );end;/CREATE OR REPLACE; PACKAGE BODY 'OW_SMP'.'OW_SMP_PACKAGE';;;;; is procedure GetSendSM --獲得前1000條在指定時(shí)間內(nèi)的待發(fā)短信 (v_NowByMinutein 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_RCompleteTimeEndout tRCompleteTimeEnd, v_RCompleteHourBegin out tRCompleteHourBegin, v_RCompleteHourEndout tRCompleteHourEnd, v_RequestTime;;;;;out tRequestTime, v_RoadBy;;out tRoadBy, v_SendTargetDesc;;out tSendTargetDesc, v_FeeValueout tFeeValue, v_Pad1;;;;out tPad1, v_Pad2;;;;out tPad2, v_Pad3;;;;out tPad3, v_Pad4;;;;out tPad4, v_Pad5;;;;out tPad5, 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-1) and; RowNum<1001; smcount number default 1; begin for sm in sendsm_cur loop v_SerialNo(smcount):=sm.SerialNo; v_ServiceID(smcount):=sm.ServiceID; v_SMContent(smcount):=sm.SMContent; v_SendTarget(smcount):=sm.SendTarget; v_Priority(smcount):=sm.Priority; v_RCompleteTimeBegin(smcount):=sm.RCompleteTimeBegin; v_RCompleteTimeEnd(smcount):=sm.RCompleteTimeEnd; v_RCompleteHourBegin(smcount):=sm.RCompleteHourBegin; v_RCompleteHourEnd(smcount):=sm.RCompleteHourEnd; v_RequestTime(smcount):=sm.RequestTime; v_RoadBy(smcount):=sm.RoadBy; v_SendTargetDesc(smcount):=sm.SendTargetDesc; v_FeeValue(smcount):=sm.FeeValue; v_Pad1(smcount):=sm.Pad1; v_Pad2(smcount):=sm.Pad2; v_Pad3(smcount):=sm.Pad3; v_Pad4(smcount):=sm.Pad4; v_Pad5(smcount):=sm.Pad5 if smcount=1 then select count(*) into v_Count(smcount) 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-1) and RowNum<1001; end if; smcount:= smcount + 1; end loop end;end;/二.使用VB調(diào)用OW_SMP_Package.GetSendSM存儲(chǔ)過程:Sub GetSendSM() Dim; cmd as New ADODB.Command Dim rs as New ADODB.RecordSet cmd.ActiveConnection = GetConnection'獲得數(shù)據(jù)庫(kù)連接 cmd.CommandText = '{call ow_smp_package.GetSendSM(? ,{resultset 1000,v_SerialNo,v_ServiceID,v_SMContent,v_SendTarget,v_Priority,v_RCompleteTimeBegin,v_RCompleteTimeEnd,v_RCompleteHourBegin,v_RCompleteHourEnd,v_RequestTime,v_RoadBy,v_SendTargetDesc,v_FeeValue,v_Pad1,v_Pad2,v_Pad3,v_Pad4,v_Pad5,v_Count})}' cmd.CommandType = adCmdText cmd.Parameters.Append .CreateParameter('v_NowByMinute', adInteger, adParamInput, , 900) Rs.CursorType = adOpenStatic Rs.LockType = adLockReadOnly Set Rs.Source = cmd Rs.Open While Not Rs.EOF MsgBox 'SendSM data:SerialNo: ' & Rs('v_SerialNo') & ',SMContent: ' & Rs('v_SMContent') & ',Count: ' & Rs('v_Count') '對(duì)結(jié)果集的處理在這里增加代碼 Rs.MoveNext Wend Rs.Close set Rs=nothing set cmd=nothingEnd Sub
主站蜘蛛池模板: 久久综合给会久久狠狠狠 | 久久只有这才是精品99 | 色内内免费视频播放 | 国产成人精品久久一区二区小说 | 欧美在线视频看看 | 欧美一级成人免费大片 | 色资源二区在线视频 | 日韩 亚洲 制服 欧美 综合 | 久久免费视频网站 | 国产一区二区三区成人久久片 | 一级片网址 | 国产成年网站v片在线观看 国产成人aa在线视频 | 最新步兵社区在线观看 | 中文国产成人精品久久一区 | 第一色网站 | 久久草在线视频免费 | 国产三级在线视频观看 | 国产成人自拍在线 | 亚洲成a人v在线观看 | 欧美黄色免费网站 | 欧美精品一区二区三区免费播放 | 久久综合给会久久狠狠狠 | 亚洲欧美日韩精品久久久 | 久99久精品视频免费观看v | 欧美一级毛片免费看 | 91精品国产91久久久久久 | 特级淫片国产免费高清视频 | 欧美特一级| 精品国产a | 色综合久久88色综合天天小说 | 久草在现 | 久久精品免观看国产成人 | 91精品国产一区二区三区四区 | 国产女乱淫真高清免费视频 | 欧美在线精品一区二区三区 | 天堂最新版 | 成年网站在线在免费播放 | 精品国产一区二区三区在线 | 亚州免费 | 日韩在线视精品在亚洲 | 欧美一区二区三区免费看 |