distal-attribute
distal-attribute
distal-attribute
distal-attribute

export view

BubikolRamios posted 1 year ago in General
Like:

select
state,
station,
case when right(lat,1)='S' then
((SUBSTRING_INDE ...



multiline view code.

export into another db it comes out all in single line.
Win7 to linux.

Furthermore after exorting single view, it is listed twice in table tools dialog list of eported items.
ansgar posted 1 year ago
This is done by the server, not HeidiSQL.

HeidiSQL has exactly for this reason the "Reformat SQL" button with the white page and the brush on it. Default hotkey is Ctrl+F8.
BubikolRamios posted 1 year ago
Thanks for inf.

try to format this one line sample:

select `_dump_climatological_data_view`.`state` AS `state`,`_dump_climatological_data_view`.`station` AS `station`,(case when (right(`_dump_climatological_data_view`.`lat`,1) = 'S') then ((substring_index(replace(replace(`_dump_climatological_data_view`.`lat`,'N',''),'S',''),' ',1) * -(1)) + ((((substring_index(replace(replace(`_dump_climatological_data_view`.`lat`,'N',''),'S',''),' ',-(1)) * -(1)) * 100) / 60) / 100)) else ((substring_index(replace(replace(`_dump_climatological_data_view`.`lat`,'N',''),'S',''),' ',1) * 1) + ((((substring_index(replace(replace(`_dump_climatological_data_view`.`lat`,'N',''),'S',''),' ',-(1)) * 1) * 100) / 60) / 100)) end) AS `lat_wgs`,(case when (right(`_dump_climatological_data_view`.`lon`,1) = 'W') then ((substring_index(replace(replace(`_dump_climatological_data_view`.`lon`,'W',''),'E',''),' ',1) * -(1)) + ((((substring_index(replace(replace(`_dump_climatological_data_view`.`lon`,'W',''),'E',''),' ',-(1)) * -(1)) * 100) / 60) / 100)) else ((substring_index(replace(replace(`_dump_climatological_data_view`.`lon`,'W',''),'E',''),' ',1) * 1) + ((((substring_index(replace(replace(`_dump_climatological_data_view`.`lon`,'W',''),'E',''),' ',-(1)) * 1) * 100) / 60) / 100)) end) AS `lon_wgs`,(case when (`_dump_climatological_data_view`.`amsl` = '') then NULL else (trim(replace(`_dump_climatological_data_view`.`amsl`,'meters','')) * 1) end) AS `amsl1`,min(`_dump_climatological_data_view`.`minimum_avg_for_month_1991_2000`) AS `min_degrees_celsius`,'http://www.ncdc.noaa.gov/wdc/index.php' AS `src` from `_dump_climatological_data_view` group by `_dump_climatological_data_view`.`station`,`_dump_climatological_data_view`.`state` order by `_dump_climatological_data_view`.`state`,`_dump_climatological_data_view`.`station`



Not what I had orignal of course

I would expect at least each field before 'FROM' part on separate line... Hard to do it, but mybe possible.

Please login to leave a reply, or register at first.