Migrating from Firebird to Mysql

Asked

Viewed 109 times

3

I’m migrating a project in Firebird to Mysql, I’m with a difficulty in converting a trial, would like any hint in how to proceed, below goes the Trial in FIREBIRD.

CREATE PROCEDURE EXECUTA_INATIVA_TABELAS (
    OPERADOR VARCHAR(20),
    ALTERACAO TIMESTAMP)
AS
   DECLARE CGC VARCHAR(18);
   DECLARE VIGENCIA TIMESTAMP;
BEGIN
   FOR
      SELECT CGC, VIG_TAB
      FROM PARM_CALCULO
      WHERE ( VIG_TAB IS NOT NULL )
      INTO :CGC, :VIGENCIA
   DO
   BEGIN
      EXECUTE PROCEDURE INATIVA_TABELAS(:CGC, :VIGENCIA, :OPERADOR,
:ALTERACAO);
   END

   SUSPEND;
END^
  • https://superuser.com/questions/1490588/convert-firebird-stored-procedure-to-mysql has a suggestion, I BELIEVE you need to resolve, I also needed

1 answer

-1

I made an example and it worked show.

CREATE DEFINER=`sistema`@`localhost` PROCEDURE `ADDMESAS`()
BEGIN
declare  i integer;
delete from mesas ;
 SET i = 1;

 while  i <= 160  do
   insert into mesas (num, status) values (i, 'F');
   SET i = i + 1;
 END WHILE;

    update mesas set status = 'A'
    where num in (select codigo from r000001 );     

END

Browser other questions tagged

You are not signed in. Login or sign up in order to post.