Mercurial > hg > ltpda
comparison m-toolbox/classes/tests/database/@ltpda_database/getDataIdFromAoTable.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children | 79dc7091dbbc |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % | |
2 % DESCRIPTION: Returns the data ID (different only in a old databases) for | |
3 % the given object ID | |
4 % | |
5 % VERSION: $Id: getDataIdFromAoTable.m,v 1.1 2011/05/25 16:23:53 ingo Exp $ | |
6 % | |
7 function val = getDataIdFromAoTable(utp, objID) | |
8 | |
9 utp.conn.setLocked(true); | |
10 utp.conn.openConnection(); | |
11 c = utp.conn.getConn(); | |
12 | |
13 q = sprintf('SELECT data_id FROM ao WHERE ao.obj_id=%d', objID); | |
14 try | |
15 val = utils.jmysql.execute(c, q); | |
16 catch Me | |
17 utp.conn.setLocked(false); | |
18 utp.conn.closeConnection(); | |
19 rethrow(Me); | |
20 end | |
21 | |
22 utp.conn.setLocked(false); | |
23 utp.conn.closeConnection(); | |
24 end |