Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Comment Sections In Stored Procs

forums forums SQLyog Using SQLyog Comment Sections In Stored Procs

  • This topic is empty.
Viewing 6 reply threads
  • Author
    • #13526

      Is there a keyboard shortcut that will comment out a selected section when I’m altering a Stored Proc? I need to do this to test various sections of the SP.


      I tried Ctrl+Shift+C, but this doesn’t work when I save the SP – not sure what the purpose of this actually is.


      I need to comment a section using “#”, but not fun if I have to manually do that for every line.

    • #35703



      This is reproducible at our end. We are considering the implementation aspects for fixing this. Thanks in advance for your patience.



    • #35704



      Please tell if commenting out using ‘#’ saves the Stored Procedure or not?

    • #35705

      Yes, using ‘#’ in a Stored Proc is saved.

    • #35706

      I don’t think so that even putting a “#” would save the changes. Please check that there are two cases here that are possible. One is that you add comments to the SP and then close only the tab of SP and second is closing SQLyog altogether and opening again.


      As you would know that the comments fall into metadata of a stored procedure, views, etc. MySQL does not save comments for the SP or views for that matter. You can check the information_schema for the data. The mysql documentation explains that here http://dev.mysql.com/doc/refman/5.0/en/views-table.html or running the query:


      does not contain comments anywhere.


      So in the first case where you close the SP tab without saving it in a .sql file there is no way server will remember the changes.


      But in the second case where you close SQLyog the changes that you made to any editing tab, may it be SP or query editing the changes that you made will be saved due to Session restore that SQLyog offers. Please note here that SQLyog is saving whatever there is on the editor tab, not the server. So we cannot do much in this case.

    • #35707

      MySQL does store comments for Stored Procs. I checked information_schema > ROUTINES, and the comments appear in the ROUTINE_DEFINITION column. They also appear using SHOW CREATE PROCEDURE .


      I tried altering a Stored Proc using “#, “– ” and “/* … */”, they all saved OK.


      However, I have tried again using Ctrl+Shift+C, and this time the section I commented was saved when I ran the ALTER Stored Proc, so I believe it was my error when I first tried it.


      Topic closed, I think.



    • #35708



      Sorry there is a small correction. As you said MySQL does store the comments but only that lie inside the routine definition. If you have tried to comment anything outside the Routine definition, that is not being saved. 



Viewing 6 reply threads
  • You must be logged in to reply to this topic.