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

search for in the

oci_field_name> <oci_fetch
[edit] Last updated: Fri, 17 May 2013

view this page in

oci_field_is_null

(PHP 5, PECL OCI8 >= 1.1.0)

oci_field_is_nullComprueba si el campo es NULL

Descripción

bool oci_field_is_null ( resource $statement , mixed $field )

Comprueba si el campo especificado por field de la sentencia dada por statement es NULL.

Parámetros

statement

Un identificador de sentencia de OCI válido.

field

Puede ser un índice de campo o un nombre de campo (en mayúsculas).

Valores devueltos

Devuelve TRUE si field es NULL, FALSE si no.

Notas

Nota:

En versiones de PHP anteriores a la 5.0.0 se debe usar ocicolumnisnull() en su lugar. Este nombre aún se puede usar; se dejó como un alias de oci_field_is_null() por razones de retrocompatibilidad. Sin embargo, este nombre es obsoleto y no se recomienda.



add a note add a note User Contributed Notes oci_field_is_null - [1 notes]
up
0
Raju Joseph [RajuJoseph at usa dot net]
9 years ago
<?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