Executing a script using ISQL

我们两清 提交于 2019-12-04 11:39:04

问题


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

回答1:


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




回答2:


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';


来源:https://stackoverflow.com/questions/5821562/executing-a-script-using-isql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!