首页 \ 问答 \ Xquery从XML中获取特定元素的值,该XML在DB2中存储为[XML Nullable column](Xquery to get the value of a specific element from an XML which is stored as [XML Nullable column] in DB2)

Xquery从XML中获取特定元素的值,该XML在DB2中存储为[XML Nullable column](Xquery to get the value of a specific element from an XML which is stored as [XML Nullable column] in DB2)

请考虑以下XML:

     <Employee>
        <EmpDetails>   
             <Name>huff</Name>
        </EmpDetails>
     </Employee>

以上[XML NULLABLE]在DB2中的表中以数据类型[XML NULLABLE]形式存储为column(DATA) 。 假设表的结构是这样的:

      Table name:  REGEVENT
     Columns are: REFID (VARCHAR), APPID(VARCHAR), DATA(XML NULLABLE)

假设表中的值是: REFID(12345)APPID(54321) ,DATA(如上所述的Employee xml)。

现在我必须使用Xquery获取存储在DATA列中的XML中的元素值(或者任何其他方式也可以)。

我正在尝试以下查询,但我得到的值EmpName为NULL。

select XMLCAST(XMLQUERY('$d/Employee/EmpDetails/Name' PASSING rg.DATA AS "d") AS VARCHAR(50)) AS EmpName from REGEVENT  rg where REFID='12345';

Consider the following XML :

     <Employee>
        <EmpDetails>   
             <Name>huff</Name>
        </EmpDetails>
     </Employee>

Above XMLis stored as a column(DATA) with data type [XML NULLABLE] in a table in DB2. Assume that the structure of the table is something like this:

      Table name:  REGEVENT
     Columns are: REFID (VARCHAR), APPID(VARCHAR), DATA(XML NULLABLE)

Suppose the value in the table is: REFID(12345), APPID(54321), DATA(Employee xml as mentioned above).

Now I have to get the value of element in the XML stored in column DATA using Xquery (Or any other way is also fine).

I am trying the following query, but I am getting the value EmpName as NULL.

select XMLCAST(XMLQUERY('$d/Employee/EmpDetails/Name' PASSING rg.DATA AS "d") AS VARCHAR(50)) AS EmpName from REGEVENT  rg where REFID='12345';

原文:https://stackoverflow.com/questions/21087022
更新时间:2023-09-21 12:09

最满意答案

还没有,因为操作系统仍然未被管理。

如果MS终于做了他们实验室多年来一直在讨论的内容,并生成一个完全托管的操作系统,那么它将会。

该操作系统不会向后兼容。 他们必须首先生成Office,IE等管理版本。 他们将不得不生产虚拟机来运行非托管应用程序。

这种痛苦与从Mac OS9到OSX的转变类似。


Not yet, because the OS is still unmanaged.

If MS finally do what their labs have been talking about for years and produce a fully managed OS then it will.

That OS won't be backwards compatible though. They would have to produce managed versions of Office, IE, etc first. They will have to produce a virtual machine to run unmanaged apps.

The pain would be something similar to the move from Mac OS9 to OSX.

相关问答

更多
  • 有许多C ++消息库,从旧的ACE到Google的协议缓冲区或Facebook的(现在是Apache的) Thrift或Cisco的Etch等新的 。 目前我听到有关ZeroMq的好消息 ,这可能会给你比你习惯的更多。 there are many C++ messaging libraries, from the old ACE to new ones like Google's Protocol Buffers or Facebook's (now Apache's) Thrift or Cisco's ...
  • 您是否正在从发送数据的计算机上查看Wireshark转储? 如果是这样,它可能只是在Wireshark看到它的堆栈中没有计算校验和。 现在许多网卡都具有TCP Checksum Offload,其中校验和由硬件完成,因此校验和字段在出路时将为零(Wireshark在将数据包发送到硬件之前就会获得数据包)。 由于你收到ACK,接收端显然很酷。 另外,如果你正在与本地主机通话,你的堆栈可能根本不会受到校验和的困扰(它们对于主机自身来说不是必须的)。 Are you looking at a Wireshark ...
  • 除非您可以访问正在录制的应用程序的完整源代码,并且可以访问应用程序的开发人员以帮助您设置COM / DCOM的过滤器,否则您应该避免使用它,就好像它是ebola-laced bubonic plague。 切勿在无法访问源代码的商业应用程序(如浏览器)上使用它。 此外,您的错误消息指出您在主机上的权利可能存在问题。 安装要求请注意,管理访问是使用LoadRunner工具的推荐模型。 如上所述的错误消息似乎暗示您可能没有对主机的管理访问权限。 Unless you have access to the ful ...
  • 您可以使用ActiveState中的PerlIS。 它很好而且不那么麻烦。 I needed to enable "Basic Authentication" under IIS instead of "Windows Authentication"
  • 我不知道任何官方指导,指定DCOM的继任者,但.NET有两个框架可以替代DCOM的使用。 他们是WCF和.NET Remoting。 WCF可以用作DCOM等提供的所有传输特性的替代品。 如果您处于无法使用.NET 3.0或更高版本的情况, 您只能使用.NET Remoting。 .NET中的两个框架都允许您发出调用并将执行的控制权交给其他线程,进程和计算机中的主机。 远程处理可能是为了取代DCOM,它也可以处理几乎所有的传输功能,但采用并不是那么好。 总的来说,现在大多数人更喜欢WCF,因为一切都很好定义 ...
  • 还没有,因为操作系统仍然未被管理。 如果MS终于做了他们实验室多年来一直在讨论的内容,并生成一个完全托管的操作系统,那么它将会。 该操作系统不会向后兼容。 他们必须首先生成Office,IE等管理版本。 他们将不得不生产虚拟机来运行非托管应用程序。 这种痛苦与从Mac OS9到OSX的转变类似。 Not yet, because the OS is still unmanaged. If MS finally do what their labs have been talking about for ye ...
  • 请参阅以下链接以获取答案。 http://www.opclabs.com/forum/connections-reconnections-com-dcom/1778-a-security-package-specific-error-occurred-from-dcom Refer the below link for the answer. http://www.opclabs.com/forum/connections-reconnections-com-dcom/1778-a-security-pac ...
  • 我想我找到了一个解决方案 - 不是很漂亮,但它是一种解决方案。 基本上,在构建之前,我正在调用一个小应用程序来杀死将在构建期间构建的任何正在运行的进程。 一旦它们被杀死,该组件就不再在内存中运行,也不再对文件进行锁定。 正如我所说,这可能是一种更清洁的方式,我会继续寻找,但就目前而言,这应该足够了。 I think I've found a solution - not pretty, but it's one way around it. Basically, prior to the build, I ...
  • 1:否。通过使用cricital部分,您可以保证代码一次只能在一个线程中运行; 实际上,任何调用Enter的线程都会挂起 ,直到任何其他运行该代码的线程进入Leave调用。 但这并不意味着它将在主线程中运行(使用GetCurrentThreadID检查) 2:你提到公寓配置,但哪个公寓穿线模型? 这定义了(D)COM何时为您进行线程同步 。 在实践中,COM将使用代理存根和幕后编组来遍历公寓(和网络)边界,除非您选择了多线程公寓,在这种情况下COM将假设组件自己处理线程问题。 如果我理解正确,主表单会冻结' ...
  • 我读这篇文章的方式是DCOM / COM / OLE是在windows中构建OPC标准(由接口定义的互通对象作为方法组)的基础。 换句话说,由对象,接口和方法组成的OPC可以并且已经构建了DCOM,这是一种允许创建这些技术的Windows上的技术。 因此OPC可以用其他基板构建,但我不熟悉它是否已经存在。 对于非基于Windows的系统,我怀疑是的。 从这里开始 OPC是工业自动化和支持工业的企业系统的开放式连接。 通过创建和维护开放标准规范来确保互操作性。 目前已完成或正在开发七种标准规范。 特别: OP ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)