如何从XMLType的参数从存储过程返回的数据 [英] how to retrieve the data from xmltype parameter returned from stored proc

查看:651
本文介绍了如何从XMLType的参数从存储过程返回的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个存储过程返回的XMLType参数。如何从获取数据使用vb.net?

  db.Parameters(参数,Oracle.DataAccess.Client.OracleDbType.XmlType,_
                                           Data.ParameterDirection.Output)
 

解决方案

我从来没有用过VB.net,但如果你有改变存储过程的能力,我会考虑的XMLTYPE转换为CLOB和返回该而不是(使用xmltype.getclobval()),我觉得不太可能.NET Oracle驱动程序将提供XMLTYPE支持。

显然,这将意味着你需要使用一个XML解析器在VB code解析字符串(存储在CLOB)访问任何XML领域内吧。

I have a stored proc it returns xmltype parameter. How to get the data from that using vb.net?

db.Parameters("param", Oracle.DataAccess.Client.OracleDbType.XmlType, _
                                           Data.ParameterDirection.Output)

解决方案

I've never used VB.net, but if you have the ability to change the stored procedure, I would consider converting the XMLTYPE to a CLOB and returning that instead (using xmltype.getclobval() ) I find it unlikely that the .net Oracle driver will provide support for XMLTYPE.

Obviously that will mean you need to make use of an XML parser in the VB code to parse the string (stored in the clob) to access any of the XML fields within it.

这篇关于如何从XMLType的参数从存储过程返回的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆