Does DB2 UDB 8.x have any feature equivalent to the LOGIN_PROCEDURE
option in iAnywhere Solutions SQL Anywhere? (see description below)
I want to execute a SET SCHEMA statement whenever a new connection
starts.
Breck
SQL Anywhere Studio 9 Developer's Guide
http://www.risingroad.com/SQL_Anywhe...ers_Guide.html
=====
From the manual...
http://www.ianywhere.com/developer/p...9/00000698.htm
LOGIN_PROCEDURE option [database]
Function
A login procedure that sets connection compatibility options at
startup. By default the procedure calls the sp_login_environment
procedure to determine which options to set.
Allowed values
String
Scope
DBA authority required.
Default
sp_login_environment
Description
This login procedure calls the sp_login_environment procedure at run
time to determine the database connection settings.
You can customize the default database option settings by creating a
new procedure and setting LOGIN_PROCEDURE to call the new procedure.
You should not edit either sp_login_environment or
sp_tsql_environment.
Examples
The following example shows how you can disallow a connection by
signaling the INVALID_LOGON error.
create procedure DBA.login_check()
begin
declare INVALID_LOGON exception for sqlstate '28000';
// Allow a maximum of 3 concurrent connections
if( db_property('ConnCount') > 3 ) then
signal INVALID_LOGON;
else call sp_login_environment;
end if;
end
go
grant execute on DBA.login_check to PUBLIC
go
set option PUBLIC.Login_procedure='DBA.login_check'
go