informix - 如何在informix 中创建具有BLOB 数据类型列的表?
问题描述
我将在一个带有 BLOB 数据类型列的 informix 数据库中创建一个表。它将保存一个图像数据。这是我的语法如下。
create table blob_test_db
(
col1 varchar(10),
img_bin BLOB in blob_dbspace
) extent size 32 next size 32 lock mode page;
根据我上面的语法,我想将我的img_bin
数据存储在blob_dbspace
dbspace 中。我想知道这可能吗?但是上面的语法是错误的。请告诉我将 blob 类型列添加到 informix 表的正确语法。
解决方案
Informix is tricky — it has two distinct families of 'large objects':
BYTE
andTEXT
— classic blobsBLOB
andCLOB
— smart blobs
It can store BYTE or TEXT blobs IN TABLE
or in a blob space (as opposed to a smart blob space or sbspace
). Except that you wrote BLOB instead of BYTE, the notation you used is correct for BYTE or TEXT blobs.
The notation for BLOB or CLOB blobs is different. You're allowed to list multiple sbspaces for a BLOB or CLOB column:
CREATE TABLE blob_test_db
(
col1 VARCHAR(10),
img_bin BLOB
) PUT img_bin IN blob_dbspace EXTENT SIZE 32 NEXT SIZE 32 LOCK MODE PAGE;
See the CREATE TABLE statement generally, and the PUT clause in particular.
推荐阅读
- java - ConcurrentHashMap.get() 迭代器
- php - 具有多个客户端和防止缓存踩踏的 PHP Web 服务的最佳方法
- python - 已安装 Conda 虚拟环境和软件包
- c - 为什么hiredis函数使用void*而不是redisReply*?
- javascript - 下载按钮在 Internet Explorer 上不起作用
- javascript - 有人可以解释npm依赖吗?
- ios - iOS 13 beta 外屏上的 OverscanCompensation
- python - Pig_Latin 大写
- azure - Gzip 解压缩不能作为流分析作业中的配置输入工作
- c# - 微软 Azure 人脸对比