RE: blob error need help

2003-02-17 Thread Scott Purcell
Good. That worked. I do have 1.12 installed now and I verified via the ppm version 
check.

But when I run my original problem, it looks like nothing has changed. (I did get a 
new window before running this). 



C:\dbi_play\dbi>perl getblob
DBD::Oracle::st execute failed: ORA-00932: inconsistent datatypes (DBD: oexfet e
rror, e.g., can't select LOB fields using DBD::Oracle built for Oracle 7) at get
blob line 22.

C:\dbi_play\dbi>


Here is the describe
ppm> describe DBD-Oracle

Name: DBD-Oracle
 Version: 1.12
  Author: Tim Bunce ([EMAIL PROTECTED])
   Title: DBD-Oracle
Abstract: Oracle database driver for the DBI module
Location: ActiveState PPM2 Repository
Available Platforms:
   1. MSWin32-x86-multi-thread

ppm>


But my original script keeps dying (see above). 


#! perl -w

use DBI;

my $ref = {
PrintError => 0,
RaiseError => 1,
AutoCommit => 1};
my $max_len = 1024;
my $dbh = DBI->connect("dbi:Oracle:x", "", "", $ref);

$dbh->{LongReadLen} = $max_len;

$sth = $dbh->prepare(qq{select preview from preview where asset_id = 'EB0199'});
$sth->execute();







-Original Message-
From: Jenda Krynicky [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 3:45 PM
To: Scott Purcell; [EMAIL PROTECTED]
Subject: RE: blob error need help


From: "Scott Purcell" <[EMAIL PROTECTED]>
> I do not know how to rebuild DBD::Oracle against Oracle 8i libraries
> on my 2000 box. I do not think it is possible.
> 
> I used ppm3 and did a search on the dbd-oracle. The problem is two
> come up DBD-Oracle  [1.12] and DBD-Oracle [1.06] The problem is when
> you try and install, it does not let you select, so it keeps
> installing 1.06. Any more ideas?

The search returns something like

  1. DBD-Oracle  [1.06] ...
  2. DBD-Oracle  [1.12] ...

right? Just type

install 2

and press enter.

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery




RE: blob error need help

2003-02-17 Thread Scott Purcell
I do not know how to rebuild DBD::Oracle against Oracle 8i libraries on my 2000 box. I 
do not think it is possible.

I used ppm3 and did a search on the dbd-oracle. The problem is two come up DBD-Oracle  
[1.12] and DBD-Oracle [1.06] The problem is when you try and install, it does not let 
you select, so it keeps installing 1.06. Any more ideas?


Thanks,
Scott

-Original Message-
From: Sumitro Chowdhury [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 3:32 PM
To: Scott Purcell
Cc: [EMAIL PROTECTED]
Subject: Re: blob error need help


> > while (my $doc = $sth->fetchrow_array) {

I would replace $doc with @doc, and  as David suggested,
rebuild DBD::Oracle against Oracle 8i libraries

HTH,
Sumitro.


On 2003.02.17 15:04 Scott Purcell wrote:
> I am using ActiveState Perl Version v5.6.1 for MSWin32-x86 on my 2000 box.
> The dbd was downloaded from active state also.
> When I vi the Oracle.pm it says Version = 1.06
> 
> I am running the Oracle 8i tools on my PC.
> 
> Where should I go from here?
> 
> Thanks
> Scott
> 
> 
> -Original Message-
> From: David N Murray [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 17, 2003 3:00 PM
> To: Scott Purcell
> Cc: [EMAIL PROTECTED]
> Subject: Re: blob error need help
> 
> 
> My silly, off-the-cuff guess is that you need DBD built using OCI8
> libraries.  Did you build DBD yourself, or download a package?  Can you
> build it yourself (perl Makefile.PL; make; make test; make install)?  If
> you are using Oracle 8, then you have the right libraries to do the build.
> It looks like the error is saying that Oracle7 didn't support BLOBs.
> 
> HTH,
> Dave
> 
>  On Feb 17, Scott Purcell scribed:
> 
> > Hello,
> >
> > I have some (jpeg) blobs in oracle.

<--- snip --->



RE: blob error need help

2003-02-17 Thread Scott Purcell
I am using ActiveState Perl Version v5.6.1 for MSWin32-x86 on my 2000 box.
The dbd was downloaded from active state also. 
When I vi the Oracle.pm it says Version = 1.06

I am running the Oracle 8i tools on my PC.

Where should I go from here?

Thanks
Scott


-Original Message-
From: David N Murray [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 3:00 PM
To: Scott Purcell
Cc: [EMAIL PROTECTED]
Subject: Re: blob error need help


My silly, off-the-cuff guess is that you need DBD built using OCI8
libraries.  Did you build DBD yourself, or download a package?  Can you
build it yourself (perl Makefile.PL; make; make test; make install)?  If
you are using Oracle 8, then you have the right libraries to do the build.
It looks like the error is saying that Oracle7 didn't support BLOBs.

HTH,
Dave

 On Feb 17, Scott Purcell scribed:

> Hello,
>
> I have some (jpeg) blobs in oracle.
>
> table looks like this:
> asset_id   height   widthpreview
> varchar2   varchar2varchar2blob
>
>
> Ihave the programming DBI book here, but it does not cover this very well. I just 
>want to select a blob and write it to a file. No big deal.
>
> I have scoured the internet and found the following: But it chokes somehow? I can't 
>figure it out.
> ### error is as follows: PS we use oracle 8i.
> $ getblob
> DBD::Oracle::st execute failed: ORA-00932: inconsistent datatypes (DBD: oexfet e
> rror, e.g., can't select LOB fields using DBD::Oracle built for Oracle 7) at ./g
> etblob line 23.
>
> ###
>
> Thanks,
> Scott
>
>
> #
>
>
> #! perl -w
>
> use DBI;
>
> # binding parameters to statements.
> # binding, placeholders, etc. pseudonames
>
> my $ref = {
>   PrintError => 0,
>   RaiseError => 1,
> AutoCommit => 0};
>
> my $max_len = 200;
> my $dbh = DBI->connect("dbi:Oracle:xxx", "l", "xxx", $ref);
>
>
>
> $dbh->{LongReadLen} = $max_len;
>
> $sth = $dbh->prepare(qq{select preview from preview where asset_id = 'xxx'});
> $sth->execute();
> while (my $doc = $sth->fetchrow_array) {
> open (OUT, ">foo.jpg") or die $!;
> binmode(OUT);
> print OUT $doc;
> close(OUT);
> }
>
> $sth->finish;
> $dbh->disconnect;
>
>
>




blob error need help

2003-02-17 Thread Scott Purcell
Hello,

I have some (jpeg) blobs in oracle.

table looks like this:
asset_id   height   widthpreview
varchar2   varchar2varchar2blob


Ihave the programming DBI book here, but it does not cover this very well. I just want 
to select a blob and write it to a file. No big deal.

I have scoured the internet and found the following: But it chokes somehow? I can't 
figure it out.
### error is as follows: PS we use oracle 8i.
$ getblob
DBD::Oracle::st execute failed: ORA-00932: inconsistent datatypes (DBD: oexfet e
rror, e.g., can't select LOB fields using DBD::Oracle built for Oracle 7) at ./g
etblob line 23.

###

Thanks,
Scott


#


#! perl -w

use DBI;

# binding parameters to statements.
# binding, placeholders, etc. pseudonames

my $ref = {
PrintError => 0,
RaiseError => 1,
AutoCommit => 0};

my $max_len = 200;
my $dbh = DBI->connect("dbi:Oracle:xxx", "l", "xxx", $ref);



$dbh->{LongReadLen} = $max_len;

$sth = $dbh->prepare(qq{select preview from preview where asset_id = 'xxx'});
$sth->execute();
while (my $doc = $sth->fetchrow_array) {
open (OUT, ">foo.jpg") or die $!;
binmode(OUT);
print OUT $doc;
close(OUT);
}

$sth->finish;
$dbh->disconnect;