Difference between revisions of "REST API:execSQL Resource"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
Use the SQL query language to access Object tables, using the [[REST API]].
Use the SQL query language to access Object tables, using the [[REST API]].
:''Learn more:'' REST API [[REST API#Conventions and Considerations|Conventions and Considerations]].
:''Learn more:'' REST API [[REST API#Conventions and Considerations|Conventions and Considerations]].


{{Note|Use this structure the same way you use the structure for man pages:<br/>Follow the presentation pattern, but if a section isn't needed, don't include the header.<br/>Also:
===Permissions===
# Add an entry to the [[REST API:REST API CheatSheet|REST API CheatSheet]]
{{permissionRef|Customize Objects|use this resource.}}
# Add an entry to the [[REST API]] (categorized) page
# Add an entry to the [[REST API:REST Resources (alphabetical)|REST Resources]] page
}}
 
===Requirements===
:* Requirement #1
:* Requirement #2


===Permissions===
===Execute a SQL Query===
{{TBD|Are the permission(s) right?}}
Use the SQL query language to execute a query against Object tables.
:* [[Develop Tools]] permission must be enabled for the tenant.
{{permissions|Manage Develop Features|use this resource.}}


===Execute an SQL Query===
''Learn more:''
:* [[SQL Browser]]
:* [[SQL Syntax]]
:* [[SQL Functions]]


;Method:GET
;Method:GET
   
   
;URI:<tt><nowiki>https://{domain}/networking/rest/execSQL?sql={query}</nowiki></tt>  
;URI:<tt>{{platformURL}}/rest/execSQL?sql={query}</tt>  


{{Query Parameters|
{{Query Parameters|
:*<tt>sql</tt> - The SQL language query to execute.}}
:*<tt>sql</tt> - The [[SQL Syntax|SQL language query]] to execute, with special characters encoded}}


;Response:
;Response:
The tag names (shown here as field1, field2, etc.) are the column names specified in the query, or their aliases.
:<syntaxhighlight lang="xml" enclose="div">
:<syntaxhighlight lang="xml" enclose="div">
<platform>
<platform>
     <execSQL>
     <record>
         <id>...</id>
         <field1>...data...</field1>
         <field>data</field>
         <field2>...data...</field2>
         ...
         ...
     </execSQL>
     </execSQL>
Line 40: Line 34:
         <description>Success</description>
         <description>Success</description>
     </message>
     </message>
     <recordCount>N</recordCount>      <!-- Number of __ records returned -->
     <recordCount>N</recordCount>      <!-- Number of records returned by the query -->
</platform>
</platform>
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 20:34, 29 March 2013

Use the SQL query language to access Object tables, using the REST API.

Learn more: REST API Conventions and Considerations.

Permissions

Lock-tiny.gif

Users that have the Customize Objects permission can use this resource.. 

Execute a SQL Query

Use the SQL query language to execute a query against Object tables.

Learn more:

Method
GET
URI
https://{yourDomain}/networking/rest/execSQL?sql={query}
Query Parameters
For more information, see: Specifying Query Parameters in REST APIs
Response

The tag names (shown here as field1, field2, etc.) are the column names specified in the query, or their aliases.

<platform>
    <record>
        <field1>...data...</field1>
        <field2>...data...</field2>
         ...
    </execSQL>

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
    <recordCount>N</recordCount>      <!-- Number of records returned by the query -->
</platform>
See also: REST API:Error Codes