Re: Oracel and PRO*C datatype for unsigned LongLong value.
Date: Wed, 24 Sep 2003 13:22:30 +0000 (UTC)
Message-ID: <bks5qm$g7g$1_at_reader2.panix.com>
In <697f87bc.0309240426.5d8d71a5_at_posting.google.com> vashisht_r_at_yahoo.com (Neo) writes:
>My application uses pro*c for database interaction. All application
>objects have unique ids which are usigned long long type. Can someone
>please suggest
Mine too.
>1. what should be the column datatype to store this value? I am
>thinking of Number(20).
I use a bare NUMBER, rather than a NUMBER(20), to represent the maximum possible value, 18446744073709551615. This allows me flexibility for the future, in about 250 years when I exhaust my unique IDs that might be allocated 1,000,000 per second for the entire 250 years.
>2. What should be the host variable type in my application to retrieve
>and save this value in database from Pro*c?
varchar(22). atoi64() and i64toa() (or snprintf or stringstream<<__int64).
Andy
-- Andrew Finkenstadt (http://www.finkenstadt.com/andy/)Received on Wed Sep 24 2003 - 15:22:30 CEST
