Calling an overloading function
Hi all,
How can I call an overloading function from outside the package without using the package name,
For example :
CREATE PACKAGE PACK
FUNCTION X(P_INTERVAL IN VARCHAR2, P_INTERVAL_VAL IN NUMBER, P_DATE_STR IN VARCHAR2) RETURN TIMESTAMP;
FUNCTION X(P_INTERVAL IN VARCHAR2, P_INTERVAL_VAL IN NUMBER, P_DATE_EXPR IN DATE) RETURN DATE;
FUNCTION X(P_INTERVAL IN VARCHAR2, P_INTERVAL_VAL IN NUMBER, P_DATE_EXPR IN TIMESTAMP) RETURN TIMESTAMP;
FUNCTION X(P_INTERVAL IN VARCHAR2, P_INTERVAL_VAL IN NUMBER, P_DATE_EXPR IN TIMESTAMP WITH TIME ZONE) RETURN TIMESTAMP WITH TIME ZONE;
Instead of calling the function by using PACK.X (SELECT PACK.X(...) FROM dual)
I want to able to call it using X only (SELECT X(...) FROM dual)
Is there any possible way ?
Thanks !
That's a good question
Basically I'm converting MSSQLSERVER functions to oracle using an excellent provided ORACLE package (the SQL DEVELOPER generating it while migrating from MS to Oracle)
Now, In order to preserve code consistency, the developers wants to call these functions exactly the way the are calling it in MSSQLSERVER (for example SELECT DATEADD (...)) without the package name.
Off course its a very problematic demand, but it interest me theoretically, is it even possible.
Similar Messages
-
Calling an Oracle function of BOOLEAN return type
I am facing a situation, where I have defined an overloaded function in one package (2 variants) which both return a type BOOLAN value under Oracle 9i R1.
I am having trouble to setting up an CallableStatemnt to call one of this functions from Java. Whenever I set the parameter with a BIT or NUMBER data type, I get an exception with java.lang.boolean during my
callablestatement.setobject( index, parameter, OracleTypes.BIT );
or
callablestatement.setobject( index, parameter, OracleTypes.NUMBER );
I have no problem calling the function from SQLPlus, but doing so from Java raises the exception. I have found no exact match in OracleTypes or java.sql.Types for a BOOLEAN data type.
In your response do you mean to modify the Function to return a NUMBER instead of a BOOLEAN, or do you mean to set the parameter as Types.NUMBER in the calling java code?
Thanks,
Fedrolook at BOOLEAN type mapping using JPublisher
http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96658.pdf -
Hi all
create or replace package emp_pack is
function p1 (p_tvia_num movil.tvia_num%type,
p_chaluka_num movil.chaluka_num%type) return number ;
function p1 (p_tvianum movil.tvia_num%type,
p_chlaukanum%type,
p_polisanum%type) return number ;
end emp_pack;i'm posting only the specification
now
i'm trying to invoke the function :
exec emp_pack.p1(p_tvia_num=>99,p_chaluka_num=>0);
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'P1
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored '
i know that if i declare different name for the parameters and invoking the function with the parameter name it's suppose to work ,
am i right ? or this valid only to procedures ?
Thanks in Advanced
Naama
Edited by: naama on Jun 12, 2011 2:47 AMHi peter
Sorry my mistake , i copied the wrong script
CREATE OR REPLACE PACKAGE emp_pack IS
FUNCTION p1 (
p_tvia_num movil.tvia_num%TYPE,
p_chaluka_num movil.chaluka_num%TYPE
RETURN NUMBER;
FUNCTION p1 (
p_tvianum movil.tvia_num%TYPE,
p_chlaukanum movil.chaluka_num%TYPE,
p_polisanum movil.polisa_num%TYPE
RETURN NUMBER;
end emp_pack;/
o.k you right , and i also did
var g_num
execute :g_num := emp_pack.p1(p_tvia_num=>99, p_chaluka_num=>0)
and it's work
now i was wondering
from the beginning i wanted to do like this :
CREATE OR REPLACE PACKAGE emp_pack IS
FUNCTION p1 (
p_tvia_num movil.tvia_num%TYPE,
p_chaluka_num movil.chaluka_num%TYPE
RETURN NUMBER;
FUNCTION p1 (
p_tvia_num movil.tvia_num%TYPE,
p_chlauka_num movil.chaluka_num%TYPE,
p_polisa_num movil.polisa_num%TYPE
RETURN NUMBER;
--overloading function no.3
FUNCTION p1 (
p_polisa_num movil.polisa_num%TYPE ,
p_chlauka_num movil.chaluka_num%TYPE) return number ;
end emp_pack;i added one more function which get also two parameters of the same data type ,
and also gave the parameters of all the p1 function the same name ,
is it valid and if so , it this a poor pl/sql code , ok is it o.k writing like this ?
Thanks in Advanced
Naama
Edited by: naama on Jun 12, 2011 3:35 AM
Edited by: naama on Jun 12, 2011 3:36 AM -
How to call a C function calling a Java Method from another C function ?
Hi everyone,
I'm just starting to learn JNI and my problem is that I don't know if it is possible to call a C function calling a Java Method (or doing anything else with JNI) from another C function.
In fact, after receiving datas in a socket made by a C function, I would like to create a class instance (and I don't know how to do it too ; ) ) and init this instance with the strings I received in the socket.
Is all that possible ?
Thank you very much for your help !Hard to understand the question, but by most interpretations the answer is going to be yes.
You do of course understand that JNI is the "API" that sits between Java and C and that every call between the two must go through that. You can't call it directly. -
How to call a SQL function from an XSL expression
Hi
In R12, in Payroll Deposit adivce/Check writer, We need to sort the earnings tag <AC_Earnings> in to two different categories as regular and other earnings. In the DB and form level of element defintiion we have a DFF which differentiates between the two kinds of earnings. But the seeded XML that is gerneated by the check writer does not have this field.
The seeded template displays all the earnings in one column. How can we achieve this in the template without modifying the seeded XML.
The one approach i have is to write a function and based on the return value sort the data. For this I need to know :
1) How to call a SQL function from an XSL expression that is allowed in BI template.
If anyone ahs faced similar requirements please share your approach.
Thanks
SrimathiThank u..
but i'd seen that link wen i searched in google..
Is it possible without using any 3rd party JARs and all?
and more importantly plz tell me what should be preferred way to call a javascript function?
Do it using addLoadEvent() or Windows.Load etc
OR
Call it thru Xsl? (I donno how to do dis)
Thanks in Advance..
Edited by: ranjjose on Jun 3, 2008 8:21 AM -
Problem while calling an RFC Function Module in Background
Hello,
I have created a RFC function module for reading data from an external DB system. The FM calls an external RFC program (coded in C++ using RFC SDK), which delivers the required data. This external program is maintainged as an TCP RFC Connection in SM59.
Further I have created a report, that calls the RFC function module to get the data from the external RFC programm.
My problem is, when I call the report in foreground, everything works OK, the RFC connection works and data can be read from the external program.
However, when I schedule the report to run in background as a job, the report is stating in the protocoll that there was a problem calling the defined RFC connection (although the connection is working properly at that time).
More funny is, this particular problem with running in background occurs only in the productive system, in test and development system the report works correctly also while running as a job in background.
Can you suggest the solution to this problem? Could it be something with authorisations or server settings?
I will be on holiday for the next 6 weeks, so take your time to answer .
Regards,
Dusan.
Edited by: Julius Bussche on Jan 22, 2009 7:19 PM
Please read the forum rules about u r g e n t ...This is an external RFC server program, not a remote enabled ABAP RFC function module as the others seem to be assuming, right?
Is it possible that your DEV and QAS systems only have one application server, but the PROD has many and dedicated one(s) for processing low priority background jobs?
It might be that the target server of your TCP connection is not this BTC instance, and your RFC server is returning the data "locally" - so, into nirvana...
Just guessing, but might be worth checking.
Cheers,
Julius -
How can I have a backing file call a JavaScript function?
I have a Weblogic portal with a JSP portlet. The portlet has a backing file. How can I get the backing file to call a JavaScript function in my portlet?
thanksHi
your questions are not correct because you are mixing up server side operations with client side operations.
First server side code executes then the page is sent to the browser , then any javascript executes on the browser. So asking for javascript to be called from backing file (server side) doesn't make sense or asking for javascript to read a parameter doesnt exactly work either.
However in your server code suppose you have a variable action in the request that you want javascript to know then in your JSP you would add something like
<script type="text/javascript">
var action = '${requestScope.action}';
alert(action);//or whatever you want to do
<c:if test="${requestScope.someOthervariable == ''xyz'}"><%-- this check is done on the server --%>
callSomeJavascript(); <%--this javascript is only executed when the server side value of someOtherVariable is xyz --%>
</c:if>
</script>
i.e. you can output the javascript that has the variables you need or the function calls you want.
Like I said understand whats server side and whats client side. -
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. -
Visual fortran calling a c function in visual studio
Hi,
I am running Windows 8.1 with Visual Studio Prof. 2012. I have installed Visual Fortran also. Now I wanted to make a solution with two projects one for Visual Fortran and one for C, and be able to call a C function from within the Fortran.
Can someone, please, show how to do this step by step? Guide with pictures would be awesome.
Thanks in advance.Hi Engineer101,
One way to integrate your code into TestStand would be to save it as a .dll file. Cick this link for information on how to do this in visual c++ 2008. Once you have the dll, you can call it in teststand using a c/c++ dll action step. I hope this helps, and let me know if you have any further questions!
Al B.
Staff Software Engineer - TestStand
CTA/CLD -
How to call a Javascript function from backing bean without any event
Hi,
Someone knows how to call a Javascript function from backing bean without any event ?
thanksPlease review the following thread:
ADF Faces call javascript
Luis. -
How to call the 'DETAIL' function in ALV for a program?
Dear Friends,
I have a prf_tree (TYPE REF TO cl_gui_alv_tree), and I added below codes to add an new button for displaying the detail record, it works fine:
CALL METHOD prf_toolbar->add_button
EXPORTING
fcode = prf_tree->mc_fc_detail
icon = icon_detail
butn_type = cntb_btype_button
text = ''
quickinfo = 'Show Details'.
Everytime I click this new button, a window will popup and display the record details.
My question is: how to call this standard function ('DETAIL' function) in a program? for example:
CASE ldf_ok_code.
WHEN gcf_okcode_save.
PERFORM okcode_save.
WHEN 'SHOW_DETAIL'.
CHECK gdf_nodkey_9003 IS NOT INITIAL.
PERFORM SHOW_DETAIL.(How to write this code to display the detail data of the selected record?)
Thanks a lot!Hi,
Go for Interactive Reporting
like When u click on the output then it will show the Detail report u want .
for that purpose Pls
Use Hide command .
And call another report
by using SUBMITT Program -
Calling Synchronous RFC Function Module in Background
Hi all,
Currently we are working on some requirement where in we have to retrieve data from one system(CRM) and update the same into another system(ECC). We have developed a RFC Function in CRM system and it is being called from ECC system as in synchronous mode via a batch program.
Now since all sychronous call to a RFC function will be dialog there is a constraint on the runtime which is being set by maximum run time for each dialog work process. So my question is there an option to call an RFC function synchronously in background (background task) so there is no runtime performance.
The standard TRFC, QRFC calls in background runs asynchronously and so I am trying to check with the SDN world as whether has anyone tried SRFC(Synchronous) call in background?
Thanks in advance,
JagathSo my question is there an option to call an RFC function synchronously in background (background task) so there is no runtime performance.
One solution would be to increase the value of the "time out" parameter defined the CRM system. This i feel is not a fool-proof solution as the run-times cannot be predicted. Check this thread: Re: RFC timeout profile parameter
For me a better solution would be to implement tRFC call instead of a synchronous call. Any reasons why you don't want to implement a tRFC ?
BR,
Suhas
Edited by: Suhas Saha on Jun 26, 2010 8:52 AM -
Hello Guys,
I have a question regarding calling a RFC function module.
In BW - BI 7.0 I call a RFC function module:
(The ABAP program in BW-BI 7.0 is below)
CALL FUNCTION ''ZTESTFUNCTIONMODULE' " Function module in ECC
DESTINATION 'DECCLNT110' " ECC system
TABLES
it_gl_item = it_gl
it_errlog_gl = it_errlog_gl.
The 'ZTESTFUNCTIONMODULE' is RFC enabled in the ECC system.
The purpose is we retarct the data from BW to ECC.
When I run the function module it always asks for the user id and password.
The SAP logon screen appears and it asks for the user id and password.
The destination is maintained in the SM59 transaction and also the user is maintained there. I think it should login automatically into remote system and return the tables. is it correct. How to skip the logon screen.
Do I have to pass the user id and password in the function module. I think it should take the user id from the SM59 destination. Is it correct.
Please advise. As always thanks for your help guys.Hi Senthil,
I think you answered your query in your question itself
The user ID and password need to be maintained in RFC destination in SM59.
Go to SM59 and then click on test connection..if it does not ask for ID and passwoed that means correct ID and password is maintained in SM59 otherwise maintain it.
Regards,
Atish -
Calling CVI DLL Function from Visual Studio
HI all ,
Iv'e created a DLL using CVI and i'm tring to call one of it's function from visual studio 6.0
I'm getting a general error , is there a specific prototype that i need to set my functions in ordrer to call them ?!
Kobi Kalif
Software EngineerYou will need to distribute the CVI RTE along with your DLL, since anything you write in CVI is going to use the RTE.
As far as calling the DLL functions, you can use the CVI defined macros
<return type> DLLEXPORT DLLSTDCALL <function name> (<param1 type> <param1> ...) {
to declare your functions in the DLL for access by a VS application.
for example
int DLLEXPORT DLLSTDCALL myfunction (int funparam1, double func param2) {
There are options for identifying which functions to export from your DLL, I use "functions marked for export" but there are other choices available. I also include a type library so when you type the name of a DLL funciton in VS6 you see a balloon popup with the function signature. This is a check box in the target settings. You have to create a ".fp" file (function panel file) to collect the function info for the library.
From VB6 you can access the DLL a couple of ways, but I usually add the DLL as a reference. -
Help needed in calling a javascript function from a jsp
Hey guys,
I need help.
In my jsp I have a field called date. When i get date field from the database, it is a concatination of date and time field, so I wrote a small javascript function to strip just the date part from this date and time value.
The javascript function is
function formatDate(fieldName)
var timer=fieldName;
timer = timer.substring(5,7)+"/"+timer.substring(8,10)+"/"+timer.substring(0,4);
return timer;
Now I want to call this javascript function from the input tag in jsp where I am displaying the value of date. Check below
This is one way I tried to do:
<input size="13" name="startDate" maxLength="255" value=<script>formatDate("<%=startDate%>")</script> onChange="checkDate(this)">
I even tried this:
<input size="13" name="startDate" maxLength="255" value="'formatDate(<%=startDate%>)'" onChange="checkDate(this)">
But it dosen't work
Please help. I am struggling on this for days.
Thanks,
RubyHey all you developers out there , Pleaseeee help me with this one.
Maybe you are looking for
-
Problem with Syncing On ITunes
How do People. I have the current version 7.2.3 Installed. When I try to sync my Ipod a message states that I don't have enough room on my IPod to sync the selected songs and ITunes can sync a randomly selected number of songs etc. On previous versio
-
Configure VPN Server Cisco 877W
Hello! I need to implement VPN Server on a Cisco 877W. The idea is as follows: Access the network from anywhere using the Cisco VPN Client; The router need receive a minimum 5 simultaneous connections; Each User would have a login and password; Cisco
-
Path null does not point to an attribute
Hi I am trying to create a Checkbox dynamically and these are the steps i am doing. IWDCheckBox iwdCheckbox = (IWDCheckBox) view.createElement(IWDCheckBox.class,"iwdCheckbox"+trayCount); iwdCheckbox.setVisible(wdContext.curre
-
Upgrading plugins from CS4 to CS5
If I upgrade from Photoshop CS4 to CS5, can I simply copy all my plugins from the CS4 plugin folder to the CS5 one? I am assuming here that my plugins are compatible with both versions of Photoshop.
-
I'm using a 15 inch retina macbook, in photoshop the font in the UI is too small
How do I rectify it? PS: I'm using windows 8.1 however, and I can't seem to change the screen resolution