For PL/SQL 1)Create Directory Where BLOB resides. create or replace directory temp as '/oradata2'; -- if the directory name you created not qoted, then you can only use upper case to refer it. -- create or replace directory temp as 'xxxx', the temp d
CREATE OR REPLACE FUNCTION blob_to_clob (blob_in IN BLOB) RETURN CLOB AS v_clob CLOB; v_varchar VARCHAR2(32767); v_start PLS_INTEGER := 1; v_buffer PLS_INTEGER := 32767; BEGIN DBMS_LOB.CREATETEMPORARY(v_clob, TRUE); FOR i IN 1..CEIL(DBMS_LOB.GETLENGT
参照: Oracle存储过程中使用游标来批量解析CLOB字段里面的xml字符串 背景:在写存储过程时,需要获取表单提交的信息.表单信息是以xml格式的字符串存储在colb类型的字段dataxml中,如何获取呢?参考百度内容,写一个function(函数),参数有xml格式字符串(dataxml值)和指定节点(nodeName),返回指定节点的值(nodeValue). 编码实现: --get_xml_nodeValue实现 start CREATE OR REPLACE FUNCTION get
以下是oracle中Blob.Clob.Varchar之间的互相转换(都是百度找的,亲测可用) Blob转Varchar2: CREATE OR REPLACE FUNCTION blob_to_varchar (blob_in IN BLOB) RETURN VARCHAR2 IS v_varchar ); v_start PLS_INTEGER :; v_buffer PLS_INTEGER :; BEGIN --select userenv('LANGUAGE') into g_nls_d
oracle导出excel(非csv)的方法有两种,1.使用sqlplus spool,2.使用包体 现将网上相关代码整理后贴出以备不时之需: 使用sqlplus: 使用sqlplus需要两个文件:sql脚本文件和格式设置文件. 去除冗余信息,main.sql --main.sql 注意,需要在sqlplus下运行 非plsql命令行下 set markup html on entmap ON spool on preformat off spool test_tables.xls @get_