10.6.3.3 rqJobResult Function

Use the rqJobResult function to return the job result.

Syntax

FUNCTION RQSYS.rqJobResult(
  job_id       VARCHAR2, 
  out_fmt      VARCHAR2 DEFAULT 'JSON'
)
RETURN SYS.AnyDataSet

Parameters

Parameter Description
job_id

The ID of the asynchronous job.

out_fmt
The format of the output returned by the function. It can be one of the following:
  • A JSON string that specifies the column names and data types of the table returned by the function. Any image data is discarded.
  • The string 'JSON', which specifies that the table returned contains a CLOB that is a JSON string.
  • The string 'XML', which specifies that the table returned contains a CLOB that is an XML string. The XML can contain both structured data and images, with structured or semi-structured R objects first, followed by the image or images generated by the R function.
  • The string 'PNG', which specifies that the table returned contains a BLOB that has the image or images generated by the R function. Images are returned as a base 64 encoding of the PNG representation.

Example

The following example shows a rqJobResult call and its output.

SQL> select * from rqJobResult(
    job_id => '<job id>',
    out_fmt => '{"val":"NUMBER","id":"NUMBER"}'
);
val id
  0.01 1
  0.02 2
  0.03 3
  0.04 4
  0.05 5
  0.06 6
  0.07 7
  0.08 8
  0.09 9
   0.1 10


10 rows selected.