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

[bug?] Exporting Trigger Doesn't Works?

forums forums SQLyog SQLyog: Bugs / Feature Requests [bug?] Exporting Trigger Doesn't Works?

  • This topic is empty.
Viewing 3 reply threads
  • Author
    Posts
    • #9851
      jitebi
      Member

      I exported different Mysql 5.X DB using

      “Export Database as SQL Statment” proc,

      including the create VIEWS flag,

      but i noted int the generated SQL code

      that VIEWS become TABLES!

      Why?

      I'm using Sqlyog 5.16 community edition

      Thank you by now

      Carlo Rossetti

    • #22329
      peterlaursen
      Participant
      Quote:
      but i noted in the generated SQL code that TRIGGER become TABLES!

      ?????????? sorry for all the question marks !!!!!!!!!!!!!!!!

      Can you provide an example please? (a conflicting screenshot and dump for instance!)

      Also: ALWAYS tell what program version you are using

      I just did this example with 5.18 and it is coorect:

      Code:
      *
      SQLyog Enterprise – MySQL GUI v5.18
      Host – 5.0.24a-community-max-log : Database – test
      *********************************************************************
      Server version : 5.0.24a-community-max-log
      */

      SET NAMES utf8;

      SET SQL_MODE='';
      SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO';

      /*Table structure for table `TableName1` */

      CREATE TABLE `TableName1` (
      `id` bigint(20) NOT NULL auto_increment,
      `txt1` varchar(20) NOT NULL,
      `num1` bigint(20) NOT NULL,
      PRIMARY KEY (`id`)
      ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

      /*Data for the table `TableName1` */

      insert into `TableName1` (`id`,`txt1`,`num1`) values (1,'',0);
      insert into `TableName1` (`id`,`txt1`,`num1`) values (2,'',0);

      /*Trigger structure for table `TableName1` */

      DELIMITER $$

      CREATE TRIGGER `nope` AFTER INSERT ON `TableName1` FOR EACH ROW BEGIN
      END$$

      DELIMITER;

      SET SQL_MODE=@OLD_SQL_MODE;

    • #22330
      jitebi
      Member

      You are too fast 😀

      I was just editing my post cause i wrote

      TRIGGER but really i was speaking about VIEWS

      I'm using sqlyog 5.16 community version

      An example:

      DROP TABLE IF EXISTS `view_name`;

      DROP VIEW IF EXISTS `view_name`;

      CREATE TABLE `view_name` (

      `ID` bigint(21) NOT NULL default '0',

      `NYear` bigint(4) default NULL,

      `NMonth` bigint(2) default NULL

      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

      When i import the SQL statment generated by sqlyog

      i don't find my views but only equivalent tables.

      Thank you for your speed

      C.

    • #22331
      peterlaursen
      Participant

      OK ..

      do not be mistaken! Now after import isn't everything as it should be?

      SQLyog will need to create a table and next drop it and THEN create the View. The 'mysqldump' program does exactly the same. This is a 'workaround' for situations that can occur with VIEWs built on VIEWs for instance. A SQL dump is sequential. When the beginning is executed the end is not known! And if the second of those views is attempted created before the first you'll get an error. This way you don't!

      You have not 'shortened'/edited the dump?

      “I'm using sqlyog 5.16 community version” There is no such thing! You mean FREE 5.16 version I think!

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