oci_statement_type
(PHP 5, PHP 7, PHP 8, PECL OCI8 >= 1.1.0)
oci_statement_type — statement의 유형을 반환합니다.
설명
oci_statement_type(resource $statement
): string|false
OCI8 statement
의 유형을 식별하는 키워드를 반환합니다.
매개변수
statement
- oci_parse()의 유효한 OCI8 statement 식별자.
반환 값
statement
의 유형을 다음 문자열 중 하나로 반환합니다.
Statement 유형
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 |
오류가 발생하면 false
를 반환합니다.
Examples
예제 #1 oci_statement_type() 예제
<?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);
?>