The Find Relational Table command allows you to search and return details for one or more tables.
Arguments
The Find Relational Table command requires the following arguments: Command, Realm, Password.
api_web?r=myrealm&p=mypass&c=rdbfindtables
The command is 'relationalfindtables', the realm is 'myrealm' and the password is 'mypass'. This command returns a list of all tables in the realm.
The Find Relational Table command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=rdbfindtables c=rdbfindtables |
Realm |
Yes |
Name of the realm to run the command. This is required, and the command will fail if the realm and password do not match. |
realm=[realm_name] r=[realm_name] |
Password |
Yes |
Authentication code for API access. This is required, and the command will fail if the realm and password do not match. |
pwd=[password] p=[password] |
Show Unique ID |
|
Include the Unquie ID in the results. |
show_uniqueid=[0,1] DEFAULT==1 |
Show Foreign Key |
|
Include the Foreign Key in the results. |
show_foreign_key=[0,1] DEFAULT==1 |
Relational Table Status |
|
Limit results to tables with given status. |
relational_status=[all, active,pending,inactive, deleted] DEFAULT==all |
Show Row Count |
|
Include the count of the number of data rows in a table. |
show_row_count=[0,1] DEFAULT==0 |
Output Format |
|
To specify the format of the list output, use one of two arguments. If no argument is included, the default output is space-delimited plain text string. |
csv=1 or output_format=[csv,csv_tab, csv_pipe,xml] DEFAULT==csv |
Header |
|
To define the data with a label, use the Header argument. This can only be used in conjunction with the output format, and does not affect XML. |
headers=[0,1] DEFAULT==0 |
Example
Using all commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=rdbfindtables&show_uniqueid=1&show_foreign_key=1&relational_status=active&show_row_count=1&output_format=csv&headers=1
Successful results return:
SUCCESS: 4 Tables found "TableName","Status","UniqueKey","ForeignKey","DataRows" "subscribers","active","subscriber_id","","740" "vehicles","active","vehicle_id","","10" "pets","active","pet_id","","192" "books","active","book_id","","2"
Results
The Find Relational Table command outputs either a SUCCESS or FAILURE message.
SUCCESS
The Find Relational Table command success message returns the SUCCESS message. It also outputs the details in plain text format. Use the output_format argument to return the results in an alternate format. The result format is:
SUCCESS: [number] Tables found [query_results]
FAILURE
The Find Relational Table command will fail for several reasons. The result format is:
FAILURE: [Reason]