您现在的位置: 中国教师站 >> 教师关注 >> 电脑技术 >> 编程技术 >> 数据库 >> 正文

Google
使用VB调用Oracle程序包内的存储过程返回结果集
作者:Siny 文章来源:中国教师站cn-teacher 点击数: 更新时间:2007-4-22 16:29:55

       在实际的项目开发中我们需要通过VB(或其他语言工具)调用Oracle程序包内的存储过程返回结果集.这里以短信运营平台中的一个调用为例来说明这个过程,希望对你有所帮助.

--一.使用SQL*Plus创建以下项目:
--1.建表("OW_SMP"为方案名称,下同)

CREATE TABLE "OW_SMP"."SM_Send_SM_List"(
    SerialNo INT  PRIMARY KEY,  --序列号
    ServiceID VARCHAR(50),     --服务ID(业务类型)
    SMContent VARCHAR(1000),    --短信内容
    SendTarget VARCHAR(20),     --发送目标   
    Priority SMALLINT,      --发送优先级
    RCompleteTimeBegin DATE,   --要求完成日期(开始)
    RCompleteTimeEnd DATE,    --要求完成日期(结束)
    RCompleteHourBegin SMALLINT,   --要求完成时间(开始)
    RCompleteHourEnd SMALLINT,    --要求完成时间(结束)
    RequestTime DATE,     --发送请求时间
    RoadBy SMALLINT,      --发送通道(0:GSM模块,1:

短信网关)
    SendTargetDesc VARCHAR(100),   --发送目标描述
    FeeValue FLOAT,       --本条短信信息费用(

单位:分)
    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" BEFORE
INSERT ON "SM_SEND_SM_LIST"
    FOR EACH ROW begin
  select SendSNo.nextval into :new.serialno from dual;
end;
--3.插入数据
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

[1] [2] [3] [4] [5] [6] 下一页

相关专题:
 
 网友评论:(评论内容只代表网友观点,与本站立场无关!)
GOOGLE广告

阅读排行

| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 |
中国教师站

中国教师站 版权所有 Copyright © 2006-2020 All Rights Reserved 站长:Sina & Siny
[备用域名:www.JXZYW.Com] 有事请留言有事请留言
【实力成就精品 诚信呵护品牌】

信息产业部备案
苏ICP备06018635号