Forum Stats

  • 3,750,519 Users
  • 2,250,187 Discussions
  • 7,866,997 Comments

Discussions

ore.exec doesn't work

3631507
3631507 Member Posts: 45
edited Oct 29, 2019 8:16PM in R Technologies

Has anyone encountered problems with ore.exec? I tried a simple SQL statement like

df <- ore.exec("SELECT * FROM TABLE*) and df is NULL. The same statement executes properly in SQL Developer.

As part of troubleshooting, I've added ore.attach("schema_name") or ore.attach() before that but makes not difference.

Best Answer

  • Sherry Lamonica-Oracle
    Sherry Lamonica-Oracle Posts: 437 Employee
    edited Oct 29, 2019 12:04PM Accepted Answer

    This is the correct result. The ore.exec() function is intended for Database Definition language (DDL) statements that have no return value.

    Instead, try invoking ore.sync() with the 'query' argument to create an ore.frame object:

    > ore.create(iris, "IRIS")

    > ore.sync(query = c("MY_QUERY" = "select * from IRIS"))

    > class(MY_QUERY)

    [1] "ore.frame"

    attr(,"package")

    [1] "OREbase"

    > head(MY_QUERY)

      Sepal.Length Sepal.Width Petal.Length Petal.Width Species

    1          5.1         3.5          1.4         0.2  setosa

    2          4.9         3.0          1.4         0.2  setosa

    3          4.7         3.2          1.3         0.2  setosa

    4          4.6         3.1          1.5         0.2  setosa

    5          5.0         3.6          1.4         0.2  setosa

    6          5.4         3.9          1.7         0.4  setosa

    Sherry

    3631507

Answers

  • Sherry Lamonica-Oracle
    Sherry Lamonica-Oracle Posts: 437 Employee
    edited Oct 29, 2019 12:04PM Accepted Answer

    This is the correct result. The ore.exec() function is intended for Database Definition language (DDL) statements that have no return value.

    Instead, try invoking ore.sync() with the 'query' argument to create an ore.frame object:

    > ore.create(iris, "IRIS")

    > ore.sync(query = c("MY_QUERY" = "select * from IRIS"))

    > class(MY_QUERY)

    [1] "ore.frame"

    attr(,"package")

    [1] "OREbase"

    > head(MY_QUERY)

      Sepal.Length Sepal.Width Petal.Length Petal.Width Species

    1          5.1         3.5          1.4         0.2  setosa

    2          4.9         3.0          1.4         0.2  setosa

    3          4.7         3.2          1.3         0.2  setosa

    4          4.6         3.1          1.5         0.2  setosa

    5          5.0         3.6          1.4         0.2  setosa

    6          5.4         3.9          1.7         0.4  setosa

    Sherry

    3631507
  • 3631507
    3631507 Member Posts: 45
    edited Oct 29, 2019 7:51PM

    Thanks Sherry.