Skip to Main Content

Data Science & Machine Learning

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ODM SQL Node: Using R scripts

hvaleriaOct 21 2014 — edited Oct 21 2014

Is there a way to use R scripts in an ODM workflow without defining the output?

So that ODM identifies the number and types of columns from the output.

Currently I use R scripts as follows:

If there are n1 character columns and n2 numeric columns in the output from the script then I use something like:

    

select * from table(rqTableEval

  ( CURSOR (

  SELECT

   *

  FROM

  TABLE1

   )

   , -- Input Cursor

  cursor(select * from dual)

  ,           -- Param Cursor

  'select

   cast(null as varchar2(100)) char_col1,

   cast(null as varchar2(100)) char_col2,

   ... ,

   cast(null as varchar2(100)) char_coln1,

   0 as num_col1,

   0 as num_col2,

   ... ,

   0 as num_coln2

   from dual',      -- Output Definition

   'rscript' -- R Script

  ))

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 18 2014
Added on Oct 21 2014
1 comment
934 views