[comp.databases] INGRES Esql/C & Money format

chris@vision.UUCP (Chris Davies) (07/27/90)

System is AT&T SysV.3 Unix, Ingres 6.0 - 6.2 (so far).

I have almost finished writing a C program using dynamic SQL.  Everything's
hunkydory except the Ingres MONEY datatype.  I'm having problems converting
this datatype to a C string (it only maps to a C double float).

Can anyone point me to an Ingres function to do this (at the C level) or
suggest how I can find out if the user has specified any of II_MONEY_FORMAT,
II_MONEY_PREC, or II_DECIMAL?  These won't necessarily be in the user's
environment (getenv() and friends); they might be in the Ingres environment
(use ingprenv to display these).

Using sprintf("%lf"...) alone doesn't help, since this (obviously) ignores
these Ingres variables.

If I'm desperate, I'll end up reading .../ingres/files/symbol.tbl to find
what variables are defined in the Ingres environment.

Oh yes.  I cannot change the SQL queries, so any solution must be useful at
the C program level.

Suggestions please!  Thanks,
	Chris
-- 
VISIONWARE LTD         | UK: chris@vision.uucp     JANET: chris%vision.uucp@ukc
57 Cardigan Lane       | US: chris@vware.mn.org    OTHER: chris@vision.co.uk
LEEDS LS4 2LE          | BANGNET:  ...{backbone}!ukc!vision!chris
England                | VOICE:   +44 532 788858   FAX:   +44 532 304676
-------------- "VisionWare:   The home of DOS/UNIX/X integration" --------------