Jump to content

Recommended Posts

I am having trouble trying to get this query to work... what is wrong?

 

SELECT ACTION_CODE ACTION_CODE,ACTION_LEVEL ACTION_LEVEL,ACTION_MASTER ACTION_MASTER FROM ( SELECT alias.ACTION_CODE,alias.ACTION_LEVEL,alias.ACTION_MASTER, rownum r FROM ( SELECT ACTION_CODE,ACTION_LEVEL,ACTION_MASTER FROM ACTION_CODES ORDER BY ACTION_CODE ) alias WHERE rownum <= ? ) WHERE r > ?

 

Warning: ociexecute() [function.ociexecute]: ORA-00911: invalid character in /usr/local/apache2/htdocs/robtest/feed26.php on line 808

0 - CHECK

Results

 

Warning: oci_fetch_array() [function.oci-fetch-array]: ORA-24374: define not done before fetch or execute and fetch in /usr/local/apache2/htdocs/robtest/feed26.php on line 828

 

Warning: oci_fetch_array() [function.oci-fetch-array]: ORA-24374: define not done before fetch or execute and fetch in /usr/local/apache2/htdocs/robtest/feed26.php on line 844

has this value

 

 

here is the code... please reply back soon.

 

 




		if($dbs[0][1]=="EBS" || $dbs[0][1]=="HRMS")
		{							
			$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 <= ? )"; // $recs_page
			$sql .= " WHERE r > ?";                 // $recs_start		
		}	
		elseif ($dbs[0][1]=="CELCAT")
		{
			$sql  = "SELECT $flds_b";
			$sql .= " FROM (SELECT TOP ? $flds_a"; // $recs_page
			$sql .= " FROM (SELECT TOP ? $flds";   // $recs_end
			$sql .= " FROM $k";
			$sql .= " ORDER BY $indxflds_ord"; 

			//if scalar @idx_key > 0;
			$sql .= ") AS A";
			$sql .= " ORDER BY $indxflds_a" ;

			//if scalar @idx_key > 0;
			$sql .= ") AS B";
			$sql .= " ORDER BY $indxflds_b"; 
			//if scalar @idx_key > 0;
		}	

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

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


					//$sql="SELECT * FROM $k LIMIT 0,3"; //currently limiting data results...


							$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 ($row = oci_fetch_array ($numr, OCI_BOTH)) {
   echo $row[0]." and ".$row['ID']." is the same<br>";
   echo $row[1]." and ".$row['NAME']." is the same<br>";
}          
            
            
            
            
            
            
            
            
            
            
            					
								//FETCH RESULTS FROM FOREIGN DATABASE!	
								while ($row = oci_fetch_array($numr, OCI_BOTH))
								{
									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);	
								}		

								echo''.$row.' has this value';

Link to comment
https://forums.phpfreaks.com/topic/102109-major-problems-with-oracle-please-help/
Share on other sites

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.