Subject specific output from ISQL
Author Andrew Zenz

Hi everyone.


I am cloning a DB using a recipe found at: via a batch script (Windows) but prior to cloning it, I wanted to see if there were any active connections to the destination (to avoid errors).


I run this command:

echo set heading; select rtrim(ltrim(count(mon$attachment_id))) from mon$attachments; | isql %DBPlay% -u %DBA% -p %DBPASS% -q


and get the following output:


Database:  employee.fdb, User: sysdba




All I want is 2, none of the other stuff, so I can plug it into a variable, compare it etc.  Is it possible or am I way off the mark or is there a better tool?




Andrew Zenz