home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 December
/
PCWorld_1998-12_cd.iso
/
software
/
sybase
/
ASA
/
asa60.exe
/
data1.cab
/
scripts_files
/
dbconsol.sql
< prev
next >
Wrap
Text File
|
1998-07-27
|
5KB
|
152 lines
create procedure sa_console_userinfo( IN connidparm int default NULL )
result (
Number int,
Userid varchar(255),
ConnName varchar(255),
DBName varchar(255),
LastReq varchar(255),
LastReqTime varchar(255),
BlockedOnUser varchar(255),
CommLink varchar(255),
NodeAddr varchar(255)
)
begin
declare connid int;
declare connname varchar(255);
declare userid varchar(255);
declare dbname varchar(255);
declare lastreq varchar(255);
declare lastreqtime varchar(255);
declare blockedon int;
declare blockedonuser varchar(255);
declare commlink varchar(255);
declare nodeaddr varchar(255);
declare local temporary table t_conn_info(
C_Number int,
C_ConnName varchar(255),
C_Userid varchar(255),
C_DBName varchar(255),
C_LastReq varchar(255),
C_LastReqTime varchar(255),
C_BlockedOnUser varchar(255),
C_CommLink varchar(255),
C_NodeAddr varchar(255)
) in SYSTEM;
if( connidparm is not NULL ) then
set connid = connidparm;
else
set connid = next_connection( connid, NULL );
end if;
lbl:
loop
if( connid is NULL )then
leave lbl;
end if;
set userid = connection_property( 'Userid', connid );
set connname = connection_property( 'Name', connid );
set dbname = db_property( 'Name', cast (connection_property( 'DBNumber', connid ) as int) );
set lastreq = connection_property( 'ReqType', connid );
set lastreqtime = connection_property( 'LastReqTime', connid );
set blockedon = cast( connection_property( 'BlockedOn', connid ) as int);
if( blockedon = 0 ) then
set blockedonuser = '';
else
set blockedonuser = connection_property( 'Userid', blockedon );
end if;
set commlink = connection_property( 'CommLink', connid );
set nodeaddr = connection_property( 'NodeAddress', connid );
// print userid;
insert into t_conn_info values (
connid, connname, userid, dbname,
lastreq, lastreqtime, blockedonuser, commlink, nodeaddr
);
if( connidparm is not NULL ) then
leave lbl;
else
set connid = next_connection( connid, NULL );
end if;
end loop lbl;
select C_Number, C_ConnName, C_Userid, C_DBName,
C_LastReq, C_LastReqTime, C_BlockedOnUser, C_CommLink, C_NodeAddr
from t_conn_info;
end
go
create procedure sa_console_msginfo( IN startrow int default 0 )
result (
Row int,
Msg varchar(255)
)
begin
declare row int;
declare maxrow int;
declare msg varchar(255);
declare local temporary table t_msg_info(
C_Row int,
C_Message varchar(255)
) in SYSTEM;
if( startrow is not NULL ) then
set row = startrow;
else
set row = 0;
end if;
set maxrow = property( 'maxmessage' );
lbl:
loop
if( row >= maxrow )then
leave lbl;
end if;
set msg = property( 'Message', row );
insert into t_msg_info values (
row, msg
);
set row = row + 1;
end loop lbl;
select C_Row, C_Message
from t_msg_info;
end
go
create procedure sa_console_controlinfo( IN connidparm int default NULL )
result (
CheckpointUrgency int,
RecoveryUrgency int
)
begin
select isnull(property( 'CheckpointUrgency' ), 0 )
,isnull(property( 'RecoveryUrgency' ), 0 )
// ,isnull(property( 'QuittingTime' ), '' )
// ,isnull(property( 'TimeOutNoRequest' ), 0 )
// ,isnull(property( 'EncryptionEnabled' ), '' )
// ,isnull(property( 'MultiRecordFetching' ), '' )
// ,isnull(property( 'ConnectionsDisabled' ), '' )
from dummy;
end
go
% config_info->connections_disabled = _cs_option( _CONNECTIONS_DISABLED );
% config_info->logging = _cs_option( LOGGING );
% config_info->blocking = _cs_option( BLOCKING );
% config_info->encryption = Encryption;
% config_info->client_idle_shutdown = TimeOutNoRequest;
% config_info->quitting_time = Quitting_time;
% connection_property( 'Name', connid ),
% connection_property( 'Userid', connid ),
% connection_property( 'DBNumber', connid ),
% connection_property( 'ReqType', connid ),
% connection_property( 'LastReqTime', connid ),
% connection_property( 'BlockedOn', connid ),
% connection_property( 'CommLink', connid ),
% connection_property( 'ProcessTime', connid ),
% connection_property( 'Port', connid ),
% connection_property( 'NodeAddress', connid ),
% connection_property( 'LastIdle', connid ),
% connection_property( 'CurrTaskSw', connid ),
% connection_property( 'UncmtOps', connid )
co