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

Declare Variable

forums forums SQLyog SQLyog: Bugs / Feature Requests Declare Variable

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #24280
      peterlaursen
      Participant

      It is not SQLyog that sends this error messsage.  It is MySQL that does!

      There is no (My)SQL “DECLARE” statement.

      However you can DECLARE inside (BEGIN .. END) of a Stored procedure or Function (or Trigger or Event etc).

      an example:

      Code:
      DELIMITER $$

      DROP FUNCTION IF EXISTS `test`.`qs`$$

      CREATE FUNCTION `test`.`qs`() RETURNS varchar(50)
      BEGIN
      declare querystr varchar(50);
      — more operations here
      return querystr;
      END$$

      DELIMITER;

      You can also use 'user variables' like

      SET @querystr = 'something'.

      (and the type of a user variable is not declared)

    • #24281
      ant1
      Member

      Thank you!

Viewing 1 reply thread
  • You must be logged in to reply to this topic.