Stored Functions:
The positive aspects of having functions in this particular project, is that we can manipulate the data to represent in any format without actually changing the value in the tables. Any queries run with these functions will not edit the information in the tables.
DegreesMinutes-to-DecimalDegrees
This function accepts a string Latitude or Longitude value in degrees minutes and returns a double as decimal degrees representation. i.e.: 42° 09.110' ---> 42.151833
ILEPA-Remove-Trailing-Fraction-Types
This function takes a Parameter as "BARIUM,Dissolved ug/l" and returns the parameter as "BARIUM". Similarly, it can also take the Parameter as "BARIUM,Dissolved"
and return "BARIUM".
MWRD-Remove-Leading-Digits
This function accepts a string field name as '9 ORP' and returns 'ORP' or '64 ORP' to 'ORP' NOTE: It assumes there are only numbers in the first two characters. If there is a alphanumeric character in the first two positions then it will truncate it.
MWRD_Remove-Trailing-Fraction-Types
This function removes any trailing fraction types at the end of the parameter name leaving just the parameter.
For example,
Ca tot --> Ca Ca sol --> Ca
Remove-Trailing-Units
This function removes any trailing units at the end of a parameter. For example, A parameter as BARIUM,Dissolved ug/l is returned as BARIUM,Dissolved
Stored Procedures:
USADate-To-ISODate
WARNING, this will change all values in the column name that is passed. You may want to save off a copy of the table in case of failure.
This statement takes all US type date strings as "1/25/2000" in a specified column and converts it to an ISO 8601 international standard Date string as "2000-1-25" in the same column.
Pass the table name and column name of your choice and execute.
Use: CALL USADate_To_ISODate( your_table_name, your_column_name);
example: CALL USADate_To_ISODate('MWRD_Sed_Chem_H2O_2007_TEST','Date');