1
Good guys a little while ago I started using the Firebird and I have the following problem , when trying to insert some data directly in the IB Expert
it returns me the following error :
Invalid token. Dynamic SQL Error. SQL error code = -104. Token Unknown - line 4, column 1. (.
I am 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 gets kind of out of hand to insert one die at a time because there are more than 5,000 cities, when I try to insert only one die at a time for sure .
Would not be a
,
in place of;
if you don’t need to repeat the header(insert ....
)– rray
You need to make an INSERT for each record. As there are many, make a script that manages it for you. Surely, you have the city data somewhere (a text file, for example). Make a script to go through this file and produce another file with Inserts for each city.
– cantoni
@rray I’ve tried both ways but always returns me the error in the second line
– Matheus Goes
@Even Cantoni with multiple Insert headers makes me same error
– Matheus Goes
@Matheusgoes, you said that one at a time works, so it must be some sort of separator that you need to use between one INSERT and another. I don’t remember FB enough to tell you exactly what that separator is, but it certainly exists.
– cantoni
Which version of fb are you using? tried
EXECUTE BLOCK
?– rray
as I said I’m new to firebid so I probably haven’t tried EXECUTE BLOCK , but I’ll search to see if it can be why
– Matheus Goes
My Version of Firebird 2.5.0
– Matheus Goes