Home » Open Source » Programming Interfaces » return array from stored procedure using php
return array from stored procedure using php [message #125812] Wed, 29 June 2005 06:05
xtravel
Messages: 1
Registered: June 2005
Junior Member
i have a procedure like below;

PREBOOKING.CONTRACT_DATA(:INN, OUTT); --- the OUTT will be an array


when i pass below PL/SQL at SQLPLUS it works fine and displayout

DECLARE OUTT PREBOOKING.tt_contract_data; AAA VARCHAR(20); INN VARCHAR(20):= 1.1; begin PREBOOKING.CONTRACT_DATA(INN, OUTT); FOR I IN OUTT.FIRST .. OUTT.LAST
LOOP AAA := OUTT(I).des; DBMS_OUTPUT.PUT_LINE(AAA); END LOOP; end;


can anyone help me find out how i can do this with php, the php code i have now is;

<?php
  $c1=OCILogon("user", "pass", "db");
  if ( ! $c1 ) {
     echo "Unable to connect: " . var_dump( OCIError() );
     die();
  }
  
 	$IN = 1.1;
	$OUT=array();

				$stmt = OCIParse($c1, "DECLARE OUTT PREBOOKING.tt_contract_data; AAA VARCHAR(20); INN VARCHAR(20):= 1.1; begin PREBOOKING.CONTRACT_DATA(:INN, OUTT); FOR I IN OUTT.FIRST .. OUTT.LAST
LOOP :AAA := OUTT(I).des; DBMS_OUTPUT.PUT_LINE(AAA); END LOOP; end;");
					
					OCIBindByName($stmt, ':INN', $IN, 32);
					OCIBindByName($stmt, ':AAA', $OUT->, 300000);
		 
				OCIExecute($stmt, OCI_DEFAULT);


				OCICommit($c1);
				OCILogoff($c1);

   
?> 


can anyone help urgently
Previous Topic: PERL
Next Topic: connection with PHP
Goto Forum:
  


Current Time: Wed Oct 01 15:38:44 CDT 2014

Total time taken to generate the page: 0.09702 seconds