aalessandre Posted November 13, 2011 Report Share Posted November 13, 2011 preciso gerar um backup do meu banco, gostaria de gerar um insert para cada registro da tabela, exemplo :INSERT INTO tabela1 VALUES (1, 'Teste 1');INSERT INTO tabela1 VALUES (2, 'Teste 2');INSERT INTO tabela1 VALUES (3, 'Teste 3');INSERT INTO tabela1 VALUES (4, 'Teste 4');INSERT INTO tabela1 VALUES (5, 'Teste 5'); uso o mysqldump mas ele gera numa linha só :insert into `bairro`(`bai_codigo`,`bai_cidade`,`bai_descricao`,`bai_tx_entrega`,`bai_vlr_entrega`) values (1,1,'CENTRO','0.00','0.00'),(1,2,'ZONA 1','0.00','0.00'),(1,3,'CAMPO CUMPRIDO','0.00','0.00'),(1,7,'FERRARIA','0.00','0.00'),(1,8,'PACOTUBA','0.00','0.00'),(1,9,'JARDIM IGUAÇU','0.00','0.00'),(1,10,'','0.00','0.00'),(1,11,'CENTRO','0.00','0.00'),(2,1,'SITIO CERCADO','0.00','0.00'),(2,3,'CIC','0.00','0.00'),(2,7,'CENTRO','0.00','0.00'),(3,1,'FAZENDINHA','0.00','0.00'),(3,3,'CAIOA','0.00','0.00'),(4,1,'CAMPO CUMPRIDO','0.00','0.00'),(4,3,'CAIUA','0.00','0.00'),(5,1,'PORTAO','0.00','0.00'),(5,3,'PAROLIN','0.00','0.00'),(6,1,'CIC','0.00','0.00'),(6,3,'CIDADE INDUSTRIAL','0.00','0.00'),(7,1,'CAJURU','0.00','0.00'),(7,3,'GUAÍRA','0.00','0.00'),(8,3,'ALTO BOQUEIRAO','0.00','0.00'); nesse caso, tenho 22 bairros, gostaria de gerar 22 inserts. como fazer isso ? Quote Link to comment Share on other sites More sharing options...
Question
aalessandre
preciso gerar um backup do meu banco, gostaria de gerar um insert para cada registro da tabela, exemplo :
INSERT INTO tabela1 VALUES (1, 'Teste 1');
INSERT INTO tabela1 VALUES (2, 'Teste 2');
INSERT INTO tabela1 VALUES (3, 'Teste 3');
INSERT INTO tabela1 VALUES (4, 'Teste 4');
INSERT INTO tabela1 VALUES (5, 'Teste 5');
uso o mysqldump mas ele gera numa linha só :
insert into `bairro`(`bai_codigo`,`bai_cidade`,`bai_descricao`,`bai_tx_entrega`,`bai_vlr_entrega`) values (1,1,'CENTRO','0.00','0.00'),(1,2,'ZONA 1','0.00','0.00'),(1,3,'CAMPO CUMPRIDO','0.00','0.00'),(1,7,'FERRARIA','0.00','0.00'),(1,8,'PACOTUBA','0.00','0.00'),(1,9,'JARDIM IGUAÇU','0.00','0.00'),(1,10,'','0.00','0.00'),(1,11,'CENTRO','0.00','0.00'),(2,1,'SITIO CERCADO','0.00','0.00'),(2,3,'CIC','0.00','0.00'),(2,7,'CENTRO','0.00','0.00'),(3,1,'FAZENDINHA','0.00','0.00'),(3,3,'CAIOA','0.00','0.00'),(4,1,'CAMPO CUMPRIDO','0.00','0.00'),(4,3,'CAIUA','0.00','0.00'),(5,1,'PORTAO','0.00','0.00'),(5,3,'PAROLIN','0.00','0.00'),(6,1,'CIC','0.00','0.00'),(6,3,'CIDADE INDUSTRIAL','0.00','0.00'),(7,1,'CAJURU','0.00','0.00'),(7,3,'GUAÍRA','0.00','0.00'),(8,3,'ALTO BOQUEIRAO','0.00','0.00');
nesse caso, tenho 22 bairros, gostaria de gerar 22 inserts. como fazer isso ?
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.