Home » Open Source » Programming Interfaces » php with Oracle BFILE (php5, oracle 10g)
icon5.gif  php with Oracle BFILE [message #352155] Mon, 06 October 2008 06:10 Go to next message
wasimhc
Messages: 8
Registered: September 2008
Junior Member
I want to try to implement the article of the following URL:
http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/fuecks_lobs.html

When I run http://localhost/login5/test_bfile_select.php, I get the following error:


Warning: oci_execute() [function.oci-execute]: ORA-06550: line 1, column 8: PLS-00103: Encountered the symbol "" when expecting one of the following: begin function package pragma procedure subtype type use <an identifier> <a double-quoted delimited-identifier> form current cursor in E:\Web\WebServer\Apache2\htdocs\login5\test_bfile_select.php on line 48
1: /


Code of test_bfile_select.php
-----------------------------
<?php
$conn = oci_connect('scott', 'tiger', '//localhost/orcl');

$sql = "SELECT
          id
        FROM
          mylobs
        WHERE
          -- Select only BFILES which are not null
          mybfile IS NOT NULL";

$stmt1 = oci_parse($conn, $sql);

oci_execute($stmt1)
    or die ("Unable to execute query\n");

$sql = "DECLARE
          locator BFILE;
          diralias VARCHAR2(30);
          filename VARCHAR2(30);
           
        BEGIN
          
          SELECT
            mybfile INTO locator
          FROM
            mylobs
          WHERE
            id = :id;
          
          -- Get the filename from the BFILE
          DBMS_LOB.FILEGETNAME(locator, diralias, filename);
          
          -- Assign OUT params to bind parameters
          :diralias:=diralias;
          :filename:=filename;
          
       END;";

$stmt2 = oci_parse($conn, $sql);

while ( $row = oci_fetch_assoc ($stmt1) ) {
    
    oci_bind_by_name($stmt2, ":id", $row['ID']);
    oci_bind_by_name ($stmt2, ":diralias", $diralias,30);
    oci_bind_by_name ($stmt2, ":filename", $filename,30);
    
    oci_execute($stmt2);
    print "{$row['ID']}: $diralias/$filename\n";
    
}
oci_close($conn);
?>

------------------
Regards,
Wasim
Re: php with Oracle BFILE [message #439262 is a reply to message #352155] Fri, 15 January 2010 07:49 Go to previous message
christ
Messages: 1
Registered: January 2010
Location: jogja
Junior Member

sry i'm new in oracle
can this script display the bfile
coz when i run this file just diplay

45: /

or can you help me where can i found script php to display video in bfile format??
thanks...
Previous Topic: jdbc thin client
Next Topic: ODBC Driver connectivity error
Goto Forum:
  


Current Time: Sat Dec 21 21:04:35 CST 2024