本文介绍了INFORMATIONIX中对Blob数据的操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何在blob数据类型的某些文本上使用子字符串,修剪,长度操作.以及如何使用查询更新blob数据类型的列?

How can we use substring, trim, length operations on some text of blob datatype. And how can we update a column of blob datatype using query?

谢谢

推荐答案

遇到困难!

首先,您要讨论4种不同类型的Blob中的哪一种:

First of all, which of the 4 various types of blob are you discussing:

  • BYTE
  • TEXT
  • BLOB
  • CLOB

它们成对出现(如Sith Lords):有二进制版本(BYTE,BLOB)和文本版本(TEXT,CLOB).还有另一对配对:旧的(BYTE,TEXT)和新的(BLOB,CLOB). BYTE和TEXT类型在1989年左右随Informix OnLine 4.00引入.BLOB和CLOB类型在1996年随Informix Universal Server 9.00引入,也称为SmartBlob.

These come in pairs (like Sith Lords): there is a binary version (BYTE, BLOB) and a text version (TEXT, CLOB). There's also another pairing: old (BYTE, TEXT) and newer (BLOB, CLOB). The BYTE and TEXT types were introduced with Informix OnLine 4.00 in about 1989. The BLOB and CLOB types were introduced with Informix Universal Server 9.00 in 1996, and are also known as SmartBlobs.

但是,从实际意义上讲,您指的是哪种类型都没有关系.

However, there's a very real sense in which it doesn't matter which of the types you are referring to.

几乎没有可以对BYTE和TEXT Blob执行的操作.可以获取和存储它们,但就所有实际目的而言,仅此而已.我相信您可以使用LENGTH来确定TEXT Blob的长度.我不认为有任何方法可以更新BYTE或TEXT blob的一部分;它是一个全有或全无的替代品.此外,替换来自适当类型的宿主变量-没有BYTE或TEXT文字.

There are very few operations that can be performed on BYTE and TEXT blobs. They can be fetched and stored, but for all practical purposes, that's all. I believe you can use LENGTH to determine the length of a TEXT blob. I don't believe there are any methods available to update part of BYTE or TEXT blob; it is an all-or-nothing replacement. Further, the replacement is from a host variable of the appropriate type - there are no BYTE or TEXT literals.

SmartBlobs的情况要好一些,但我不是专家.有一些机制可以获取LO(大对象)句柄,然后对其进行操作,但是我认为服务器(从SQL或SPL)不可用.我可能不愿意理解SmartBlob的可用功能,但我认为这些操作仅可通过编程API进行,而不能在SQL内进行.也没有BLOB或CLOB文字.但是,您可以使用SQL从服务器(或客户机)上的文件(FILETOBLOB,FILETOCLOB)加载并写入文件(LOTOFILE).

The situation is a bit better with SmartBlobs, but I'm not an expert on them. There are mechanisms for obtaining a LO (large object) handle and then manipulating that, but I don't think those are available server-side (from SQL or SPL). I may be willfully not understanding what's available with the SmartBlobs, but I think the operations are only available from programming APIs and not within SQL. There are no BLOB or CLOB literals either. However, you can use SQL to load from files (FILETOBLOB, FILETOCLOB) and write to files (LOTOFILE) - with the files either on the server or on the client.

这篇关于INFORMATIONIX中对Blob数据的操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 07:41