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!

Execute stored procedures

Matteo CastagnaMar 24 2016 — edited Mar 26 2016

Hi, I installed the ROracle package successfully and I am able to use the dbGetQuery() and dbSendQuery () statements without any issues on a given connection.

OrclDFWide <- dbGetQuery(conOrcl, paste("SELECT *",

                                       "FROM  FIRE_USER.BBG_PORT_FACTORSET_V",

                                       "WHERE business_date >= TO_DATE('2015/09/01', 'yyyy/mm/dd')",

                                       "AND business_date <= TO_DATE('2015/09/30', 'yyyy/mm/dd')")

  )

> str(OrclDFWide)
'data.frame': 126464 obs. of 11 variables:

I now have the problem that IT wants me to interact with a database (adding/replacing records) via stored procedures they have implemented.

Those stored procedures works fine if I run then from my Oracle SQL Developer window:

execute fire_user.metric_pkg.set_metric_holding_num ('bbg port', 'varSet', '04-MAR-16', 'EPMAS', 'US ULTRA BOND CBT Mar16', 'VaRMCPort', 0.0166);

anonymous block completed

No matter what I do in R (using dbGetQuery() or dbSendQuery() with or without ";") I get an error:

dbSendQuery(conn = conOrcl, statement = stmnt)

    print(stmnt)

> print(stmnt)
[1] "execute fire_user.metric_pkg.set_metric_holding_num ('bbg port','holdingSet','23-Mar-16','EPMAS','EURO BUXL 30Y BND Jun16_EconomicCash','Wgt',-0.19)"

> dbGetInfo(conOrcl)
$username

[1] "a566848"

....

What would be the right syntax?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 23 2016
Added on Mar 24 2016
3 comments
1,904 views