Re: Big number host variables in pro*C ??
Date: Sat, 29 Oct 1994 12:51:01 +0000
Message-ID: <783435061snz_at_sambusys.demon.co.uk>
In article <89C8236.0389001989.uuout_at_compudata.com>
barry.roomberg_at_compudata.com "BARRY ROOMBERG" writes:
> -> The question is "how do I define the host variable `key_value' ?".
> -> The type 'long int' does not enough precision for 13 digits and
> -> 'float' or 'double' cause a segv error.
>
> Use a TO_CHAR and put it into a text array.
Of course this means that your arithmetic must be done in SQL e.g.
EXEC SQL BEGIN DECLARE;
VARCHAR a[14], b[14], c[14];
EXEC SQL END DECLARE;
.
.
EXEC SQL SELECT :a + :b INTO :c FROM DUAL;
[if you have PL/SQL you can avoid the database access] [and if you are brave you can try char[] rather than VARCHAR]
or you must find or write a function library that allows you to manipulate numbers as character strings. Several of these are in the public domain or are copyleft. Ask archie for apm*.
-- Paul Beardsell SAM Business Systems Ltd ~~~~~~~~~~~~~~ 21 Finn House, Bevenden St, pbeardsell_at_cix.compulink.co.uk London, N1-6BN, UK. psb_at_sambusys.demon.co.uk (+44 or 0)71 608-2391Received on Sat Oct 29 1994 - 13:51:01 CET