Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - SQL Reference » SQL statements » Alphabetical list of SQL statements


Alters an OData Producer.

ALTER ODATA PRODUCER name [ producer-clause... ]
[ ADMIN USER { NULL | user } ]
[ MODEL [ FROM ] { FILE string-or-variable [ ENCODING string ] | VALUE string-or-variable [ ENCODING string ] } ]
[ [ SERVICE ] ROOT string ]
[ USING { string | NULL } ]
  • ADMIN USER clause Specifies an administrative user that the OData Producer uses to create tables, a procedure, and an event to manage repeatable requests. The user must have the CREATE TABLE, CREATE PROCEDURE, MANAGE ANY EVENT, and VERIFY ODATA system privileges. This user cannot be the same user specified by the AUTHENTICATION clause.
  • AUTHENTICATION clause Specifies how the OData server connects to the database. Specify the DATABASE for users to connect with personalized credentials. These credentials are requested by using Basic HTTP authentication. Specify the USER for all users to connect by using the connection string of the specified user. The specified user must have the VERIFY ODATA system privilege. The USER is recommended for testing and read-only producers.
  • ENABLED clause Specifies whether this OData Producer is enabled or disabled. By default, OData Producers are enabled.
  • MODEL clause

    Specifies the OData Producer service model (given in OSDL) that indicates which tables and views are exposed in the OData metadata. If you specify the FILE clause, then the value must be a variable or string of the file name that contains the OSDL data. If the file name is not fully qualified, then the path is relative to the database server's current working directory. If the file name is specified, then the file is read and the contents of the file are stored in the database and logged in the transaction log. By default, tables and views are exposed based on user privileges. Tables and views without primary keys are not exposed.

    Use the ENCODING clause to specify the character set of the model data or file. The default is UTF-8.

  • SERVICE ROOT clause

    Specifies the root of the OData service on the OData server. All resources for the OData Producer are accessed by using URIs of the following format: scheme:host:port/path-prefix/resource-path[query-options].

    The SERVICE ROOT clause is /path-prefix. The value cannot be NULL and must start with /.

  • USING clause

    This string specifies additional OData Producer options. Options are specified in a semicolon-separated list of name=value pairs. If the USING clause is altered, then you must repeat all values that you want to retain.

    Option Description
    ConnectionPoolMaximum = num-max-connections

    Indicates the maximum number of simultaneous connections that this OData Producer keeps open for use in the connection pool.

    Fewer connections might be used by the connection pool depending on the OData server load.

    By default, the connection pool size is limited to half of the maximum number of simultaneous connections that the database server supports.

    CSRFTokenTimeout = num-seconds-valid

    Enables CSRF token checking and specifies the number of seconds that a token is valid for.

    By default, this value is 0, which disables CSRF token checking. Otherwise, the number of seconds must be a valid integer value from 1 to 1800.

    PageSize = num-max-entities

    Specifies the maximum number of entities to include in a retrieve entity set response before issuing a next link.

    The default setting is 100.

    ReadOnly = { true | false }

    Indicates whether modification requests should be ignored.

    The default setting is false.

    RepeatRequestForDays = { days-number }

    Specifies how long repeatable requests are valid.

    This value must be an integer ranging from 1 to 31.

    The default setting is 2.

    This option is only effective when the ADMIN USER clause is not NULL.

    SecureOnly = { true | false }

    Indicates whether the Producer should only listen for requests on the HTTPS port.

    The default setting is false.

    ServiceOperationColumnNames = { generate | database }

    Specifies whether the column names in the metadata should be generated or taken from the result set columns in the database when naming the properties of the ComplexType used in the ReturnType.

    The default setting is generate.


Alters an OData Producer that runs as a sub-process of the database server.


You must have the MANAGE ODATA system privilege.

If you specify the AUTHENTICATION USER clause or the ADMIN USER clause, then the specified users must have the VERIFY ODATA system privilege.

Side effects

If the OData Producer is running, then it may be stopped and restarted.


Assume that you want to create an OData Producer that accesses objects owned by user Dave through a URL beginning with /odata/dave and that you have a model file called dave.txt that contains details of the tables that you want to expose. You also want to ensure that no data can be updated through the OData interface and that requests are repeated for up to ten days. Create an OData Producer called dave_producer by executing the following statement:

MODEL FROM FILE 'dave.txt' 
SERVICE ROOT '/odata/dave' 
USING 'ReadOnly=true;RepeatRequestForDays=10';

If you then want to temporarily disable this OData Producer, execute the following statement:


To remove the read-only restriction but retain the repeatable request limit, and re-enable the OData Producer, execute the following statement:

USING 'ReadOnly=false;RepeatRequestForDays=10';