default
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
validate_coordinate_field(coordinate_field text)
Parameters
Name
Type
Mode
coordinate_field
text
IN
Definition
DECLARE formatted_coordinate_field TEXT; BEGIN -- Confirm the coordinate_field is a valid value formatted_coordinate_field := regexp_substr(coordinate_field, '^[-+]?([0-9]{1,2}|1[0-7][0-9]|180)(\.[0-9]{1,10})'); IF (formatted_coordinate_field IS NULL or (length(formatted_coordinate_field) = 0)) then return NULL; -- Valid match so return the formatted_coordinate_field else return formatted_coordinate_field; END IF; END;