Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Unable to fetch Timpstamp datatype using OCI layer
On Aug 7, 5:50 pm, Frank van Bortel <frank.van.bor..._at_gmail.com>
wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
>
> coolrohitj..._at_gmail.com wrote:
> > Hi,
> > I am pretty newbie to OCI layer. I was trying to make a connection to
> > oracle, and was trying to fetch timestamp datatype by binding
> > timpstamp datatype.
>
> > This datatype shows different behavior for different sub second
> > precisions.
>
> > For my program(in c++) I was able to fetch data successfully for
> > direct execution for both Timestamp(6) and Timestamp(9). I am able to
> > see data value's.
>
> > On the other hand when I was trying to bind timestamp data,
> > 1) if my datatype is timestamp(6), it is unable to fetches any data.I
> > also tried to insert same data using my program.
>
> > 2)in case of timestamp(9), it is able to fetches only those rows which
> > were inserted using my program, it doesn't fetch rows which were
> > inserted using SQL-PLUS.
>
> > Here I have given snippet of my code:
>
> > char *sql_statement="select t1 from tstamp where t1=:1";
>
> And you are absolutely sure you attempt to fetch
> the correct timestamp?
> A timestamp(9) may fetch as 12:30:54.123456000, when inserted
> as timestamp(6).
>
> - - design rule: use what you need
> (if timestamp(6) is sufficient, do not use (9)).
> - - design rule: do not mix and match (timestamp(6) vs (9))
> - - design rule: know thy data!
>
> - --
> Regards,
> Frank van Bortel
>
> Top-posting is one way to shut me up...
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (MingW32)
>
> iD8DBQFGuGquLw8L4IAs830RAraJAKCBFXt9ARGYUm9PqeIue+fkKaeyNACfZ1zV
> e+c34ljErDC2p85TCArAjwo=
> =wZhR
> -----END PGP SIGNATURE-----
Thanks Frank for your input.
I had empty table initially and I inserted timestamp data manually;
also I am using different tables for timestamp(6) and timstamp(9). So
I think there is no mix and match.
More interestingly, I don't understand why for same data(one is
inserted using SQL-PLUS and another is inserted using my program) my
program behaves differently, means in one case it doesn't fetch data
and in another case it does!!
Received on Wed Aug 08 2007 - 23:20:22 CDT
![]() |
![]() |