Storing New Records

You create new records in three ways using the yql.storage.admin Open Data Table:

  1. value: Create a record and insert text into it.
  2. url: Create a record and insert content from an existing URL.
  3. name, url: Create a record with an execute key that you name and insert content from an existing URL.

Note

Any data you store within a record cannot exceed 100KB.

Upon creating a new record, YQL responds with three access keys, each of which serves a different function, as seen in the following response snippet:

There are three access keys associated with each record in storage, each starting with store://:

  • execute: This access key allows the value of the record to be used in a YQL statement containing use statements or referring to env files. You can share this access key with other developers, who can use the Open Data Table or environment file but will be unable to “read” the table definition or environment details.
  • select: This access key allows the value of the record to be used in YQL SELECT statements.
  • update: This access key allows the value of the record to be used in YQL UPDATE and DELETE statements.

Note

Knowing the execute, select, or update access key is sufficient to perform those operations on the stored record. You should only share with others the access key that grants the desired permissions.

Storing a New Record using Text

To create a new text record in storage for YQL, use the following statement format:

insert into yql.storage.admin (value) values ("example text content")

Storing a New Record using Data from an URL

To copy the contents of an URL, such as an environment file or Open Data Tables, into a new record for YQL, use the following statement format:

insert into yql.storage.admin (url) values ("http://hostingdomain.com/mytable.xml")

Storing a New Named Record using Data from an URL

To copy the contents of an URL, such as an environment file or Open Data Tables, into a new record with a custom execute access key, use the following statement format:

insert into yql.storage.admin (name,url) values ("newrecord","http://hostingdomain.com/mytable.xml")

When you create a record using the above format, the execute access key uses the name (newrecord) and top-level domain of the URL (hostingdomain.com) that you supply, as seen in the following response snippet:

Tip

Using the SET keyword in conjunction with a storage record, you can set and hide values, such as passwords, API keys, and other required values independently of YQL statements and API calls . For more information, refer to Setting Key Values for Open Data Tables.

Table of Contents