Results 1 to 4 of 4

Thread: Testing Null Field (oci_field_is_null)

  1. #1
    Join Date
    Oct 2008
    Posts
    75

    Testing Null Field (oci_field_is_null)

    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

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Testing Null Field (oci_field_is_null)

    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);
    ?>

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    Re: Testing Null Field (oci_field_is_null)

    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.

  4. #4
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Testing Null Field (oci_field_is_null)

    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.

    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 ($ statementOCI_DEFAULT); 

    while (
    oci_fetch ($ statement)) ( 
    echo $ 
    connectionoci_result ($ statement"COLONNE_2). "|". oci_field_is_null ($ statement, "COLONNE_2). "\ r \ n"


    >
    Good luck,

Similar Threads

  1. Need some good testing utility for software testing
    By Madri in forum Software Development
    Replies: 6
    Last Post: 12-07-2012, 06:28 PM
  2. Replies: 7
    Last Post: 18-10-2011, 01:05 AM
  3. Multi Field value field in Microsoft Access
    By Erubiel in forum Windows Software
    Replies: 3
    Last Post: 20-11-2009, 12:55 AM
  4. What is null value?
    By Swati in forum Software Development
    Replies: 3
    Last Post: 14-02-2009, 04:39 PM
  5. Software Testing Information, Software Testing
    By Bhusan in forum Education Career and Job Discussions
    Replies: 4
    Last Post: 01-09-2008, 07:16 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,600,131.91605 seconds with 16 queries