MYSQL_GETOBJTYPE gets the object type associated with the given object id. Usage: ids = mysql_getObjType(conn,id); Inputs: conn - a database connection object id - an object id Outputs: type - the type of this object M Hewitson 30-08-07 $Id: mysql_getObjType.html,v 1.12 2008/03/31 10:27:42 hewitson Exp $
0001 function type = mysql_getObjType(conn, id) 0002 0003 % MYSQL_GETOBJTYPE gets the object type associated with the given object id. 0004 % 0005 % Usage: ids = mysql_getObjType(conn,id); 0006 % 0007 % Inputs: 0008 % conn - a database connection object 0009 % id - an object id 0010 % 0011 % Outputs: 0012 % type - the type of this object 0013 % 0014 % M Hewitson 30-08-07 0015 % 0016 % $Id: mysql_getObjType.html,v 1.12 2008/03/31 10:27:42 hewitson Exp $ 0017 % 0018 0019 0020 try 0021 curs = exec(conn, sprintf('select obj_type from objmeta where obj_id="%d"', id)); 0022 curs = fetch(curs); 0023 type = curs.Data{1}; 0024 close(curs); 0025 catch 0026 warning('!!! Unable to get object type for ID %d. [Server returned: %s]', id, curs.Message); 0027 type = ''; 0028 end 0029