title: ORA-24374: define not done before fetch or execute and fetch
body: <p>Is this kind of if statement valid? </p>
  
  <pre><code>if($result1 = oci_fetch_array($oms_query2) != null){}
  </code></pre>
  
  <p>It returns the error:</p>
  
  <blockquote>
    <p>Warning: oci_fetch_array() [function.oci-fetch-array]: ORA-24374: define not done 
    before fetch or execute and fetch</p>
  </blockquote>
  
  <p>Here's the code snippet:</p>
  
  <pre><code>$oms_query = oci_parse($conn_oms,"select * from R_VALIDATION order by query_id");
  oci_execute($oms_query);            
  while($row = oci_fetch_assoc($oms_query)) {
      extract($row);
      If ($ACTIVE=='Y') {
          $TOTAL++;
          $result = array();      
          $FIELD=explode(';',$FIELDS);
          $FIELD_COUNT=count($FIELD);
          $_SESSION[ 'field' ] = $FIELD;
          $_SESSION[ 'field_count' ] = $FIELD_COUNT;
          $testing = 0;
          $oms_query2 = oci_parse($conn_oms,$QUERY);
          oci_execute($oms_query2);   
          if($result1 = oci_fetch_array($oms_query2) != null) {
              var_dump($result1);
              $IMPACTED++;
              if($FIELD[0]!=null) {
                  $oms_query3 = oci_parse($conn_oms,$QUERY);
                  oci_execute($oms_query3); 
                  while($result = oci_fetch_array($oms_query3))
                      $testing++;
  
                  echo'&lt;tr&gt;&lt;td height="100%" bgcolor = "Linen" align="center" valign="middle"&gt;&lt;b&gt;'.$QUERY_ID.'&lt;/b&gt;&lt;/td&gt;&lt;td bgcolor = "Linen"&gt;&lt;b&gt;'.$QUERY_NAME.'&lt;/b&gt;&lt;/td&gt;&lt;td bgcolor = "Linen"&gt;&lt;b&gt;'.$QUERY_TYPE.'&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor = "Linen" align="center" valign="middle"&gt;&lt;b&gt;'.$testing.'&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;';            
              }
              oci_free_statement($oms_query2);
          }
      }
  }
  </code></pre>