How to add, remove, modify users using SQL?
With Firebird 2.5 and above, you can use CREATE, ALTER and DROP USER commands.
CREATE USER fadmin PASSWORD 'fbfaq12';
ALTER USER fadmin FIRSTNAME 'Firebird' LASTNAME 'Admin';
ALTER USER fadmin PASSWORD 'newpass123';
DROP USER fadmin;
To do this, you have to connect to a database (for example, employee.fdb). The privileges depend on the user type. Only SYSDBA can
CREATE and DROP users. Ordinary users can ALTER his own password and first, middle and last name. If you wish to allow some user other than SYSDBA to administer other users, you should grant him the RDB$ADMIN role in security database. Since no user can connect to security database directly, you need to connect to any regular database and issue a special GRANT ADMIN ROLE command. For example, if you wish user MIKE to be able to administer other users, connect to a database as SYSDBA and then run:
ALTER USER MIKE GRANT ADMIN ROLE;
Note that MIKE must supply the role RDB$ADMIN when connecting to a database to get the privileges. Most administration tools have the role option on login screen (alongside username and password), with ISQL you can use -role or -r2 options. For more details, please refer to Firebird 2.5 release notes under Administrative Features section.
With earlier Firebird versions you need to use service API. Access to it is provided by most connectivity libraries (except ODBC). Please do the same search on FAQ without SQL keyword to get the relevant info.
With earlier version of Firebird, you can also use open source rFunc UDF library which has functions for user manipulation:
http://rfunc.sourceforge.net