Name

convert_conc — convert a quantity from one given unit to another.

Synopsis

NUMERIC convert_conc ( quantity,  
  from_unit,  
  to_unit);  
NUMERIC quantity ;
TEXT from_unit ;
TEXT to_unit ;
 

Input

quantity

The concentration in need of conversion, e.g. a NUCACID_CONC_DATA.Quantity value. A NUMERIC value, or any other data type that can be interpreted as a number and converted to NUMERIC.

from_unit

A text string indicating the unit to convert from. In other words, the current unit of the quantity. This must be a NUCACID_CONC_UNITS.Unit value.

to_unit

A text string indicating the unit to convert into. In other words, the desired unit of the quantity. This must be a NUCACID_CONC_UNITS.Unit value.

Description

Returns a number, the converted concentration. If the two units are not related — their respective NUCACID_CONC_UNITS.Reference values are not equal — then no conversion can occur and this function returns NULL.

This function is used by the NUCACIDS_W_CONC view to generate its several concentration columns. It may also be useful to users trying to standardize concentrations when querying NUCACID_CONC_DATA.


Page generated: 2025-12-19T14:31:38-05:00.