Path: text.usenetserver.com!out02a.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!postnews.google.com!d55g2000hsg.googlegroups.com!not-for-mail
From:  Rohit <coolrohitjain@gmail.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: Unable to fetch Timpstamp datatype using OCI layer
Date: Thu, 09 Aug 2007 04:20:22 -0000
Organization: http://groups.google.com
Lines: 64
Message-ID: <1186633222.656473.154040@d55g2000hsg.googlegroups.com>
References: <1186481807.635589.276130@b79g2000hse.googlegroups.com>
   <f99prd$2e9$1@news1.zwoll1.ov.home.nl>
NNTP-Posting-Host: 203.92.60.130
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1186633222 24564 127.0.0.1 (9 Aug 2007 04:20:22 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 9 Aug 2007 04:20:22 +0000 (UTC)
In-Reply-To: <f99prd$2e9$1@news1.zwoll1.ov.home.nl>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: d55g2000hsg.googlegroups.com; posting-host=203.92.60.130;
   posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0
Xref: usenetserver.com comp.databases.oracle.server:432685
X-Received-Date: Thu, 09 Aug 2007 00:20:22 EDT (text.usenetserver.com)

On Aug 7, 5:50 pm, Frank van Bortel <frank.van.bor...@gmail.com>
wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
>
> coolrohitj...@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!!

