0001 function [update_flag] = vb_table_query_update_flag(tbl, key)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 if ~exist('tbl', 'var')
0018 error('tbl is a required parameter.');
0019 end
0020 if ~exist('key', 'var')
0021 error('key is a required parameter.');
0022 end
0023 if ~ischar(key)
0024 error('key should be string.');
0025 end
0026
0027
0028
0029
0030
0031 update_flag = [];
0032
0033 if ~isempty(tbl)
0034 if ~isfield(tbl(1), 'update_flag')
0035 error('Specified table doesn''t have ''update_flag'' field.');
0036 end
0037 ix = strmatch(key, {tbl.key}, 'exact');
0038 if ~isempty(ix)
0039 update_flag = tbl(ix).update_flag;
0040 end
0041 end