长度为>的CLOB中的Oracle软件包. 32767个字符.如何“立即执行"?它? [英] Oracle Package inside a CLOB with length > 32767 characters. How to "execute immediate" it?
问题描述
请假设我在表ALPHA内的CLOB类型的BETA列中有一个包创建脚本. CLOB长度> 32767个字符.
Please suppose that I have a package creation script stored inside a table ALPHA, in a column BETA of type CLOB. The CLOB length is > 32767 characters.
我想使用PL/SQL代码立即执行"程序包创建脚本.
Using PL/SQL code, I would like to "execute immediate" the package creation script.
我可以实现吗?
在此先感谢您的帮助.
我正在使用Oracle 10G
推荐答案
execute immediate
didn't support CLOBs until 11gR2. You can use DMBS_SQL
to handle larger statements. In earlier versions you could build up the statement, but 11g allows you to parse a CLOB.
有一个示例此处.
动态创建程序包似乎是一个奇怪的要求.
Creating a package dynamically seems like an odd requirement though.
Since you're on 10g, you will need to use the version of DBMS_SQL.PARSE that lets you build up large statements:
对于大型SQL,PARSE过程还支持以下语法 声明:
The PARSE procedure also supports the following syntax for large SQL statements:
DBMS_SQL.PARSE (
c IN INTEGER,
statement IN VARCHAR2S,
lb IN INTEGER,
ub IN INTEGER,
lfflg IN BOOLEAN,
language_flag IN INTEGER);
注意:该过程将PL/SQL表语句的元素连接在一起 并解析结果字符串.您可以使用此过程来解析 语句长于单个VARCHAR2变量的限制 通过拆分语句.
Note: The procedure concatenates elements of a PL/SQL table statement and parses the resulting string. You can use this procedure to parse a statement that is longer than the limit for a single VARCHAR2 variable by splitting up the statement.
这篇关于长度为>的CLOB中的Oracle软件包. 32767个字符.如何“立即执行"?它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!