PHP Doku:: Returns the type of a statement - function.oci-statement-type.html

Verlauf / Chronik / History: (2) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDatenbankerweiterungenAnbieterspezifische DatenbankerweiterungenOracle OCI8OCI8 Funktionenoci_statement_type

Ein Service von Reinhard Neidl - Webprogrammierung.

OCI8 Funktionen

<<oci_set_prefetch

OCI8 - Veraltete Aliase und Funktionen>>

oci_statement_type

(PHP 5, PECL OCI8 >= 1.1.0)

oci_statement_typeReturns the type of a statement

Beschreibung

string oci_statement_type ( resource $statement )

Returns a keyword identifying the type of the OCI8 statement.

Parameter-Liste

statement

A valid OCI8 statement identifier from oci_parse().

Rückgabewerte

Returns the type of statement as one of the following strings.
Statement type
Return String Notes
ALTER  
BEGIN  
CALL Introduced in PHP 5.2.1 (PECL OCI8 1.2.3)
CREATE  
DECLARE  
DELETE  
DROP  
INSERT  
SELECT  
UPDATE  
UNKNOWN  

Returns FALSE on error.

Beispiele

Beispiel #1 oci_statement_type() example

<?php

$conn 
oci_connect('hr''welcome''localhost/XE');

$stid oci_parse($conn'DELETE FROM departments WHERE department_id = 130;');
if (
oci_statement_type($stid) == "DELETE") {
    
trigger_error('You are not allowed to delete from this table'E_USER_ERROR);
}
else {
    
oci_execute($stid);  // delete the row
}

oci_free_statement($stid);
oci_close($conn);

?>

Anmerkungen

Hinweis:

In PHP versions before 5.0.0 you must use ocistatementtype() instead. Der alte Funktionsname kann noch immer verwendet werden, dies ist jedoch veraltet und wird nicht empfohlen.


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)