Insert several data in ibexpert

1

I'm not sure what to do, but I'm not sure how to do this.

  

Invalid token. Dynamic SQL Error. SQL error code = -104. Token unknown   - line 4, column 1. (.

I'm trying to insert as follows:

INSERT INTO CIDADE (CODIGO,NOME,ESTADO) VALUES

(1, 'Afonso Cláudio', 8);
(2, 'Água Doce do Norte', 8);
(3, 'Águia Branca', 8);
(4, 'Alegre', 8);
(5, 'Alfredo Chaves', 8);
(6, 'Alto Rio Novo', 8);
(7, 'Anchieta', 8);
(8, 'Apiacá', 8);
(9, 'Aracruz', 8);
(10, 'Atilio Vivacqua', 8); ...

It's kind of out of the way to insert one data at a time because there are more than 5,000 cities when I try to insert just one data at a time.

    
asked by anonymous 02.02.2016 / 12:43

1 answer

2

The firebird documentation suggests using EXECUTE BLOCK to perform multiple inserts.

set term ^ ;
EXECUTE BLOCK AS BEGIN
INSERT INTO table1 (col1, col2) VALUES (2, 'two');
INSERT INTO table1 (col1, col2) VALUES (4, 'four');
INSERT INTO table1 (col1, col2) VALUES (5, 'five');
END^

To add the header to each line, use a text editor with regex support such as notepad ++, aperter ctrl + H

First check the option regular expression , in find enter ^ (start of line) and in replace put INSERT INTO CIDADE (CODIGO,NOME,ESTADO) VALUES , at the beginning of each line this strings will be added.     

02.02.2016 / 13:06