Jump to content

Unable to retrieve results - need some help with OCI8


Recommended Posts

I'm trying to query and fetch some results from an Oracle database...

 




		$VAR=1; //test

		if($dbs[0][1]=="EBS")
		{							
			$sql  = "SELECT $fldso";
			$sql .= " FROM ( SELECT $alias_flds, rownum r";
			$sql .= " FROM ( SELECT $flds_b";
			$sql .= " FROM $k";
			$sql .= " ORDER BY $indxflds"; 

			//if scalar @idx_key > 0;
			$sql .= " ) alias WHERE rownum <= $VAR )"; // $recs_page
			$sql .= " WHERE r > $VAR";                 // $recs_start
		}	

		echo'<p><b>SELECTION SQL FOR GRABBING DATA</b></p>';
		echo'<p>'.$sql.'</p>';

		unset($fldso);
		unset($alias_flds);			
		unset($flds_b);
		unset($indxflds);		



							$numr=ociparse($c,$sql);
							ociexecute($numr);

							$check_num_records = ocinumcols($numr);

							echo''.$check_num_records.' - CHECK';
							//pull out the number of records.

							echo'<br/>Results<br/>';

							//if($check_num_records==0)
							//{
							//	echo'Currently, there is nothing in '.$k.'.',"\n";
							//}
							//else
						//	{			



while($arrayBlob = oci_fetch($numr))
{
echo'test MAINS';
echo $arrayBlob['CONTRACT_FILE']->load();
}

OCISetPrefetch($numr, 100);
while ($succ = OCIFetchInto($numr, $row)) 
{
  foreach ($row as $item) {
    echo $item." ";
  }
  echo "<br>\n";
}





								while ($row = ocifetchstatement($numr, &$arr))
								{
									echo'BIG TEST WOOOOOO HOOO '.$row[0].'<br/>';
									echo'BIG TEST WOOOOOO HOOO '.$arr[0].'<br/>';

									if($sql_mode==1)
									{
										$real_results[$m]= $row; //place ONLY SQL mode 1 results from table into array
									}



									for($i=0;$i<=$n-1;$i++)
									{
										$trv.="'$row[$i]', ";  // a,b,c, - this makes a string with the results for each coloumn it finds... col1, col2, col3,
									}
									$trv =substr($trv,0,-2); //remove the comma from the last variable
									$trv = "($trv)";	// (a,b,c) - these results are placed into this format then put into an array.
									$mass_result[] = $trv;	
									unset($trv);	
								}		

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.