频道直达 - 学院 - 下载 - 交易 - 特效 - 字库 - 手册 -排名-工具- 繁體
网页教学网站开发 设为首页
加入收藏
联系我们
建站搜索: 常用广告代码   用户注册 | 用户登陆
您当前的位置:中国建站之家 -> 网站开发设计技术教程 -> 网站数据库开发教程 -> MobiLink通过Oracle返回下载的数据流

MobiLink通过Oracle返回下载的数据流

作者:未知  来源:www.jz123.cn  发布时间:2007-8-7 2:18:06  发布人:圈圈

减小字体 增大字体

例:通过Sybase mobilink实现两个数据库之间数据同步(客户端与服务器),其中牵涉到数据的下载,在进行数据下载时,如果通过调用存储过程实现的下载流获取,那么实际操作中同步老是报错,原因如下:

环境描述如下:

中心数据库(服务器端):数据库为Oracle,mobilink服务器通过ODBC与数据库建立连接远程数据库(客户端):sybase ASA

客户端需要从服务端下载表A中指定条数的记录,由于业务需要,在下载过程中还需要对相关表格进行较为复杂设置,例如下载后需要将该记录的某列置为‘已下载’,从而避免其他客户端进行重复下载,因此在服务端使用存储过程进行下载流控制,从sybase文档中得知:

Oracle requires that a package be defined.
This package must contain a record type
for the result set, and a cursor type
that returns the record type.
Create or replace package SPInfo asType
SPRec is record (    pk     integer,   
col1   varchar(100),    col2   varchar(20));
Type SPCursor is ref cursor return SPRec;
End SPInfo;
Next, Oracle requires a stored procedure
with the cursor type as the first parameter.
Note that the download_cursor script only
passes in two parameters, not three. For
stored procedures returning result sets
in Oracle, cursor types declared as parameters
in the stored procedure definition define
the structure of the result set, but do not
define a true parameter as such. In this
example, the stored procedure also adds
the script to the MobiLink system table.
Create or replace procedure   
DownloadMyTable( v_spcursor IN
OUT SPInfo.SPCursor,v_last_dl_ts IN
DATE,v_user_name IN VARCHAR ) AsBegin
Open v_spcursor For select pk, col1,
col2 from MyTable where last_modified >
= v_last_dl_ts and employee = v_user_name;
End;CALL ml_add_table_script
(   'v1',  'MyTable',  'download_cursor',
 '{CALL DownloadMyTable({ml s.last_table_download},
{ml s.username} )}');

按照文档描述,进行相关设置后,进行同步,但是在同步进行中mobilink服务器报错,信息如下('EAPP_BARCODE_DOWNLOAD' 为存储过程名字):

错误: ODBC: [MERANT][ODBC Oracle driver]
[Oracle]ORA-06550: line 1, column 8:
PLS-00306: wrong number or types
of arguments in call to 'EAPP_BARCODE_DOWNLOAD'
ORA-06550: line 1, column 8:PL/SQL: Statement
ignored (ODBC 状态 = HY000,本地错误代码 = 6550)
I. 05/17 20:05:20 <1.9> [1100139459]:
错误环境: 用户名: 1100139459  修改的用户名: 1100139459
事务: 下载 表名: ES_APP_BARCODEI. 05/17 20:05:20 <1.9>
[1100139459]: 脚本版本: BCGET  脚本: {call
EAPP_BARCODE_DOWNLOAD(?,?)} 错误环境结束
I. 05/17 20:05:20 <1.9> [1100139459]:
警告: [10010] 未定义任何错误处理脚本。
缺省的动作代码 (3000) 将决定错误行为。
I. 05/17 20:05:20 <1.9> [1100139459]:
download_cursor ES_APP_BARCODE(关闭)

从错误信息看来,是由于调用存储过程时所使用参数个数错误导致,后来经过查找发现:可能出现该原因是在ODBC设置中未勾选“Procedure Returns Results”所致,进入ODBC设置面板,修改相关参数,再运行,一切正常。


将本文收藏到QQ书签与更多好友分享
[打 印]
[] [返回上一页] [收 藏]
∷相关文章评论∷    (评论内容只代表网友观点,与本站立场无关!) [更多评论...]
精彩推荐
热门文章
· 注册码大全二
· 注册码大全四
· 注册码大全一
· 要10G免费网络硬盘的请进..
· 通过google 赶快来赚美金..
· 注册码大全十
· 头像-qq头像(qq新头像)4..
· 让你轻松架设FTP服务器1..
· 注册码大全三
· 梦幻背景图片7
· 卡通动物图片6
· 网页制作素材-按钮素材2..
· 让你轻松架设FTP服务器5..
· 风景图片8
· 注册码大全九
· 让你轻松架设FTP服务器2..
关注此文读者还看过
· 在MySQL数据库增加新用户..
· 在ASP中取得服务器网卡的..
· 谈网站页面关键字的布局..
· 张朝阳:互联网版图没有..
· 初探PHP5<1>
· Whois 的PHP代码
· 从7万排名到5千余排名,写..
· Alexa作弊的相关问答
· 携程网公布06年第四季财..
· 用色彩提高你的点击率
· SQL Server数据库技术(..
· 用 Photoshop 做残旧的凶..
· ASP.NET创建XML Web服务..
· ADSI及其在WEB上的应用
· 编程方向
· 用asp怎样编写文档搜索页..
相关文章
· SQL Anywhere包含的MobiLin..
· 用MobiLink建立一个简单的数..
· 实例介绍一个相对复杂的Mob..
· 解析MobiLink实现基于时间戳..
· 解析MobiLink实现基于时间戳..
· 实例介绍一个相对复杂的Mob..
· MobiLink通过Oracle返回下载..
· 用MobiLink建立一个简单的数..
· SQL Anywhere包含的MobiLin..
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 人才招聘
网站合作、内容监督、商务咨询:QQ: 9576619
Copyright ? 2005--2008 中国建站之家版权所有
粤ICP备05092265号