色综合图-色综合图片-色综合图片二区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
主站蜘蛛池模板: 国产视频精品久久 | 最新中文字幕视频 | 韩国毛片在线观看 | 成 人 动漫在线观看网站网站 | 国产在线不卡午夜精品2021 | 黄网站在线播放视频免费观看 | 日韩欧美~中文字幕 | 一色屋色费精品视频在线看 | 国产手机在线小视频免费观看 | 欧美操操操 | 久久手机免费视频 | 亚洲美女视频网址 | 国产成人mv在线观看入口视频 | 国产原创在线视频 | a毛片久久免费观看 | 日韩欧美精品在线视频 | 日韩一区二区三区精品 | 美女动作一级毛片 | 久热香蕉精品视频在线播放 | 正在播放的国产a一片 | 日本三级s级在线播放 | 久久久久18 | 男女配种猛烈免费视频 | 在线精品国内外视频 | 久草精品在线 | 手机在线播放视频 | 成人在线一区二区三区 | 一级毛片情侣 | 精品久久久久久无码中文字幕 | 欧美日韩亚洲成色二本道三区 | 91原创视频在线观看 | 亚洲不卡视频在线观看 | 国产精品特级毛片一区二区三区 | 99九九99九九九视频精品 | 欧美一区二区三区日韩免费播 | 亚洲精品国产综合99久久一区 | 波多野结衣在线观看一区二区三区 | 国产精成人品 | 成人性色生活影片 | 日本黄页网站在线观看 | 精品国产美女福到在线不卡f |