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

Sqlyog Adding 'use' Commands To Procedures

forums forums SQLyog SQLyog: Bugs / Feature Requests Sqlyog Adding 'use' Commands To Procedures

  • This topic is empty.
Viewing 4 reply threads
  • Author
    Posts
    • #11749
      JosephineJ
      Member

      Hi,

      Does anyone know how to stop SQLyog adding 'USE' commands to all my procedures and functions? :huh:

      I'm writing them to be used on multiple schema with the same structure so they should simply use the current schema. I keep removing these 'USE' commands but if I miss one, it could cause problems.

      Thanks,

      Jo

    • #29996
      peterlaursen
      Participant

      When you create a SP you will do from the menu or Object Browser context menu. When I do, this template occurs:

      Code:
      DELIMITER $$

      CREATE
      /*[DEFINER = { user | CURRENT_USER }]*/
      PROCEDURE `visifire_faq`.`blah`()
      /*LANGUAGE SQL
      | [NOT] DETERMINISTIC
      | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
      | SQL SECURITY { DEFINER | INVOKER }
      | COMMENT 'string'*/
      BEGIN

      END$$

      DELIMITER;

      There is no USE statement I can see. What program version are you using? Maybe we did with earlier versions though.

      If I did not understand the problem, please detail.

    • #29997
      JosephineJ
      Member
      peterlaursen wrote on Nov 11 2009, 04:02 PM:
      When you create a SP you will do from the menu or Object Browser context menu. When I do, this template occurs:

      There is no USE statement I can see. What program version are you using? Maybe we did with earlier versions though.

      If I did not understand the problem please detail.

      I get the same, but when I hit F9 to execute, close the procedure and then reopen it, the USE statement is there.

      BTW I'm using version 8.16.

      Edit: I've just checked and every time I reopen a stored procedure, the USE command has reappeared. 🙁

    • #29998
      peterlaursen
      Participant

      OK .. ALTER produces this

      Code:
      DELIMITER $$

      USE `test`$$

      DROP PROCEDURE IF EXISTS `blah`$$

      CREATE DEFINER=`root`@`localhost` PROCEDURE `blah`()
      BEGIN
      SELECT 7;
      END$$

      DELIMITER;

      I think it would be dangerous to remove that USE. Some people could get a very big surprise should they select another database after opening the template. Is it a big problem to remove that line? Also the templates are compiled in and cannot be edited by user.

    • #29999
      JosephineJ
      Member

      It's not a big problem. More of an annoyance as I find that it makes it harder for me to keep track of where I'm putting these procedures.

      It would be nice if I could change it but it's not a showstopper.

      Thanks,

      Jo

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