comparison m-toolbox/classes/tests/database/@ltpda_xydata_table/getTableEntry.m @ 25:79dc7091dbbc database-connection-manager

Update tests
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
comparison
equal deleted inserted replaced
24:056f8e1e995e 25:79dc7091dbbc
16 16
17 % Check that we get only one result for the query 17 % Check that we get only one result for the query
18 assert(numel(dataID)==1, sprintf('Found more than one data ID for the given object ID %d', objID)); 18 assert(numel(dataID)==1, sprintf('Found more than one data ID for the given object ID %d', objID));
19 19
20 % Create query to get the field 'xunits' from the 'cdata' table 20 % Create query to get the field 'xunits' from the 'cdata' table
21 query = sprintf('SELECT %s FROM %s WHERE %s.id=%d', tableField, dbTable, dbTable, dataID{1}); 21 query = sprintf('SELECT %s FROM %s WHERE %s.id = ?', tableField, dbTable, dbTable);
22 val = executeQuery(utp, query); 22 val = utils.mysql.execute(utp.conn, query, dataID{1});
23 catch Me 23 catch Me
24 rethrow(Me); 24 rethrow(Me);
25 end 25 end
26 26
27 elseif 1~=1 27 elseif 1~=1
28 %%% new database layout 28 %%% new database layout
29 else 29 else
30 throw(MException('ltpda_cdata_table:getTableEntry', 'Unknown database layout.')); 30 throw(MException('ltpda_cdata_table:getTableEntry', 'Unknown database layout.'));
31 end 31 end
32 32
33 utp.conn.setLocked(false);
34 utp.conn.closeConnection();
35 end 33 end