downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

oci_field_name> <oci_fetch
[edit] Last updated: Fri, 10 Feb 2012

view this page in

oci_field_is_null

(PHP 5, PECL OCI8 >= 1.1.0)

oci_field_is_nullTest si la valeur d'une colonne Oracle est NULL

Description

bool oci_field_is_null ( resource $statement , mixed $field )

Vérifie si le champ field donné, depuis la requête statement est NULL.

Liste de paramètres

statement

Un identifiant de requête OCI valide.

field

Peut être un index de champ ou le nom d'un champ (en majuscule).

Valeurs de retour

Retourne TRUE si field vaut NULL, FALSE sinon.

Notes

Note:

Dans les versions de PHP antérieures à la version 5.0.0, vous devez utiliser la fonction ocicolumnisnull(). Cet ancien nom est toujours utilisable : un alias a été fait vers la fonction oci_field_is_null(), pour assurer la compatibilité ascendante. Toutefois, il est recommandé de ne plus l'utiliser.



add a note add a note User Contributed Notes oci_field_is_null
Raju Joseph [RajuJoseph at usa dot net] 14-Sep-2003 01:36
<?php

// Connect to Oracle database.

//        Username  : Raju
//        Password  : Password
//        Database  : Database_name

 
$conn=OCILogon("Raju", "Password", "DATABASE_NAME");
  if ( !
$conn ) {
    echo
"Unable to connect: " . var_dump( OCIError() );
    die();
  }

// Select Data...

// DESC[RIBE] COMPANY
  
//   CompanyID          VARCHAR2(10)
//   CompanyName      VARCHAR2(30)
//   LastUserID           VARCHAR2(15)
//   LastDate              DATE
//

  
 
$query = "SELECT * FROM Company";

 
$result = OCIParse($conn, $query);
 
OCIExecute($result, OCI_DEFAULT);

while (
OCIFetchInto ($result, $row, OCI_ASSOC)) {

// Usage of OCIcolumnisnull()
if (OCIcolumnisnull($result, 'CompanyName')) {

    print (
"<P>" . $row['CompanyID'] . "--->" . "Company Name NOT found !!  " . "<P>"  );
}
else {

    print (
"<P>" . $row['CompanyID'] . "--->" . $row['CompanyName'] . "<P>"  );
}
}

// Close connection from Oracle...

 
OCILogoff($conn);
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites