Home > database > mysql_get_sessinfo.m

mysql_get_sessinfo

PURPOSE ^

Returns session information for given sessions.

SYNOPSIS ^

function sessinfo = mysql_get_sessinfo(varargin)

DESCRIPTION ^

 Returns session information for given sessions.
 sessinfo = mysql_get_sessinfo(varargin)

 Returns information associated with one or more sessions provided in an array
 of sessions. Arguments are passed in as tag/value pairs.

 Supported input arguments (tags):
 'session_id' - vector of session IDs
 'conn_id' - mysql connection ID to utilize - REQUIRED

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function sessinfo = mysql_get_sessinfo(varargin)
0002 % Returns session information for given sessions.
0003 % sessinfo = mysql_get_sessinfo(varargin)
0004 %
0005 % Returns information associated with one or more sessions provided in an array
0006 % of sessions. Arguments are passed in as tag/value pairs.
0007 %
0008 % Supported input arguments (tags):
0009 % 'session_id' - vector of session IDs
0010 % 'conn_id' - mysql connection ID to utilize - REQUIRED
0011 
0012 % 01/26/07 Petr Janata
0013 % 06/01/07 Stefan Tomic - fixed handling of temp conn_ids
0014 % 06/10/15 PJ mysql_make_conn
0015 
0016 % Initialize some variables
0017 sessinfo = ensemble_init_data_struct;
0018 
0019 % Parse the input arguments
0020 narg = length(varargin);
0021 for iarg = 1:2:narg
0022   switch varargin{iarg}
0023     case {'session_id','session_ids'}
0024       sessids = varargin{iarg+1};
0025     case 'conn_id'
0026       conn_id = varargin{iarg+1};
0027     otherwise
0028       fprintf('mysql_get_sessinfo: Unknown input argument: %s\n', varargin{iarg});
0029   end
0030 end
0031 
0032 % Check for valid connection to database
0033 if ~exist('conn_id','var') || isempty(conn_id) || mysql(conn_id,'status')
0034   error('%s: Do not have a valid connection ID', mfilename);
0035 end
0036 
0037 sessinfo.type = 'session_info';
0038 
0039 % Call mysql_extract_data
0040 [sessinfo.data, sessinfo.vars] = mysql_extract_data('table','session','session_id',sessids,'conn_id',conn_id);
0041 
0042 return

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003