SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
D-23
Examples—DECIMAL_POINT
Examples—DECIMAL_POINT
This example prints a price in European format, using an F9.2 display descriptor
and a comma as the decimal character:
S> SET STYLE DECIMAL_POINT ",";
S> DETAIL PRICE;
S> LIST NEXT 1;
PRICE
------------
1300,95
This example uses a period in a mask format to print a price, again using a comma
as the decimal character:
S> SET STYLE DECIMAL_POINT ",";
S> DETAIL PRICE AS M"9999.99";
S> LIST NEXT 1;
PRICE
------------
1300,95
DECLARE CURSOR Statement
DECLARE CURSOR is a DML statement used in host programs to define a cursor and
associate the cursor with a SELECT statement. The program uses the cursor to fetch
rows retrieved by the SELECT statement one-by-one.
cursor CURSOR FOR select-stmt
specifies the cursor and the SELECT statement to associate.
cursor is an SQL identifier that is the name of the cursor and that is unique
among cursor names in the program.
In static SQL, select-stmt is the SELECT statement itself, optionally enclosed
in quotation marks. In dynamic SQL, select-stmt is the name of the prepared
SELECT as defined in the PREPARE statement.
FOR UPDATE OF col [ , col ]
(static SQL only) specifies that rows selected by the cursor can be updated or
deleted and identifies columns to be updated. (The columns to be updated do not
need to be columns in the select list of the SELECT.)
{ cursor CURSOR FOR select-stmt }
{ [ FOR UPDATE OF col [ , col ] ... ] }
DECLARE { }
{ :cursor-var CURSOR FOR :select-stmt-var }