select - Mysql Procedure INSERT (Already I looked at other answers) -


in mysql have 2 tables: produto , dim_produto.

create table `produto` (   `idproduto` int(11) not null auto_increment,   `ativo` char(1) default 's',   `codpro` int(4) not null,   `codcat` int(4) not null,   `despro` varchar(45) not null,   `codmar` int(3) not null,   `codsab` int(3) not null,   `qtdcaixa` int(2) not null,   `transmitido` char(1) default 'n',   primary key (`idproduto`,`codpro`),   ) engine=innodb auto_increment=3 default charset=utf8;  --   create table `dim_produto` (   `codpro` int(4) not null,   `ativo` char(1) default null,   `codcat` int(4) default null,   `despro` varchar(45) default null,   `idinc` timestamp null default current_timestamp,   primary key (`codpro`) ) engine=innodb default charset=utf8; 

i'm trying make procedure makes select product in table , enter dim_produto table.

delimiter | create procedure dimproduto (codpro int (4), ativo char (1), codcat int (4), despro varchar (45)) begin insert dim_produto (codpro, ativo, codcat, despro) (select codpro, ativo, codcat, despro produto transmitido = 'n'); end | 

if insert way in procedure, works perfectly.

how call procedure when insert in select table dim_produto? , how can call it?

grateful.


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -