Getting spatial data?
am 22.06.2006 19:54:04 von todd.chisholm
------=_Part_3075_3075376.1150998844826
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi all,
I'm trying to get some sdo data, but running into trouble. The program
snippet:
my $connect = DBI->connect( "dbi:Oracle:****",
'****',
'****',
) || die "No connect";
#my $query = "select update_date from processed_product where id=15601";
my $query = "select geometry from processed_product where id=15601";
my $sth = $connect->prepare($query);
$sth->execute();
The result:
DBD::Oracle::db prepare failed: ERROR OCIDefineObject call needed but not
implemented yet [for Statement "select geometry from processed_product where
id=15601"] at /home/corp14/tchishol/oracleTst.pl line 11.
Can't call method "execute" on an undefined value at ...oracleTst.pl line
12.
The 'geometry' type is sdo_geometry. Anyone had luck working with this type
of data?
Thanks,
Todd
------=_Part_3075_3075376.1150998844826--
RE: Getting spatial data?
am 22.06.2006 20:07:56 von Philip.Garrett
-----Original Message-----
From: Todd Chisholm
Sent: Thursday, June 22, 2006 1:54 PM
Subject: Getting spatial data?
>
> my $query =3D "select geometry from processed_product where =
id=3D15601";
> my $sth =3D $connect->prepare($query);
> $sth->execute();
>
[snip]
>=20
> DBD::Oracle::db prepare failed: ERROR OCIDefineObject call needed but
not
> implemented yet [for Statement "select geometry from processed_product
where
> id=3D15601"] at /home/corp14/tchishol/oracleTst.pl line 11.
You can't use native PL/SQL object types directly in Perl. You'll have
to select just the properties you need in the select clause, like:
select geometry.get_dims() from processed_product where id=3D15601
> Can't call method "execute" on an undefined value at ...oracleTst.pl
line
> 12.
Just nit picking here, but don't forget "|| die $connect->errstr"
after your prepare statement.
Philip
Re: Getting spatial data?
am 22.06.2006 20:39:33 von scoles
Tricky one.
The sdo_geometry is a very Oracle specific binary field as DBI and
DBD::Oracle basically default of strings so the program dies.
You may want to define the field as an "ora_type => ORA_CLOB" or "ORA_BLOB"
and get it that way.
If may work.
I might have write a patch for it and treat it as a BLOB. (Tomorrow is my
DBD::Oracle day so I may get to look at it)
cheers John Scoles
----- Original Message -----
From: "Todd Chisholm"
To:
Sent: Thursday, June 22, 2006 1:54 PM
Subject: Getting spatial data?
> Hi all,
>
> I'm trying to get some sdo data, but running into trouble. The program
> snippet:
>
> my $connect = DBI->connect( "dbi:Oracle:****",
> '****',
> '****',
> ) || die "No connect";
> #my $query = "select update_date from processed_product where id=15601";
> my $query = "select geometry from processed_product where id=15601";
> my $sth = $connect->prepare($query);
> $sth->execute();
>
>
> The result:
>
> DBD::Oracle::db prepare failed: ERROR OCIDefineObject call needed but not
> implemented yet [for Statement "select geometry from processed_product
where
> id=15601"] at /home/corp14/tchishol/oracleTst.pl line 11.
> Can't call method "execute" on an undefined value at ...oracleTst.pl line
> 12.
>
> The 'geometry' type is sdo_geometry. Anyone had luck working with this
type
> of data?
>
> Thanks,
> Todd
>
Re: Getting spatial data?
am 22.06.2006 23:32:38 von todd.chisholm
------=_Part_5476_6804825.1151011958968
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Great, thanks for your help guys. Right now, I'm getting it out with
getvertices. Didn't know how that worked. I may try the BLOB as well, to
streamline things, since I just need a dump of it.
Philip, I added the die command, thanks (usually they are there...really!)
Todd
On 6/22/06, John Scoles wrote:
>
> Tricky one.
>
> The sdo_geometry is a very Oracle specific binary field as DBI and
> DBD::Oracle basically default of strings so the program dies.
>
> You may want to define the field as an "ora_type => ORA_CLOB" or
> "ORA_BLOB"
> and get it that way.
>
> If may work.
>
> I might have write a patch for it and treat it as a BLOB. (Tomorrow is my
> DBD::Oracle day so I may get to look at it)
>
> cheers John Scoles
>
> ----- Original Message -----
> From: "Todd Chisholm"
> To:
> Sent: Thursday, June 22, 2006 1:54 PM
> Subject: Getting spatial data?
>
>
> > Hi all,
> >
> > I'm trying to get some sdo data, but running into trouble. The program
> > snippet:
> >
> > my $connect = DBI->connect( "dbi:Oracle:****",
> > '****',
> > '****',
> > ) || die "No connect";
> > #my $query = "select update_date from processed_product where id=15601";
> > my $query = "select geometry from processed_product where id=15601";
> > my $sth = $connect->prepare($query);
> > $sth->execute();
> >
> >
> > The result:
> >
> > DBD::Oracle::db prepare failed: ERROR OCIDefineObject call needed but
> not
> > implemented yet [for Statement "select geometry from processed_product
> where
> > id=15601"] at /home/corp14/tchishol/oracleTst.pl line 11.
> > Can't call method "execute" on an undefined value at ...oracleTst.pl
> line
> > 12.
> >
> > The 'geometry' type is sdo_geometry. Anyone had luck working with this
> type
> > of data?
> >
> > Thanks,
> > Todd
> >
>
>
------=_Part_5476_6804825.1151011958968--