JAQL_SUBMIT

The JAQL_SUBMIT function invokes an IBM® InfoSphere® BigInsights® Jaql query from a Db2 application.

Read syntax diagramSkip visual syntax diagramJAQL_SUBMIT( jaql-script, return-string, url, options )

The schema is SYSFUN.

jaql-script
Specifies a script that contains one or more Jaql queries, with or without parameter declarations. jaql-script is a VARCHAR(8000) value.
return-string
Specifies a string that is used as the returned value when the Jaql script completes successfully. return-string is a VARCHAR(512) value.
url
Specifies the URL of a Jaql server that accepts requests from the Db2 client, runs the queries that are specified in jaql-script, and returns results. url is a VARCHAR(512) value.
options
An expression that specifies a list of name=value pairs. Each pair must be separated from the following pair by a space character. options is a VARCHAR(256) value. options can contain any of the following name and value pairs:
timeout=timeout-value
Specifies the maximum time in seconds to wait for results to be returned from the Jaql server that is specified in the url parameter.
user=user-value
Specifies an IBM InfoSphere BigInsights user name that has access to the Jaql server.
password=password-value
Specifies the password for the IBM InfoSphere BigInsights user that is identified by user=user-value.

The JAQL_SUBMIT function returns a VARCHAR(512) string that contains the results of executing the Jaql script.

Example 1: Submit a Jaql script to a Jaql server. The Jaql script writes an array to a file, in delimited format. The URL of the Jaql server is http://jaqlsrv.svl.ibm.com:8080. Do not specify the string that is to be returned if the script completes successfully. Wait for a maximum of 60 seconds for output to be returned.
SELECT SYSFUN.JAQL_SUBMIT(
 '[[15.3, 16],[170.99,180]]->
 write(del(location=''/tmp/test1.csv''));',
 '',
 'http://jaqlsrv.svl.ibm.com:8080',
 'timeout=60 user=biadmin password=passw0rd')
 FROM SYSIBM.SYSDUMMY1;