Mercurial > hg > ltpda
comparison m-toolbox/classes/+utils/@mysql/getMaxId.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % GETMAXID get the maximum Id from the objs table. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: GETMAXID get the maximum Id from the objs table. | |
5 % | |
6 % CALL: id = getMaxId() | |
7 % | |
8 % VERSION: $Id: getMaxId.m,v 1.2 2010/01/22 12:46:08 ingo Exp $ | |
9 % | |
10 % HISTORY: 24-05-2007 M Hewitson | |
11 % Creation | |
12 % | |
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
14 | |
15 function id = getMaxId(conn) | |
16 | |
17 error('### Obsolete as of LTPDA version 2.2. Replaced my the utils class jmysql (utils.jmysql.%s)', mfilename()); | |
18 q = 'select max(id) from objs'; | |
19 curs = exec(conn, q); | |
20 curs = fetch(curs); | |
21 id = curs.Data{1}; | |
22 close(curs); | |
23 | |
24 if isnan(id) | |
25 id = 0; | |
26 end | |
27 | |
28 end | |
29 |