Previous Topic: ExtractNext Topic: Index


Fix

Returns a fixed-length string of 20, 40, 60, or 80 characters.

FIX pads with blanks or truncates the string to the appropriate size.FIX is useful for making SELECT statements UNION compatible.

Syntax:

►►─┬─ FIX20 (string) ─┬───────────────────────────────────────────────────────►◄
   ├─ FIX40 (string) ─┤
   ├─ FIX60 (string) ─┤
   └─ FIX80 (string) ─┘

Invocation names:

FIX20   FIX60
FIX40   FIX80

Parameters:

string

Specifies the string value on which the fix function is performed.

String can be:

Example:

In the example below, FIX40 (in OLQ access mode) is used to create a formatted mailing address report:

select fix40(concat(substr(emp-fname,1,9),' ',emp-lname))
       emp-lname, emp-id, 1
     from employee
union
select fix40(street),
       emp-lname, emp-id, 2
     from employee
union
select fix40(concat(substr(city,1,10),' ',state,' ',zip-code),
       emp-lname, emp-id, 3
     from employee
union
select fix40(' ') as detail,
       emp-lname, emp-id, 9 as line
     from employee order by 2, 3, 4


JOHN MULLHOLLOW
114 LAUREL LANE
SHELBURNE FALLS, MA  01210