ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
MDB2_Driver_Function_oci8 Class Reference
+ Inheritance diagram for MDB2_Driver_Function_oci8:
+ Collaboration diagram for MDB2_Driver_Function_oci8:

Public Member Functions

executeStoredProc ($name, $params=null, $types=null, $result_class=true, $result_wrap_class=false)
 Execute a stored procedure and return any results. More...
 
 functionTable ()
 return string for internal table used when calling only a function More...
 
 now ($type='timestamp')
 Return string to call a variable with the current timestamp inside an SQL statement There are three special variables for current date and time: More...
 
 substring ($value, $position=1, $length=null)
 return string to call a function to get a substring inside an SQL statement More...
 
 random ()
 return string to call a function to get random value inside an SQL statement More...
 
 guid ()
 Returns global unique identifier. More...
 
- Public Member Functions inherited from MDB2_Driver_Function_Common
executeStoredProc ($name, $params=null, $types=null, $result_class=true, $result_wrap_class=false)
 Execute a stored procedure and return any results. More...
 
 functionTable ()
 return string for internal table used when calling only a function More...
 
 now ($type='timestamp')
 Return string to call a variable with the current timestamp inside an SQL statement There are three special variables for current date and time: More...
 
 substring ($value, $position=1, $length=null)
 return string to call a function to get a substring inside an SQL statement More...
 
 concat ($value1, $value2)
 Returns string to concatenate two or more string parameters. More...
 
 random ()
 return string to call a function to get random value inside an SQL statement More...
 
 lower ($expression)
 return string to call a function to lower the case of an expression More...
 
 upper ($expression)
 return string to call a function to upper the case of an expression More...
 
 guid ()
 Returns global unique identifier. More...
 
- Public Member Functions inherited from MDB2_Module_Common
 __construct ($db_index)
 Constructor. More...
 
 MDB2_Module_Common ($db_index)
 PHP 4 Constructor. More...
 
getDBInstance ()
 Get the instance of MDB2 associated with the module instance. More...
 

Additional Inherited Members

- Data Fields inherited from MDB2_Module_Common
 $db_index
 

Detailed Description

Definition at line 56 of file oci8.php.

Member Function Documentation

◆ executeStoredProc()

& MDB2_Driver_Function_oci8::executeStoredProc (   $name,
  $params = null,
  $types = null,
  $result_class = true,
  $result_wrap_class = false 
)

Execute a stored procedure and return any results.

Parameters
string$namestring that identifies the function to execute
mixed$paramsarray that contains the paramaters to pass the stored proc
mixed$typesarray that contains the types of the columns in the result set
mixed$result_classstring which specifies which result class to use
mixed$result_wrap_classstring which specifies which class to wrap results in
Returns
mixed a result handle or MDB2_OK on success, a MDB2 error on failure public

Definition at line 72 of file oci8.php.

References $params, $query, MDB2_Module_Common\getDBInstance(), and PEAR\isError().

73  {
74  $db =& $this->getDBInstance();
75  if (PEAR::isError($db)) {
76  return $db;
77  }
78 
79  $query = 'EXEC '.$name;
80  $query .= $params ? '('.implode(', ', $params).')' : '()';
81  return $db->query($query, $types, $result_class, $result_wrap_class);
82  }
$params
Definition: disable.php:11
$query
& getDBInstance()
Get the instance of MDB2 associated with the module instance.
Definition: MDB2.php:4244
isError($data, $code=null)
Tell whether a value is a PEAR error.
Definition: PEAR.php:280
+ Here is the call graph for this function:

◆ functionTable()

MDB2_Driver_Function_oci8::functionTable ( )

return string for internal table used when calling only a function

Returns
string for internal table used when calling only a function public

Definition at line 93 of file oci8.php.

94  {
95  return ' FROM dual';
96  }

◆ guid()

MDB2_Driver_Function_oci8::guid ( )

Returns global unique identifier.

Returns
string to get global unique identifier public

Definition at line 162 of file oci8.php.

163  {
164  return 'SYS_GUID()';
165  }

◆ now()

MDB2_Driver_Function_oci8::now (   $type = 'timestamp')

Return string to call a variable with the current timestamp inside an SQL statement There are three special variables for current date and time:

  • CURRENT_TIMESTAMP (date and time, TIMESTAMP type)
  • CURRENT_DATE (date, DATE type)
  • CURRENT_TIME (time, TIME type)
Returns
string to call a variable with the current timestamp public

Definition at line 111 of file oci8.php.

References $type.

112  {
113  switch ($type) {
114  case 'date':
115  case 'time':
116  case 'timestamp':
117  default:
118  return 'TO_CHAR(CURRENT_TIMESTAMP, \'YYYY-MM-DD HH24:MI:SS\')';
119  }
120  }
$type

◆ random()

MDB2_Driver_Function_oci8::random ( )

return string to call a function to get random value inside an SQL statement

Returns
return string to generate float between 0 and 1 public

Definition at line 148 of file oci8.php.

149  {
150  return 'dbms_random.value';
151  }

◆ substring()

MDB2_Driver_Function_oci8::substring (   $value,
  $position = 1,
  $length = null 
)

return string to call a function to get a substring inside an SQL statement

Returns
string to call a function to get a substring public

Definition at line 131 of file oci8.php.

132  {
133  if (!is_null($length)) {
134  return "SUBSTR($value, $position, $length)";
135  }
136  return "SUBSTR($value, $position)";
137  }

The documentation for this class was generated from the following file: