Since an LTPDA repository is just a MySQL database, you can query the database using standard SQL commands via any of the popular MySQL clients. In addition, the LTPDA toolbox provides a simplified command that can be used to execute simple queries with only basic SQL knowledge. The command is called ltpda_dbquery and it can be used to perform various queries.
server | A server hostname |
dbname | The name of the database to query |
tablename | The name of the table to search |
query | The query string |
>> info = ltpda_dbquery(server, dbname, 'objmeta', 'id>1000 and id<2000'); >> info = ltpda_dbquery(server, dbname, 'objmeta', 'name like "x12"'); >> info = ltpda_dbquery(server, dbname, 'users', 'username="aouser"'); >> info = ltpda_dbquery(server, dbname, 'collections', 'obj_ids="1, 2"'); >> info = ltpda_dbquery(server, dbname, 'transactions', 'user_id=3'); >> info = ltpda_dbquery(server, dbname, 'transactions', 'obj_id=56');
>> info = ltpda_dbquery(server, dbname)
% Get a list of tables info = ltpda_dbquery(server, dbname, 'show tables') % Get a table description info = ltpda_dbquery(server, dbname, 'describe objmeta') % Get a list of all AO IDs info = ltpda_dbquery(server, dbname, 'select obj_id from objmeta where obj_type="ao"') % Find all objects submitted in a particular time range q = ['select obj_id from transactions where '... 'transdate>"2007-11-14 00:00:00" and '... 'transdate<"2007-11-15 00:00:00"']; info = ltpda_dbquery(server, dbname, q)