LongLat Function Updated for database