     xform.well_yield_unit_code              ,
     xform.latitude                          ,
     xform.longitude                         ,
-    CASE 
+    CASE
       WHEN xform.latitude is NULL OR
           xform.longitude IS NULL THEN
         NULL
-      ELSE  
-          ST_SetSRID(ST_MakePoint(longitude, latitude),3005) 
+      ELSE
+          ST_SetSRID(ST_MakePoint(longitude, latitude),3005)
     END AS geom                             ,
     xform.ground_elevation                  ,
     xform.well_orientation                  ,

     create_user, create_date, update_user, update_date, bcgs_id, bcgs_number
    )
    SELECT
     who_created ,when_created ,who_updated ,when_updated, bcgs_id, bcgs_number
    FROM WELLS.WELLS_BCGS_NUMBERS
    ORDER BY BCGS_NUMBER;


            WHEN 'Y' THEN TRUE
            WHEN 'N' THEN FALSE
        END                               ,
        casings.when_created,
        coalesce(casings.when_updated, casings.when_created),
        casings.who_created,
        coalesce(casings.who_updated, casings.who_created)
    FROM wells.wells_casings casings
    INNER JOIN xform_well xform ON xform.well_id=casings.well_id;

