0

I'm working on a C# program getting out data from an Oracle database. I have ODAC installed (just updated to version 12.2c), connecting to a 12.1 Oracle database and referencing Oracle.DataAccess in my project

In one of my queries, I want to use the well-known "hack" exp(sum(ln(col))) to multiply some values. However it seems that the ln-function is not supported when I connect with the database via ODAC. I get an error message saying "invalid role". The same query works perfectly in Oracle SQL Developer.

Something as simple as:

select ln(value) from table where id=1

will fail, whereas

select sum(value) from table where id=1

works just fine. Is the ln-function simply not supported in ODAC? Do I need to add another reference? If not, how can I get it working in a .NET program? IDE is VS2015.

schneiju
  • 115
  • 1
  • 1
  • 9

1 Answers1

0

Turned out to just be a rather misleading error message. The root issue was conversion from a high-precision Oracle number to a .NET decimal. So using TRUNC(exp(sum(ln(col))),12) fixed the issue.

schneiju
  • 115
  • 1
  • 1
  • 9