Expected end of statement, encounterd EOF


This happens when you import the file with SQL statements into isql. When you use -i or 'in' to import the file, it's as if you typed the file contents into isql yourself. For example, this is a valid SQL statement:

INSERT INTO t1(x) VALUES (10)

If you save this as a file and import into isql, you'll get the error. Imagine you typed that into isql manually. It would be happy waiting for further input after the closed bracket, and won't do anything until you type semi-colon and press enter. So, make sure you complete your statements:

INSERT INTO t1(x) VALUES (10);

And also make sure that you have a newline character at the end of the last line. Same as with manual input: isql doesn't execute a line until you hit Enter.

The other problem is transaction management. If you run isql with -i it quits at the end without committing the transaction. So, if you have non-DDL statements at the end of file, make sure you add COMMIT; after it:

INSERT INTO t1(x) VALUES (10);
COMMIT;

Now, you can expect to see that 10 value in the table.


Do you find this FAQ incorrect or incomplete? Please e-mail us what needs to be changed. To ensure quality, each change is checked by our editors (and often tested on live Firebird databases), before it enters the main FAQ database. If you desire so, the changes will be credited to your name. To learn more, visit our add content page.



All contents are copyright © 2007-2024 FirebirdFAQ.org unless otherwise stated in the text.


Links   Firebird   News   FlameRobin   Powered by FB: Home Inventory   Euchre  
Add content   About  

Categories
 Newbies
 SQL
 Installation and setup
 Backup and restore
 Performance
 Security
 Connectivity and API
 HOWTOs
 Errors and error codes
 Miscellaneous