Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

  • 9 odgovora
  • 6.323 pregleda

Najnovija ↓

citanje BLOBa iz Oracle baze 17.05.2004. u 12:25 · pre 273 meseca #1
ima li neko primer za citanje BLOB podataka iz Oracle-a.
u principu blob je karakternog tipa(text file), i koji bi po pozivu (odredjenog file) bio ispisan CELI SADRZAJ (tog file-a).

thanx
Potpis
"there are things known and things unknown and in between are The Doors"
Re: citanje BLOBa iz Oracle baze 17.05.2004. u 15:35 · pre 273 meseca #2
probam sa:
fbsql_read_blob
ali imam problema sa konekcijom sa fbsql_pconnect:

$link = fbsql_pconnect ("localhost", "_SYSTEM", "mojpass")
or die ("Could not connect");

dobijam gresku:
Fatal error: Call to undefined function: fbsql_pconnect() in /usr/local/apache/htdocs/test.php on line 10

zna li neko u cemu je problem

Potpis
"there are things known and things unknown and in between are The Doors"
Re: citanje BLOBa iz Oracle baze 17.05.2004. u 15:58 · pre 273 meseca #4
Da li ti moze pomoci ovaj dio u kojem se radi o prikazivanju PDF datoteke:
Code:
$query = 'SELECT BLOBDATA FROM BTAB WHERE BLOBID = '.MYBLOBID;
 
  $stmt = OCIParse ($conn, $query);
  OCIExecute($stmt, OCI_DEFAULT);
  OCIFetchInto($stmt, $arr, OCI_ASSOC+OCI_RETURN_LOBS);
  $result = $arr['BLOBDATA'];
 
  // If any text (or whitespace!) is printed before this header is sent,
  // the text won't be displayed and the PDF won't be loaded correctly.
  // Comment out this line to see the text and debug such a problem.
  header("Content-Type: application/pdf");
  // http://www.php.net/header has some interesting comments on
  // sending a "Content-Disposition" header
  // It will force IE to give a "save" window instead of opening it.
  //header("Content-Disposition: attachment; filename=suggestedfilename.pdf");
  //header("Content-Length: " . strlen($result));
  echo $result;
 
  OCIFreeStatement($stmt);
 
  OCILogoff($conn);
Potpis
Blog - baze podataka
---------------------
Oracle OCP DBA (9i & 10g)
Oracle Database: SQL Certified Expert
Oracle OCP Developer
Certified MySQL DBA
Re: citanje BLOBa iz Oracle baze 17.05.2004. u 16:51 · pre 273 meseca #5
Citat:
selector:
...
dobijam gresku:
Fatal error: Call to undefined function: fbsql_pconnect() in /usr/local/apache/htdocs/test.php on line 10
...


Ako dobijas tu gresku prekompajliraj PHP sa podrskom za fbsq i to je to.
Potpis
tu nema kašike....
Re: citanje BLOBa iz Oracle baze 17.05.2004. u 17:06 · pre 273 meseca #6
hvala vam
probacu sa OCI-jem
nego StRiPy sta treba da bude $arr niz u ovom slucaju
$conn sam spremio.
Potpis
"there are things known and things unknown and in between are The Doors"
Re: citanje BLOBa iz Oracle baze 17.05.2004. u 17:27 · pre 273 meseca #7
$arr je array u koji spremas rezultate upita :) vidis da se koristi funkcija OCIFetchInto sto znaci "uzmi vrijednost i spremi ju u ...".
Potpis
Blog - baze podataka
---------------------
Oracle OCP DBA (9i & 10g)
Oracle Database: SQL Certified Expert
Oracle OCP Developer
Certified MySQL DBA
Re: citanje BLOBa iz Oracle baze 18.05.2004. u 11:26 · pre 273 meseca #8
totalno sam nov u php-u, ali zar nije trebalo da $arr bude negde pre definisano kao $stmt.

Potpis
"there are things known and things unknown and in between are The Doors"
Re: citanje BLOBa iz Oracle baze 18.05.2004. u 12:18 · pre 273 meseca #9
Ne, ne. $arr je niz u koji spremas rezultate pretrage. $stmt je parsovani izraz kojeg izvrsava Oracle server kao SQL komandu.
Potpis
Blog - baze podataka
---------------------
Oracle OCP DBA (9i & 10g)
Oracle Database: SQL Certified Expert
Oracle OCP Developer
Certified MySQL DBA
Re: citanje BLOBa iz Oracle baze 18.05.2004. u 15:16 · pre 273 meseca #10
fino sto nema deklarisanja kao u pl/sql-u. dobijao sam gresku zbog gluposti, stavio sam duple";"

nego cestitam, vidim da si postao OCP-welcome to the club
Potpis
"there are things known and things unknown and in between are The Doors"
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme