Re: C equivalent for Oracle NUMBER data type ?

From: Mr. Matteo diTommaso <ditommm_at_aa.wl.com>
Date: 13 Jul 93 09:12:33 -0500
Message-ID: <1993Jul13.091233.1_at_aa.wl.com>


In article <CA3MnC.KJJ_at_uk.ac.brookes>, p0070621_at_oxford-brookes.ac.uk (Tommy Wareing) writes:
> Ernst Kloecker (ernst_at_cs.tu-berlin.de) wrote:
>> What is a safe C equivalent for the Oracle data type number ? I am
>> generating NUMBERs from a SEQUENCE and need to store them in C
>> variables safely. (I am using a VARCHAR[40] right now, is that o.k. ?)
>
> As far as I know, you have to convert them to character format.
> Bleurgh :-(
> So yes, VARCHAR[40] is correct. Or any equivalent string type.

#include <stdio.h>
#include <ctype.h>

int errrpt(void);

EXEC SQL BEGIN DECLARE SECTION;
int counter;
long int enum;

float       hill;
VARCHAR     gcoef[30];

EXEC SQL END DECLARE SECTION; Take your pick. Of course you should not use int if you are working with numbers that exceed the size of int on your machine.
-- 
| Matteo diTommaso  (ditommm_at_aa.wl.com) |       /|                            |
| Warner-Lambert, Parke-Davis           |   \'o.O'      This space for rent.  |
| Ann Arbor, MI, USA                    |   =(___)=                           |
| Phone: (313) 996-7148                 |       U  ACK! THPTPHH!              |
Received on Tue Jul 13 1993 - 16:12:33 CEST

Original text of this message