开发工具:
文件大小: 83kb
下载次数: 0
上传时间: 2019-03-17
详细说明:NULL
博文链接:https://hwhuang.iteye.com/blog/554177二一
RULES AND LIMITATIONS
Bind variables of a SQL statement are identified by their names.
When binding a value to a hind variable, the string identifying
the bind variable in the statement may optionally contain the
eading colon. For example, if the parsed sQl statement is
SELECT ENAME FROM EMP WHERE SAL > X", on binding the variable
to a value, it can be identified using either of the strings: X
and X
Columns of the row being selected in a select statement are identified
by their relative positions (1, 2, 3,.)as they appear on the select
list from left to right.
Privileges are associated with the caller of the procedures/functions
in this package as follows
If the caller is an anonymous PL/SQL block, the procedures/ functions
are run using the privileges of the current user.
If the caller is a stored procedure, the procedures/ functions are run
using the privileges of the owner of the stored procedure
WARNING: Using the package to dynamically execute DDL statements can
results in the program hanging For example, a call to a procedure in a
- package will result in the package being locked until the execution
returns to the user side. Any operation that results in a conflicting
lock, such as dynamically trying to drop the package, before the first
lock is released will result in a hang
The flow of procedure calls will typically look like this
open cursor
parse
bind variabl
yes
no
execute
define column
able value
execute
etch rows
column valuc
I close cursor I
CONSTANTS
v6 constant integer =0
native constant integer I
v7 cOnstant integer: =2
TYPES
type varchar2a is table of varchar 2(32767) index by binary integer
bug 2410688: for users who require larger than varchar2(256)
this type has been introduced together with parse overloads
hat take this type.
type varchar2s is table of varchar2(256) index by binary integer
Note that with the introduction of varchar 2a we will deprecate
this type, with phase out over a number of releases.
For DateTime types, the field col scale is used to denote the
fractional seconds precision.
For Interval types, the field col precision is used to denote
the leading field precision and the field col scale is used to
denote the fractional seconds precision.
type desc rec is record
binary integer =0
col max len
binary integer: =0
CoI name
varchar
col name len
binary integer =0
col schema name
archar2(32) .=,,
col schema name len binary integer: =0
col precision
binary integer :0
col scale
binary integer =0
col charsets
binary integer =0,
col charsetform
binary integer :=0
col null ok
ocean
TRUE
type desc tab is table of desc rec index by binary integer
bug 702903 reveals that col name can be of any length, not just 32 which
can be resolved by changing the maximum size above from 32 to 32767.
However, this will affect the signature of the package and to avoid that
side effect, the current APl describe columns is left unchanged but a new
Pi describe columns is added at the end of this package specification
he new APi relies on a table type desc tab2 whose array element is a new
record type desc rec2, and desc rec2 contains the variable col name with a
- maximum size of 32.767.
If the original api describe co lumns is used and col name encounters an
overflow, an error will be raised
type desc rec2 is record
col type
binary integer : 0,
col max len
binary integer =0,
col name
archar2(32767):=
co name en
binary integer:=0
col schema name varchar2 (32)
col schema name len binary integer =0,
col precision
binary integer -0
co scale
binary integer =0
col charsetid
binary integer :=0
col charsetform
binary integer :0
col null ok
boolean
TRUE)
type desc tab2 is table of desc rec 2 index by binary integer
Bulk sql types
type Number table is table of number
Index by binary integer
type Varchar2 Table is table of varchar2(2000) index by binary integer
type date Table is table of date
index by binary integer
type blob table
is table of blob
index by binary integer
type Clob Table
is table of clob
index by binary integer
type bfile table is table of bfile
ndex by binary integer
TYPE Urowid Table Is table Of urowid
INdEX BY binary integer
TYPE time table
IS tabLe oF time unconstrained
NDEⅩBY
binary integer
TYPe timestamp table Is table or timestamp unconstrained
INDEX BY
binary integer
TYPe time with time zone Tablc IS TABLE OF TIME TZ UNCONSTRAINED INDEX BY
binary integer
tYPe timestamp with time zone table Is table oF
TIMESTAMP TZ UNCONSTRAINED INDEX BY binary integer
TYPE timestamp with ltz Table Is TABLE OF
TIMESTAMP LTZ UNCONSTRAiNED INDEX BY binary integer
TYPE interval year to MONTII Table Is TAble or
yminterval unconstrained INdeX BY binary integer
TYPE interval day to second table is table of
dsinterval unconstrained INDEX BY binary integer
type binary float Table is table of binary float index by binary integer
type binary double table is table of binary double index by binary integer
type Cfile table is table of cfile
index by binary integer
EXCEPTIONS
Inconsistent type exception
pragma exception init(inconsistent type, -6562)
This exception is raised by procedure column value or
variable value if the type of the given out argument where
to put the requested value is di fferent from the type of the value
PROCEDURES AND FUNCTIONS
function open cursor return integer
pragma restrict references(open cursor, RNDS, WNDS)
Open a new cursor.
When no longer needed, this cursor must be closed explicitly by
Iling "close cursor
Return value
Cursor id number of the new cursor
function is open(c in integer) return boolean
pragma restrict references(is open, RNDS, WNDS)
Return true is the given cursor is currently open
Input parameters
Cursor id number of the cursor to check
Return value
TRUE if the given cursor is open,
tALSE if it is not
procedure close cursor(c in out integer)
pragma restrict references(close cursor, RNDS, WNDS)
Close the given cursor.
Input parameters
Cursor id number of the cursor to close
Output parameters
Will be nulled
procedure parse(c in integer, statement in varchar2
language flag in integer)
Parse the given statement in the given cursor. NOTE THAT PARSING AND
- EXECUTING DDL STATEMENTS CAN CALSE HANGS
Currently, the deferred parsing feature of the Oracle Call Interface
is not used. As a result, statements are parsed immediately. In addition
DDL statements are executed immediately when parsed. However,
the behavior may
change in the future so that the actual parsing (and execution of DDL
statement) do not occur until the cursor is executed with execute
DO NOT RELY ON THE CURRENT TIMING OF THE ACTUAL PARSING
Input parameters:
Cursor id number of the cursor in where to parse the statement
statement
Statement to parse.
language flag
Specifies behavior for statement. Valid values are v6, v7 and NATIVE
v6 and v7 specifies behavior according to Version 6 and ORACLE7,
respectively. NATiVe specifies behavior according to the version
of the database the program is connected to.
procedure parse(c in integer, statement in varchar2a
Ib in integer, ub in integer
lfflg in boolean, language flag in integer)
Description:(copied from parse for varchar2s)
Parse the given statement in the given cursor. The statement is not in
one piece but resides in little pieces in the PL/SQL table statement
Conceptually what happens is that the SQL string is put together as
follows
String: statement(1b) statement(1b+ 1)
statement (ub)
Then a regular parse follows.
If lfflg is true then a newline is inserted after each piece
For further information and for documentation on the rest of the
arguments see the regular parse procedure below.
procedure parse(c in integer, statement in varchar2
Ib in integer, ub in integer
Ifflg in boolean, language flag in integer)
Parse the given statement in the given cursor. The statement is not in
one piece but resides in little piccos in the PL /SQL table statement
Conceptually what happens is that the SQL string is put together as
follows
String: statement(1b) statement(1b+1)
statement(ub)
Then a regular parse follows.
If"lfflg is true then a newline is inserted after cach piece
For further information and for documentation on the rest of the
arguments see the regular parse procedure below.
procedure bind variable(c in integer, name in varchar2, value in number)
pragma restrict references(bind variable, WNDS
procedure bind variable(c in integer, name in varchar2,
value in varchar2 character set any cs)
pragma restrict references (bind variable, WNDS)
procedure bind variable(c in integer, name in varchar2
value in varchar2 character set any Cs
It value size in integer)
pragma restrict references(bind variable, WNDS)
procedure bind variable(c in integer, name in varchar2, value in date)
pragma restrict references(bind variable, WNDS)
procedure bind variable(c in integer, name in varchar2, value in blob
pragma restrict references (bind variable, WNDS)
procedure bind variable(c in integer, name in varchar 2,
value in clob character set any cs)
pragma restrict references(bind variable, WNDS
procedure bind variable(c in integer, name in varchar2, value in bfile
pragma restrict references (bind variable, WNDS
procedure bind variable char(c in integer, name in varchar2
lue in char character set any cs)
pragma restrict references(bind variable char, WNDS)
procedure bind variable char(c in integer, name in varchar2
value in char character set any cs,
out value size in integer)
pragma restrict references(bind variable char, WNDS
procedure bind variable raw(c in integer, name in varchar2
value in raw)
gma restrict references(bind variable raw, WNDS)
procedure bind variable raw(c in integer, name in varchar 2
value in raw, out value size in integer)
pragma restrict references (bind variable raw, WNDS)
procedure bind variable rowid(c in integer, name in varchar2
value in rowid)
pragma restrict references(bind variable rowid, WNDS)
procedure bind array(c in integer, name in varchar2
n tab in Number Table)
pragma restrict references (bind array, WNDS)
procedure bind array(c in integer, name in varchar2
c tab in Varchar2 Table)
pragma restrict references(bind array, WNDS)
procedure bind array(c in integer, name in varchar2
d tab in Date Table
pragma restrict references(bind array, WNDS
procedure bind array(c in integer, name in varchar2
b1 tab in Blob Table)
pragma restrict references(bind array, WNDS
procedure bind array(c in integer, name in varchar2
cl tab in Clob Table
pragma restrict references(bind array, WNDS
procedure bind array(c in integer, name in varchar2
bf tab in Bfile Table)
pragma restrict references(bind array, WNDS)
procedure bind array(c in integer, name in varchar2
n tab in Number Table
index in integer, index 2 in integer
pragma restrict references(bind array, WNDS
procedure bind array(c in integer, name in varchar2
c tab in varchar2 tabl
dexi in integer
dex2 in integer);
pragma restrict references (bind array, WNDS)
procedure bind array(c in integer, name in varchar2
d tab in date Table
index1 in integer, index2 in integer)
pragma restrict references(bind array, WNDS
procedure bind array(c in integer, name in varchar2
bl tab in blob table
indexl in integer, index2 in integer
pragma restrict references(bind array, WNDS)
procedure bind array(c in integer, name in varchar2
cl tab in Clob Table
index1 in integer, index2 in integer)
pragma restrict references (bind array, WNDS
procedure bind array(c in integer, name in varchar2
bf tab in Bfile Table,
index in integer, index2 in integer)
pragma restrict references (bind array, WNDS
Bind the given value to the variable identified by its name
in the parsed statement in the given cursor.
If the variable is an in or in/out variable, the given bind value
should be a valid one. If the variable is an out variable, the
given bind value is ignored
Input parameters
Cursor id number of the cursor to bind
name
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.