---
title: "oracle blob的插入转换成16进制"
author: "foolraty"
date: "2010-08-20T14:36:27Z"
tags: []
categories: ["数据库"]
slug: "oracle-blob-16"
draft: false
lastmod: "2010-09-16T15:04:08Z"
id: 743200
url: "https://foolraty.iteye.com/blog/743200"
---

update trkhdr set noteblob = '王' where id='asdf'

 出错: 无效的16进制数字

update trkhdr set noteblob = utl\_raw.cast\_to\_raw('王') where id='asdf'

 

插入空值是最好先插入 empty\_blob()

 

太长的内容..好像不支持

 

blob转换成 varchar ,并限制读取blob大小 (如果太长报错)

 

utl\_raw.cast\_to\_varchar2(dbms\_lob.substr(blob\_rec.col2,2000,1))#好像只能2000哦