Bindings Required for I/U/D

I/U/D statements rely entirely on appropriate bindings within an Open Data Table to be usable. Specifically, you must use an insert, update, or delete bindings element. These elements help to determine what happens with the information you pass in through a YQL statement.

Consider the following INSERT statement for shortening URLs using

INSERT INTO bitly.shorten (login, apiKey, longUrl) VALUES ('USERNAME', 'API_KEY', '')

The corresponding Open Data Table for this statement follows:

Run this example on the YQL console


To run the example, you must replace USERNAME and API_KEY in the YQL statement with your actual username and API key (available through your account page).

The above Open Data Table shows one of the most basic ways to use an INSERT statement because it does not require JavaScript to massage the data. Consequently, it requires no execute element. It simply uses the login and apiKey as keys to authenticate the user, with the longUrl as the new value passed to the API. For more information on how the key, value, and map values are used, refer to key/value/map elements in Using Open Data Tables.


In the above example, the url element contains a URI template to aid in the construction of the URI:


Here the join operator creates a key-value pair using the variable longURL along with its value. This pair is preceded by the ampersand symbol (&).

Table of Contents