MACROMEDIA COLFUSION MX 7-CFML Reference page 339

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

Output variables are stored in the ColdFusion variable specified by the
You cannot use the
tag.
cfprocresult
Example
The following example shows how to invoke an Oracle 8 PL/SQL stored procedure. It makes use
of Oracle 8 support of the Reference Cursor type.
The following package,
parameters as Reference Cursor:
Parameter
pParam1
Parameter
pParam2
The procedure declares one input parameter as an integer, and one output parameter as a two-
byte char varying type. Before the
compiled, and bound in the RDBMS environment.
CREATE OR REPLACE PACKAGE Foo_Data AS
TYPE EmpTyp IS REF CURSOR RETURN Emp%ROWTYPE;
TYPE DeptTyp IS REF CURSOR RETURN Dept%ROWTYPE;
PROCEDURE refcurproc(pParam1 in out EmpTyp, pParam2 in out DeptTyp,
pParam3 in integer, pParam4 out varchar2);
END foo_data;
CREATE OR REPLACE PACKAGE BODY Foo_Data AS
PROCEDURE RefCurProc(pParam1 in out EmpTyp,
pParam2 in out DeptTyp,
pParam3 in integer,
pParam4 out varchar2) IS
BEGIN
OPEN pParam1 FOR select * from emp;
OPEN pParam2 FOR select * from dept;
IF pParam3 = 1
THEN
pParam4 : = 'hello';
ELSE
pParam4 : = 'goodbye';
END IF;
END RefCurProc;
END Foo_Data;
The following CFML example shows how to invoke the
,
cfstoredproc
cfprocparam
<cfstoredproc
procedure = "foo_data.refcurproc"
dataSource = "oracle8i"
username = "scott"
password = "tiger"
returnCode = "No">
<cfprocparam type = "Out" CFSQLType = "CF_SQL_REFCURSOR"
variable = "param1">
<cfprocparam type = "Out" CFSQLType = "CF_SQL_REFCURSOR"
tag for Oracle 8 and 9 reference cursors. Instead, use the
cfprocparam
houses a procedure
Foo_Data,
returns the rows in the EMP table
returns the rows in the DEPT table
cfstoredproc
, and
cfprocresult
variable
that declares output
refcurproc
tag can call this procedure, it must be created,
procedure using
RefCurProc
:
attribute.
cfprocparam
339

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents