5. Embedded SQL for Ada : Preprocessor Operation : Command Line Operations : How to Define Long Floating-point Storage
 
Share this page                  
How to Define Long Floating-point Storage
The storage representation format of long floating-point variables must be d_float because the Ingres runtime system uses that format for floating-point conversions. If your Embedded SQL program has long_float variables that interact with the Embedded SQL runtime system, you must make sure they are stored in the d_float format. The default Ada format is g_float. A convenient way to control the format of all long float variables is to issue the acs set pragma program command. For example, by issuing the following command, you redefine the program library characteristics for long_float from the default to d_float:
acs set pragma/long_float=d_float
A second remedy to this particular problem is to issue the statement:
pragma long_float(d_float)
in the source file of each compilation unit that uses floating-point variables. You can also explicitly declare the Embedded SQL variables with type d_float, as defined in package SYSTEM.
The following example is a typical command file that sets up a new Ada program library with the Embedded SQL package specifications and the d_float numerical format. The name of the new program library is passed in as a parameter:
acs create library [.'p1']
acs set library [.'p1']
acs set pragma/long_float=d_float
copy ii_system:[ingres.files]eqdef.ada,eqsqlca.ada, -
  eqsqlda.ada []
ada eqdef.ada,eqsqlca.ada,eqsqlda.ada
delete eqdef.ada.,eqsqlca.ada.,eqsqlda.ada
exit