Alters an OData Producer.
ALTER ODATA PRODUCER name [ producer-clause... ]
producer-clause: [ ADMIN USER { NULL | user } ] [ AUTHENTICATION [ DATABASE | USER user ] ] [ [ NOT ] ENABLED ] [ MODEL [ FROM ] { FILE string-or-variable [ ENCODING string ] | VALUE string-or-variable [ ENCODING string ] } ] [ [ SERVICE ] ROOT string ] [ USING { string | NULL } ]
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.
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 /.
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.
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:
CREATE ODATA PRODUCER dave_producer
MODEL FROM FILE 'dave.txt'
SERVICE ROOT '/odata/dave'
AUTHENTICATION USER dave
USING 'ReadOnly=true;RepeatRequestForDays=10';
If you then want to temporarily disable this OData Producer, execute the following statement:
ALTER ODATA PRODUCER dave_producer NOT ENABLED;
To remove the read-only restriction but retain the repeatable request limit, and re-enable the OData Producer, execute the following statement:
ALTER ODATA PRODUCER dave_producer ENABLED USING 'ReadOnly=false;RepeatRequestForDays=10';