DBD::Oracle V 1.16 & Oracle type 187 not explicitly supported

DBD::Oracle V 1.16 & Oracle type 187 not explicitly supported

am 05.12.2005 05:47:29 von ron

Hi Folks

o I'm writing code based on Class::DBI V 3.0.11.

o I do
__PACKAGE__ -> db_Main() -> do("alter session set nls_timestamp_format =
'YYYY-MM-DD HH24:MI:SS'") if ($config{'dsn'} =~ /Oracle/);

o I have a debug write after every line, so I know that it's when I try to read
the timestamp field below that the error is thrown

o I create the column like this:
evaluation_timestamp timestamp not null

o I have this value stored in the column: 2005-12-05 08:00:00 in each record

o I try to inflate it with:
__PACKAGE__ -> has_a
(
evaluation_timestamp => 'Time::Piece',
inflate => sub{scalar Time::Piece -> strptime(shift, "%Y-%m-%d %H:%M:%S")},
);

o I get an error at line 298 of DBD::Oracle V 1.16:
Field 3 has an Oracle type 187 which is not explicitly supported

Any ideas?

--
Ron Savage
ron@savage.net.au
http://savage.net.au/index.html

RE: :Oracle V 1.16 & Oracle type 187 not explicitly supported

am 05.12.2005 07:24:44 von stbaldwin

Ron,

The timestamp data type was introduced relatively recently to Oracle, and
has the capacity to store fractional seconds (basically to the resolution of
your OS clock).

Unless you genuinely need fractional seconds, you can use the ordinary old
DATE data type which stores date+time (to the closest whole second). If you
do this, DBD::Oracle should have no problem with your data. I think the
problem is that DBD::Oracle has not yet absorbed some of the newer data type
functionality of Oracle.

Hope this helps,

Steve

-----Original Message-----
From: Ron Savage [mailto:ron@savage.net.au]
Sent: Monday, 5 December 2005 3:47 PM
To: List - DBI users
Subject: DBD::Oracle V 1.16 & Oracle type 187 not explicitly supported

Hi Folks

o I'm writing code based on Class::DBI V 3.0.11.

o I do
__PACKAGE__ -> db_Main() -> do("alter session set nls_timestamp_format =
'YYYY-MM-DD HH24:MI:SS'") if ($config{'dsn'} =~ /Oracle/);

o I have a debug write after every line, so I know that it's when I try to
read
the timestamp field below that the error is thrown

o I create the column like this:
evaluation_timestamp timestamp not null

o I have this value stored in the column: 2005-12-05 08:00:00 in each record

o I try to inflate it with:
__PACKAGE__ -> has_a
(
evaluation_timestamp => 'Time::Piece',
inflate => sub{scalar Time::Piece ->
strptime(shift, "%Y-%m-%d %H:%M:%S")},
);

o I get an error at line 298 of DBD::Oracle V 1.16:
Field 3 has an Oracle type 187 which is not explicitly supported

Any ideas?

--
Ron Savage
ron@savage.net.au
http://savage.net.au/index.html

Re: DBD::Oracle V 1.16 & Oracle type 187 not explicitly supported

am 05.12.2005 10:59:26 von Tim.Bunce

On Mon, Dec 05, 2005 at 03:47:29PM +1100, Ron Savage wrote:
>
> o I create the column like this:
> evaluation_timestamp timestamp not null
>
> o I have this value stored in the column: 2005-12-05 08:00:00 in each record
>
> o I try to inflate it with:
> __PACKAGE__ -> has_a
> (
> evaluation_timestamp => 'Time::Piece',
> inflate => sub{scalar Time::Piece -> strptime(shift, "%Y-%m-%d %H:%M:%S")},
> );
>
> o I get an error at line 298 of DBD::Oracle V 1.16:
> Field 3 has an Oracle type 187 which is not explicitly supported
>
> Any ideas?

Support for TIMESTAMP columns was added in 1.15 and extended in 1.16.
Please double check that the version of the code that's actually running.
Beyond that, a relevant chunk of DBI trace would help. Say level 4.

Tim.