formatage sql

mhubaut's profile image mhubaut posted 1 month ago in General Permalink

i have heidi on my pc and sql format works well , but i have also heidi portable on a windows server and when i formate sql its appear ok on screen but disapers after save ! and its only on one line like select archcertif.noarch AS noarch,archcertif.typ AS typ from archcertif where archcertif.code = 5

format => SELECT archcertif.noarch AS noarch,archcertif.typ AS typ

FROM archcertif

WHERE archcertif.code = 5

save => select archcertif.noarch AS noarch,archcertif.typ AS typ from archcertif where archcertif.code = 5 image.png

2 attachment(s):
  • formatint
  • save-noformat
ansgar's profile image ansgar posted 1 month ago Permalink

The code in a VIEW is reformatted by the server: MySQL interpretes your code and transforms it into a canonical form. That way it can run under any sql mode setting and in this process all indendations are lost.

In HeidiSQL, you can again reformat the code again, by click on the button with the brush on it:

grafik.png

This will give you 3 different formatters to chose from:

grafik.png

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