Hello,
Can you tell how to use "oci_field_is_null" to test if the value of a column is NULL in Oracle if you can give me an example then in it will be good thank you in advance for your Suggestion
Hello,
Can you tell how to use "oci_field_is_null" to test if the value of a column is NULL in Oracle if you can give me an example then in it will be good thank you in advance for your Suggestion
Hello , Check this Example of oci_field_name()
PHP Code:
<?php
$conn = oci_connect("scott", "tiger");
$stmt = oci_parse($conn, "SELECT * FROM emp");
oci_execute($stmt);
echo "<table border=\"1\">";
echo "<tr>";
echo "<th>Name</th>";
echo "<th>Type</th>";
echo "<th>Length</th>";
echo "</tr>";
$ncols = oci_num_fields($stmt);
for ($i = 1; $i <= $ncols; $i++) {
$column_name = oci_field_name($stmt, $i);
$column_type = oci_field_type($stmt, $i);
$column_size = oci_field_size($stmt, $i);
echo "<tr>";
echo "<td>$column_name</td>";
echo "<td>$column_type</td>";
echo "<td>$column_size</td>";
echo "</tr>";
}
echo "</table>\n";
oci_free_statement($stmt);
oci_close($conn);
?>
oci_field_is_null (), the statement from the statement of the field if the field is NULL returns TRUE. Field parameters in the field number or field name (upper case) can be used.
Hello,
Here is a code to test the function oci_field_is_null for each result of the query on the column 'COLONNE_2', the script displays the contents, and indicates whether the field is null or not. I deliberately set names and table connection cans, but the script works.
Good luck,PHP Code:
<? php
$ bdd_access = "(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = myhost) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = Mysid )))";
$ connection = oci_connect ( "root", "root", $ bdd_access);
$ statement = oci_parse ($ connection, "SELECT * FROM MyTable");
oci_execute ($ statement, OCI_DEFAULT);
while (oci_fetch ($ statement)) (
echo $ connection. oci_result ($ statement, "COLONNE_2). "|". oci_field_is_null ($ statement, "COLONNE_2). "\ r \ n";
)
>
Bookmarks