Can I call MS Excel Function in Oracle
Hi everyone,
I prototyped my application in Microsoft Excel. In this prototype, I'm using the BETADIST() function, which returns the cumulative beta probability density function. And, yes, if you're like me, and not a statistician, it's pretty crazy. Just for fun, check out the wikipedia page on it, and you'll see what I mean. Anyway, so now, I'm trying to perform the same functionality as that function in my Oracle APEX 4.0/Oracle 10g-R2 app.
I've studied this function a bunch, and I couldn't find an equivalent function in Oracle to do what this function does. CUME_DIST... nope, DBMS_STATS_FUNC... nope. So, I assumed I would need to figure out what exactly the function does and basically rewirte it in Oracle using PL/SQL. I've already got questions out on Statistics and Excel forums trying to figure that out.
But, before I go any further and reinvent the wheel by coding out the logic embedded in this function (which is very hairy, of course), I wanted to check with you all and see if there's a way to invoke this MS Excel function through Oracle. Not sure if an external procedure can get to an Excel library, or how to do it if it can.
Any ideas?
Thanks!
Mark
I'm pretty sure this BETADIST exists in Java already.Not natively I think.
But one can download Cern's COLT Libraries for High Performance Scientific and Technical Computing in Java.
Loading the libraries via loadjava
loadjava -user michael/xxxx@oracle_server:1521:oracle_sid -verbose -force -order -resolve -thin colt.jar concurrent.jarand creating a function
create or replace function betadist (alpha number, beta number, c number)
return number
as
language java
name 'cern.jet.stat.Gamma.incompleteBeta(double, double, double) return double';
/is rather straightforward.
Calling it
SQL> select betadist(4,5,0.4) from dual
BETADIST(4,5,0.4)
,4059136
1 row selected.the result coincides quite well with the example given in http://www.excelfunctions.net/Excel-Beta-Dist-Function.html.
Similar Messages
-
How can I call a plsql function from an attribute?
I have an attribute defined in an element. I want execute a PLSQL function from the attribute, and display the returne value with an HTML template.
I've defined the attribute's type like PLSQL, and I've put the called of the function in the value of the attribute, but it doesn't work. The only value I obtain is an URL (I think that is the URL of the function or someting like this).
How can I call to my function from the attribute and display the returnes value in the page?
Thanks.Thanks, but it doesn't work. I have an attribute called ID_BOL and I want to associate a sequence to that attribute. I've created a function, with the sequence. This function return de value of the sequence. I want taht the attribute takes the value of the sequenece dinamically.
I've tried it, creating the type attribute like PLSQL, and calling the function from the attribute, but it doesn't work.
How can I return the sequence value to my attribute?
Thanks. -
can we call a php function into coldfusion??
if anybody knows that let me know....Nope, as IIS can only pass one page to one handler, so it gets passed to ColdFusion *or* PHP. The only way it would work is to have a page with an iFrame containing a PHP page, but that's not calling a PHP function from ColdFusion.
Dare I ask what it is you're trying to achieve exactly? If it's an extremely complicated function that can't possibly be rewritten, you'd probably want to wrap it up in a webservice and call it from CF. -
*Can we call a Standard Function Module inside a Zfunction module ?*
Can anyone please help me know whether we can call a Standard Function Module inside a Zfunction module ?
I tried the same (No syntax error) BUT when i activate the zFunction Module it throws the error:-
+'' REPORT/PROGRAM statement missing, or program type is INCLUDE. " +Yes, I got the Answer -
We Can we call a Standard Function Module inside a Zfunction module.
But we need to make sure that the Function Groups are activated.
FUNCTION ZFM_TEST_NESTED_FM.
""Local Interface:
*" EXPORTING
*" REFERENCE(EX_CONVERT_UPPER_CASE) TYPE STRING
CALL FUNCTION 'TERM_TRANSLATE_TO_UPPER_CASE'
EXPORTING
LANGU = SY-LANGU
TEXT = 'gaurav'
IMPORTING
TEXT_UC = EX_CONVERT_UPPER_CASE
EXCEPTIONS
NO_LOCALE_AVAILABLE = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFUNCTION. -
Can Ora_ffi call ActiveX DLL function???
Hi, Can I call an ActiveX DLL function using ora_ffi or by any other means? Ora_ffi documentation says that it can call C dll functions.Can I call VB dll functions from forms PL/SQL.
Hi, I don't have any experience in calling DLLs, but you may want to give this a try.
report zrich_0001.
data: path type string.
path = 'C:WINDOWS<the_file_Name>.dll'.
call method cl_gui_frontend_services=>execute
exporting
application = path
exceptions
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
others = 8.
Regards
Rich Heilman -
Calling user defined function in Oracle BI Answers?
Hi
I am new in Oracle BI . I want to use the user defined function in Oracle BI Answers as a column,function written in Oracle database to calculate the Sales Revenue.
I am using Oracle BI Standard Edition One and Oracle 10g database.
Please suggest me.
Thanks
NusratSearch for EVALUATE function you can call function and pass parameters
Example:
EVALUATE Function
This function is intended for scalar and analytic
calculations.
Syntax: EVALUATE('DB_Function(%1)', {
Comma separated Expression})
Example: SELECT
e.lastname,sales.revenue,EVALUATE('dense_rank()
over(order by %1
)',sales.revenue) FROM sales s, employee e; -
Can we call a javascript function from backing bean class?
I have a requirement. In a multiselect table, when users selects some rows and clicks a button. Depending upon some condition, an alert box should appear with 2 buttons 'Yes' and 'No'. On clicking yes, certain field values in the selected rows of table should change. On clicking no, the alert box should close. As far as i know alert box can be done only in JS.
Please help me, if a javascript function can be called in backing bean method or suggest some way where alert boxes can appear through ADF.I need to go back to the backing bean as i need to iterate through each selected row of the table in a method( method written for command button) and then if atleast one of the selected rows has job field='Manager', then an alert box needs to be displayed. If none of the rows have job field as 'manager', alert box should not be displayed.
If I write the function for onclick, i cannot iterate through the selected rows of the table in JS function.
Please suggest a way to do this. -
How can I call a server function by a button?
Hello, world...
I have a problem...
I need to call a server function by pushing a button. I put the condition on the label...
This is my script:
writeBtn1.addEventListener (MouseEvent.CLICK,writeFile1);
private function writeFile1 (e:MouseEvent=null):void
checkBtn = (writeBtn1.label == "Conferma" && textInput1.text != "" ); //my condition...
if (checkBtn)
nc.call ("WriteNow",null,textInput1.text+"\n");
writeBtn1.label = "Fatto";
I'd like to call the function on the release of the button...
Can someone helps me?
Please...
Emiliano.use:
writeBtn1.addEventListener (MouseEvent.CLICK,writeFile1);
writeBtn2.addEventListener (MouseEvent.CLICK,writeFile1);
writeBtn3.addEventListener (MouseEvent.CLICK,writeFile1);
private function writeFile1 (e:MouseEvent=null):void
if(e.currentTarget==writeBtn1){
// do whatever
} else if(e.currentTarget==writeBtn2){
// do whateverelese
} else {
// it's writeBtn3 -
How can I call a static function in another static function?
/** = d, as a String, using exactly 5 characters.
Precondition: 0 <= d <= 999.
The truncated d will have one of the forms: ddd.d, dd.dd, and d.ddd.
Examples are: 360.1, 29.50, 4.003, 0.001, and 0.000
public static String truncateTo5(double d) {
// To get the desired output, do the following
// 1. If d < 0.001, set d to 0.
// This prevents d appearing in scientific notation, e.g. 1.5E-6.
// 2. Convert d to a string s, in the usual way.
// s is guaranteed to have a decimal point in it a digit before
// and after the decimal point.
// 3. Append zeros to s (if necessary) until s has 5 digits.
// 4. Return s.
String s= "" + d;
if (d < 0.001) {
d= 0;
return "0.000";
if (s.length() > 5) {
return s.substring(0,5);
if (s.length() == 3) {
int l= s.length();
return s.substring(0, l) + "00";
if (s.length() == 4) {
int l= s.length();
return s.substring(0, l) + "0";
return s;
/** = d, but rounded (if necessary) to its first 5 characters.
PreconditionL 0 <= d <= 360.
E.g. round 1.3546 to 1.355. round 1.3544 to 1.354.
E.g. round 21.995 to 22.00. round 21.994 to 21.99.
E.g. round 130.59 to 130.6. round 130.54 to 120.54.
public static String roundTo5(double d) {
// Hint. Rounding to an integer j is usually done by
// truncating the value j + 0.5.
// E.g. Change 10.6 to 11.1 and truncate to 11
// E.g. Change 10.4 to 10.9 and truncate to 10
// You need to do this sort of thing, but what you add may depend
// on how big d is.
What I need to do is call the truncateTo5() in the roundTo5() in order for this to work properly but I dont know how. Can someone help?@captfoss: If they're static methods in the same class, you don't even need to do that. You can just call the method unquallified.
@OP: First off, when you paste code, wrap it in code tags. You can find them between Quote and Help.
As for your error, you have defined truncateTo5() to take a double as an argument. When you call it, you are not passing it a double and you get that error. -
Can I call a C function from Java (using JNI) ??
hello,
I need to call one C function from remote device and get its return value(o/p) (for my application it is device SSID ) and display in the client PC.
Is it possible in java without using SNMP connction?.
please give me idea about it.
I need this information as soon as possible.
Thank you.see JNI...
basically declare a native method in your java class, then run javah on the class thus generating a *.h file. Then implement the c/c++ function. Compile the c/c++ part as a shared library, and make sure its accessible from your LD_LIBRARY_PATH env variable.
Go through the steps in the JNI docs, and things shoulde be fine... hopefully ;) -
How can i call a c++ function through java
Hi,
dose anyone knows how to call a C++ function in java?
Thanks.see JNI...
basically declare a native method in your java class, then run javah on the class thus generating a *.h file. Then implement the c/c++ function. Compile the c/c++ part as a shared library, and make sure its accessible from your LD_LIBRARY_PATH env variable.
Go through the steps in the JNI docs, and things shoulde be fine... hopefully ;) -
Calling SQL Server Function from Oracle Database link
Hi ,
i have some data from a old SQL server i would i can access with a database link but i cant call function from my database link.
i would like to do something like
@SPAN_PROD = Database link
_EnerttObtApReelBassSys is a Table function from my SQL server
SELECT *
FROM "_EnerttObtApReelBassSys('20120504',4,1)"@SPAN_PROD
WHERE DateEffectiveDebut <= GetDate()
AND DateEffectiveFin > GetDate()
any help ?
Thnx951879 wrote:
I have a SP in SQL Server which will return a Result Set.
My requirement is to call that procedure in ORACLE using DB Link and insert that resultset(Data) in the temp table.First you need to setup Oracle to SQL Server connectivity. To do that you can either use HS - heterogeneous connectivity which comes for free or use Oracle Transparent Gateway which is not free. HS uses ODBC, so if your Oracle database in not on windows, you'll have to get ODBC SQL Server driver for Unix/Linux (e.g. from EasySoft). Since SQL Server selecting from table function syntax is different from Oracle's you will have to, if you use HS, to use DBMS_HS_PASSTHROUGH package. I never worked with Oracle Transparent Gateway to SQL Server, so I don't know if and how it supports selecting from SQL Server table function.
SY. -
Can not call a static function with-in a instance of the object.
Another FYI.
I wanted to keep all of the "option" input parameters values for a new object that
i am creating in one place. I thought that the easiest way would be to use a
static function that returns a value; one function for each option value.
I was looking for a way to define "constants" that are not stored in
the persistent data of the object, but could be reference each time
the object is used.
After creating the static functions in both the "type" and "body" components,
I created the method that acutally receives the option input values.
In this method I used a "case" statement. I tested the input parameter
value, which should be one of the option values.
I used a set of "WHEN conditions" that called the same
static functions to get the exact same values that the user should
pass in.
When I try to store this new version, I get the error:
"PLS-00587: a static method cannot be invoked on an instance value"
It points to the first "when statifc_function()" of the case function.
This seems weird!
If I can call the static method from the "type object" without creating
and instance of an object, then why can't I call it within the body
of a method of an instance of the object type?
This doesn't seem appropriate,
unless this implementation of objects is trying to avoid some type
of "recursion"?
If there is some other reason, I can not think of it.
Any ideas?Sorry for the confusion. Here is the simplest example of what
I want to accomplish.
The anonymous block is a testing of the object type, which definition follows.
declare
test audit_info;
begin
test := audit_info(...);
test.testcall( audit_info.t_EMPLOYER() );
end;
-- * ========================================== * --
create or replace type audit_info as object
( seq_key integer
, static function t_EMPLOYER return varchar2
, member procedure test_call(input_type varchar2)
instantiable
final;
create or replace type body audit_info
as
( id audit_info
static function t_EMPLOYER return varchar2
as
begin
return 'EMPLOYER';
end;
member procedure test_call(input_type varchar2)
as
begin
CASE input_type
WHEN t_EMPLOYER()
select * from dual;
WHEN ...
end case;
end;
end;
The error occurs on the "WHEN t_EMPLOYER()" line. This code is only
an example.
Thanks. -
How can I call a Jscript function from XML, which is written seperatly outside the xml file
Dear All,
I have made a SharePoint ribbon button which should display an alert message with SharePoint custom list
ID information. But it has problem for calling the Jscript methods, It may be a XML tag mistake!!! Unable to
find the error in code line!!!, can somebody please tell me this error by referring my code snippet????
It is a farm SharePoint solution I have kept the Jscript file in mapped folder named "Layouts"
It is showing the error as : JavaScript runtime error: The value of the property 'myFunction' is null or undefined, not a Function object
That means, as I understand the control is not moving or not calling the function from JScript file....why it
is so...not able to debug JScript or xml using Visual Studio that makes my effort tedious!!!
Code:
Elements.xml
<CommandUIHandlers>
<CommandUIHandler Command="ShowAlert" CommandAction="javascript:retrieveListItems()" EnabledScript="return true;"/>
</CommandUIHandlers>
<CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/RibAlert.js"/>
</Elements>
RibAlert.js
<script>
var siteUrl = http://A5-1224';
function retrieveListItems()
var clientContext = new SP.ClientContext(siteUrl);
var oList = clientContext.get_web().get_lists().getByTitle('Measurements'); //getByTitle('Custom List');
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml('<View><Query><Where><Geq><FieldRef Name=\'ID\'/>' +
'<Value Type=\'Number\'>1</Value></Geq></Where></Query><RowLimit>10</RowLimit></View>');
this.collListItem = oList.getItems(camlQuery);
clientContext.load(collListItem);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
</script>Hi,
I suggest you write an alert() in your function to check whether it can be executed first.
If alert() is ok, then it would be an issue of the code with Client Object Model, you can take a look at the link below about How to retrieve List Items Using JavaScript:
http://msdn.microsoft.com/en-us/library/office/hh185007(v=office.14).aspx
If alert() can’t be executed, then please check whether the steps of created ribbon button is correct.
The links below about how to add a custom button to the ribbon:
http://aarebrot.net/blog/2010/09/adding-a-custom-button-to-the-ribbon-using-a-feature-in-sharepoint-2010/
http://www.c-sharpcorner.com/uploadfile/anavijai/how-to-create-custom-button-in-sharepoint-2010-ribbon-user-interface/
https://pholpar.wordpress.com/tag/custom-actions/
What’s more, there seems no query succeeded handle function in your code, please take a look at the link provided above for a reference.
Thanks
Patrick Liang
TechNet Community Support -
How can i call userdefined java functions in a JSP ?
Hi,
i want to define some functions in a java class. is it possible to use these functions in a jsp ? how can i achieve this ?I suggest you call the function you want in either a custom tag or in the servlets/struts/jsf,... classes you are using.
If you dont want those and you prefer scriplets then 2 step,s.
First import the class then call it.
Maybe you are looking for
-
Do not file let to open and close?
Hello I am solving my requirement (FIND specified text and REPLACE it with some revised_text on the my_MS_Word_doc, which is stored on my local machine), but, after complte execution of the prog. this my_MS_Word_doc is OPENING and CLOSING itslef in
-
In the past, when I tried to bookmark a Web page, I had the option of choosing where I wanted the bookmark stored. If I selected "Choose," I would be presented with a list of all my folders. Not any more! Now, if I select "Choose," I am presented wit
-
Error in Stock upload of trading material
Dear all, i am creating a meterial in a dubai plant where taxes are not applicable....While creating a stock in "MB1C" i am getting an error stating "Company code not assigned to country or country to calculation procedure".. Can anyone plz help me o
-
OS X Yosemite froze on install
My Mac Book Pro froze during Yosemite installation, I did hard start and it appeared to finish. Now when I turn on my computer, the file reloads. 2 GHz Intel Core i7, 4 GB memory
-
Sales order changed by RFCUSER
Hi All, normally when ever we changed the sales order in change log it show the changed person name that is if i change it should show my name,but last month for few order when ever order is changed the change log it is showing RFCUSER. what would b