hi
i have problems reading an oracle(9i) clob from a php-script with the
MDB-class from pear.
the table files has 3 fields:
id integer
document clob
picture clob
an entry is written to the table with the following code :
require_once('. ....pear\MDB.ph p');
$mdb=&MDB::conn ect('oci8://user:pw@db');
...
$str_prepStat = 'INSERT INTO files VALUES (1,?,NULL)';
$preparedQuery = $mdb->prepareQuery($ str_prepStat);
if(!MDB::isErro r($preparedQuer y))
{
$clobData1 = array(
'Error'=>'',
'Data'=>'some lob data'
);
$clob1 = $mdb->createLob($clo bData1);
$mdb->setParamClob($ preparedQuery, 1, $clob1, 'document');
if(!MDB::isErro r($error = $mdb->executeQuery($ preparedQuery)) )
{
echo 'ok<br>';
$mdb->destroyLob($cl ob1);
}
else
{
echo $error->getMessage() ;
}
}
the entry definitly is in the table as i can see when i use sqlplus.
now all i would like to do is to read this content of this line back
into php, i use the following script, taken from the docs that come
with the MDB-bundle (slightly modified/echos inserted):
if(($result=$md b->query("SELEC T document FROM files WHERE id=1")))
{
if($mdb->endOfResult($r esult))
{
echo "No rows where returned.\n";
}
else
{
echo 'rows <br>';
$clob=$mdb->fetchClob($res ult,0,"document ");
if(!MDB::isErro r($clob))
{
echo '!MDB::isError( $clob) = true, $mdb->endOfLOB($clob ) :
'.$mdb->endOfLOB($clob ).'<br>';
while(!$mdb->endOfLOB($clob ))
{
echo ' t<br>';
if(MDB::isError ($error = $mdb->readLob($clob, $data,8000)<0))
{
echo $error->getMessage() ;
break;
}
else
{
echo 'error in readlob';
}
echo $data;
}
$mdb->destroyLob($cl ob);
}
else
{
echo '!MDB::isError( $clob) = false<br>';
echo 'error in clob<br>';
echo $clob->getMessage() ;
}
}
$mdb->freeResult($re sult);
}
else
{
echo $result->getMessage() ;
}
when executed the message is :error in readlob, which i have no
explanation for?
has anyone had similar problems and/or can help me ? 0 2628 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Dan |
last post by:
Is there any reason to use Pear:db if using odbc? I am thinking that
odbc already provides enough abstraction.
TIA,
Dan
|
by: RDahlstedt |
last post by:
I am relatively new to PHP, but with over a decade of experience in C
and other programming languages I can usually pick up a new
programming language relatively quickly (to be reasonably productive
not to know it inside out). My issues I believe may be either solely
concentrated on the platform I am running PHP 5.0.0 on (MS Windows
2000) or just the Oracle OCI8 module (running against an Oracle
8.1.7.4 installation). In either case I am...
|
by: David |
last post by:
Hello all,
I have been trying to use the OCI driver to connect to Oracle 9i, but
have been getting the following error:
java.sql.SQLException: Closed Connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2364)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:480)
|
by: Keith E. Sauvant |
last post by:
Hi,
we got a strange problem connecting to an Oracle database onsite with
our PHP application: During CSV import job handled by our application,
PHP opens up to some hundred connections to the database. It then
eventually fails to connect to the database due to the high number of
open connections.
We are not able to reproduce this behaviour on our internal
installations, we get up to 30 connections until the job is finished.
|
by: sam.lumbroso |
last post by:
I have the following object type created in Oracle (OCI8):
create or replace type address as object
(
address VARCHAR2(80),
city VARCHAR2(80),
state VARCHAR2(20),
zip VARCHAR2(10)
)
| |
by: John Nagle |
last post by:
I'm looking for something that can read .MDB files, the format
Microsoft Access uses, from Python. I need to do this on
Linux, without using Microsoft tools. I just need to read
the files once, so I can load the tables into another database.
Speed isn't an issue, and I don't need to access the file in
database fashion. The files are too big to read into RAM all at once,
though.
I tried "MDBtools", but the only (last) release was
a...
|
by: Yannick |
last post by:
Hi,
I'm Julien from France,
We have recently install a new Web Server for my company
The server is composed :
- Linux RedHat RHEL4 U4
- Httpd-2.0.52-27.ent
- Oracle Database 10.2.0.1
|
by: JS |
last post by:
Hi.
I am writing a c++ program get the data from mdb file using odbc
library.
By the way, I couldn't get table list from mdb file.
i goolgled it up little bit, what i found is only using the ADO(or OLE
i'm not sure) library and
"SELECT Name FROM MSysObjects WHERE Type In (1,4,6) AND Left(,
4)<>"MSYS" this query.
i already wrote a lot of part of this program so i don't want to
|
by: =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= |
last post by:
I've been evaluating the possibility of modifying an existing web app
with Oracle backend to use the OCI8 functions rather than ODBC. I was
attracted by some specific functionalities (specifying the DB charset on
connect, LOB handling...) and I also wanted to test whether there was
any performance improvement.
I've soon noticed that the OCI API returns numeric values as
locale-formatted strings; e.g., 3.14 becomes "3,14". According to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |