Qore oracle Module  3.2
Oracle Functions

Functions

hash Qore::Oracle::bindInOut (any value, *string type)
 returns a value to be used to bind a Qore value as an "IN OUT" variable for PL/SQL More...
 
hash Qore::Oracle::bindOracleCollection (string tname, list values)
 returns a value to be used to bind a Qore value as an Oracle collection More...
 
hash Qore::Oracle::bindOracleObject (string tname, hash values)
 returns a value to be used to bind a Qore value as an Oracle object More...
 
hash Qore::Oracle::placeholderOracleCollection (string tname)
 returns a value to be used to describe a placeholder buffer for retrieving an Oracle collection as an output value More...
 
hash Qore::Oracle::placeholderOracleObject (string tname)
 returns a value to be used to describe a placeholder buffer for retrieving an Oracle object as an output value More...
 

Detailed Description

Function Documentation

hash Qore::Oracle::bindInOut ( any  value,
*string  type 
)

returns a value to be used to bind a Qore value as an "IN OUT" variable for PL/SQL

Code Flags:
CONSTANT
Parameters
valueany Qore variable
typean optional parameter to enforce the type of the variable. It is obtained automatically fromn the value when it is omitted.
Returns
a has which can be used for IN OUT binding. Keys:
  • "type" : a string type name of the variable (if it is provided as an argument)
  • "value" : a variable/value itself
Example:
my string $str = "lorem ipsum";
my int $i = 10;
my date $d = now();
my hash $res = $ds.exec("begin qore_test.do_simple_inout(:ostr, :oint, :odt); end;",
);
hash Qore::Oracle::bindOracleCollection ( string  tname,
list  values 
)

returns a value to be used to bind a Qore value as an Oracle collection

Code Flags:
CONSTANT
Parameters
tnamethe name of the Oracle collection type to bind
valuesa list of values for the collection
Returns
a hash value which can be used to bind the given value as the given collection in an SQL statement with the following keys:
  • "type": a constant string "OracleCollection"
  • "^oratype^": the value of the tname argument
  • "^values^": the value of the values argument
Example:
$db.exec("insert into object_table (obj) values (%v)", bindOracleObject("MY_OBJECT", $h));
hash Qore::Oracle::bindOracleObject ( string  tname,
hash  values 
)

returns a value to be used to bind a Qore value as an Oracle object

Code Flags:
CONSTANT
Parameters
tnamethe name of the Oracle type to bind
valuesa hash where the keys are Oracle object attributes
Returns
a hash value which can be used to bind the given value as the given object in an SQL statement with the following keys:
  • "type": a constant string "OracleObject"
  • "^oratype^": the value of the tname argument
  • "^values^": the value of the values argument
Example:
$db.exec("insert into object_table (obj) values (%v)", bindOracleObject("MY_OBJECT", $h));
hash Qore::Oracle::placeholderOracleCollection ( string  tname)

returns a value to be used to describe a placeholder buffer for retrieving an Oracle collection as an output value

Code Flags:
CONSTANT
Parameters
tnamethe name of the Oracle collection type to bind for the placeholder buffer
Returns
a hash value which can be used to describe an output placeholder buffer as a collection buffer of the given type in an SQL statement with the following keys:
  • "type": a constant string "OracleCollection"
  • "value": the value of the tname argument
Example:
my hash $h = $db.exec("begin my_pkg.get_collection(:retval); end;", placeholderOracleCollection("MY_COLLECTION")).retval;
hash Qore::Oracle::placeholderOracleObject ( string  tname)

returns a value to be used to describe a placeholder buffer for retrieving an Oracle object as an output value

Code Flags:
CONSTANT
Parameters
tnamethe name of the Oracle object type to bind for the placeholder buffer
Returns
a hash value which can be used to describe an output placeholder buffer as an object buffer of the given type in an SQL statement with the following keys:
  • "type": a constant string "OracleObject"
  • "value": the value of the tname argument
Example:
my hash $h = $db.exec("begin my_pkg.get_obj(:retval); end;", placeholderOracleObject("MY_OBJECT")).retval;