Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Line Break on view code

aghio's profile image aghio posted 2 months ago in General Permalink

There is no way to fix the code view with line breaks & indent? When I open a view code, I see one line.... It´s impossible to read this. When I type my code, it is with line breaks, indented, etc, but after save it, I open and again I see just one line....

2 attachment(s):
  • This-is-how-I-see
  • This-is-how-I-write-save
ansgar's profile image ansgar posted 2 months ago Permalink

You can reformat the SQL code, using the menu item Query > Reformat SQL.

aghio's profile image aghio posted 2 months ago Permalink

Thanks Ansgar, but this is not enough. First of all, the "Reformat" add line break on '('. If you have a select with 80 fields, you still will see one line. And second, you should press CTRL+F8 every time you open the view (or any code). Next time you open the query, again you will see "one line"

ansgar's profile image ansgar posted 2 months ago Permalink

Well, the MySQL server reformats the code to that one-liner, so this is returned afterwards:

SHOW CREATE VIEW `vw_casos_cargados_ch`;

Reasons: https://stackoverflow.com/questions/37475395/why-mysql-completely-reformat-the-view-query-text

HeidiSQL already tries to load the original code, but that fails in many situations due to privilege issues:

SELECT CAST(
  LOAD_FILE(
    CONCAT(
      IFNULL(@@GLOBAL.datadir, CONCAT(@@GLOBAL.basedir, 'data/')),
      'database_name/vw_casos_cargados_ch.frm'
    )
  ) AS CHAR CHARACTER SET utf8
);

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




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.