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

Stripping Header Lines From Stored Procedures

forums forums SQLyog SQLyog: Bugs / Feature Requests Stripping Header Lines From Stored Procedures

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #9991
      Bertram
      Member

      It works when I run (in SQLyog 5.02)

      Code:
      DELIMITER $$;
      DROP FUNCTION IF EXISTS `bSemi`$$
      CREATE FUNCTION `bSemi`(a FLOAT, e FLOAT) RETURNS FLOAT
      BEGIN
      /* a is semimajor axis, in AU
      e is eccentricity,
      b is semiminor axis, in AU
      b = a * (1 – e^2)
      */
      DECLARE b FLOAT;
      SET b = a * SQRT(1 – e*e);
      RETURN ROUND(b, 7);
      END$$
      DELIMITER;$$

      it doesn't work when I add a header string to describe the function

      Code:
      /* = FUNCTION bSemi ============================================================== */
      DELIMITER $$;
      DROP FUNCTION IF EXISTS `bSemi`$$
      CREATE FUNCTION `bSemi`(a FLOAT, e FLOAT) RETURNS FLOAT
      BEGIN
      /* a is semimajor axis, in AU
      e is eccentricity,
      b is semiminor axis, in AU
      b = a * (1 – e^2)
      */
      DECLARE b FLOAT;
      SET b = a * SQRT(1 – e*e);
      RETURN ROUND(b, 7);
      END$$
      DELIMITER;$$

      I've tried all the comment delimiters I know of, /* */, #, //, –, to comment out the header line, with same result …

      Are comment headers disallowed in functions?

      see — http://forums.mysql.com/read.php?98,123079,123108#msg-123108

    • #22852
      peterlaursen
      Participant

      This comment issue is fixed in later versions. 5.17 I think.

      http://webyog.com/faq/33_7_en.html

      This works here on 5.2 b8:

      Code:
      /* = PROCEDURE tst2 ========================== */
      DELIMITER $$ — or you may still use 'DELIMITER $$;'
      CREATE PROCEDURE `test`.`tst2`()
      BEGIN
      — do nothing:
      END$$
Viewing 1 reply thread
  • You must be logged in to reply to this topic.