9

I'm creating a simple isql script but it's not working and I need some help to find out whats wrong with it.
I need to connect to a database and execute a SQL file. This is my script called script.sql:

CONNECT 'localhost:C:\Monde\Servidor\db\monde.fdb' USER 'SYSDBA' PASSWORD 'masterkey';    
update usuario  
set senha = 'MYkWEn0kHLHHdm'  
where login = 'rose'

When I try to connect to my database using.:

isql.exe -i script.sql

I get this follow message.:

Use CONNECT or CREATE DATABASE to specify a database
Expected end of statement, encountered EOF
Valentin Lorentz
  • 9,556
  • 6
  • 47
  • 69
user729661
  • 91
  • 1
  • 1
  • 2

2 Answers2

9

Ok although it's an old question I found out how to do it, you just need to append de -q parameter, like this:

isql.exe -q -i script.sql

Source:

iSQL Reference form Destructor.de

Luis Carrasco
  • 467
  • 3
  • 10
5

Append a semicolon to the end of the UPDATE statement:

CONNECT 'localhost:C:\Monde\Servidor\db\monde.fdb' USER 'SYSDBA' PASSWORD 'masterkey';
update usuario
set senha = 'MYkWEn0kHLHHdm'
where login = 'rose';
Quassnoi
  • 413,100
  • 91
  • 616
  • 614
  • Use CONNECT or CREATE DATABASE to specify a database Statement failed, SQLSTATE = 42000 Dynamic SQL Error -SQL error code = -104 -Unexpected end of command - line 1, column 8 After line 1 in file usuario.sql Command error: set senha = 'MYkWEn0kHLHHdm' where login = 'rose' – user729661 Apr 28 '11 at 16:29
  • @user: put a newline after the last line. – Quassnoi Apr 28 '11 at 16:32
  • @user: put the cursor to the end of file, after the final semicolon, and press `Enter`. – Quassnoi Apr 28 '11 at 20:09
  • @user: can't help you then. I just reproduced this on my `Firebird 1.5`, it works. Please copy and paste the commands from my answer. – Quassnoi Apr 28 '11 at 21:14
  • Well, it worked. I forgot to add a comma after "update usuario". Thank you so much for your help. – user729661 Apr 29 '11 at 13:03