Skip to content

ORACLE RANDOM Synonym #986

@capitantyler

Description

@capitantyler

I am working with a sample in a Oracle ODBC.

con <- DBI::dbConnect(
  drv = odbc::odbc(), 
  dsn = "oracle_dsn"
)

my_table <- tbl(con, in_schema("my_schema", "my_table"))

n <- 100
my_table  %>% slice_sample(n = n) %>% show_query()

Showing this query

SELECT
  "column 1",
  "column 2",
   ....
FROM (
  SELECT
      "column 1",
     "column 2",
       ....,
    ROW_NUMBER() OVER (ORDER BY **RANDOM()**) AS "q02"
  FROM ("my_schema"."my_table") 
) "q01"
WHERE ("q02" <= 100)

But ORACLE does not recognize RANDOM without the package prefix dbms_random (that statement works replacing RANDOM() by dbms_random.RANDOM()).

I do not have privileges to make that synonym in my Oracle database, but I thought should do not assume a synonym.

Could you add the prefix or show me how to? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions