diff m-toolbox/classes/+utils/@mysql/getObjIds.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/+utils/@mysql/getObjIds.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,30 @@
+% GETOBJIDS gets a list of object ids from a given collection id.
+%
+% Usage: ids = getObjIds(conn,cid);
+%
+% Inputs:
+%     conn - a database connection object
+%     cid  - a collection id
+%
+% Outputs:
+%     ids  - a list of object ids
+%
+% M Hewitson 30-08-07
+%
+% $Id: getObjIds.m,v 1.2 2010/01/22 12:46:08 ingo Exp $
+%
+
+function ids = getObjIds(conn, cid)
+
+  error('### Obsolete as of LTPDA version 2.2. Replaced my the utils class jmysql (utils.jmysql.%s)', mfilename());
+  try
+    curs    = exec(conn, sprintf('select obj_ids from collections where id="%d"', cid));
+    curs    = fetch(curs);
+    ids     = str2num(curs.Data{1});
+    close(curs);
+  catch
+    error('### Unable to determine object IDs from collection ID. Server returned %s', curs.Message);
+  end
+
+end
+