SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
S-46
Consideration—SET STYLE
For information about a specific option, see the entry for that option.
Consideration—SET STYLE
You cannot specify the same option more than once in a single SET STYLE command.
Example—SET STYLE
This example activates report headings and specifies an asterisk as the character to
display for null values:
>> SET STYLE HEADINGS ON, NULL_DISPLAY "*";
SETSCALE Function
SETSCALE is a function that specifies the scale of a host variable to SQL. You can
use SETSCALE in SQL statements in C, Pascal, or TAL programs.
You use SETSCALE to store scaled values (such as prices) in a database, retrieve
database values into host variables in the program, or reference values in the
database for comparison operations. The scale information is valid only in the context
of the SQL statement; the program must handle scaling for host language statements.
:host-var
is an integer variable in a host language program.
[INDICATOR] :ind-var
specifies an indicator variable associated with the host variable.
scale
is an integer that specifies the scale of host-var. The values allowed depend on
the size of host-var, :
Consideration—SETSCALE
SETSCALE directs SQL to use host-var in the context of SQL statements as if
host-var were declared with a scale of scale.
If the value in host-var is entered into the database through an INSERT or UPDATE,
the host language program must assign a value that allows for the scale to host-var.
SETSCALE ( :host-var [[INDICATOR] :ind-var], scale )
2-byte integers 0 through 5 decimal digits
4-byte integers 0 through 10 decimal digits
8-byte integers 0 through 18 decimal digits