User defined function and returning resultset
Hi all,
Following query, if I comment the statement in where clause which refers to a returning value of a function in the subquery, it takes 1 sec to finish. when uncomment it however, can't finish in 30 mins. Please help me on finding out the problem.
I'm also wondering how to get a returning cursor in this case(to bypass above trouble)..
Many thanks
-s
--pseudocode for how can I get a cursor in an anonymous block for host app
begin
-- get the resultset1 in someway
select t1.showit,...
from t1..;
-- based on resultset1
open myrefcursor for
select * from resultset1 -- what is the resultset1?
where resultset1.showit=1;
end;
--end pseudocode for getting a cursor
-- hanging(takes too long) query (simplified)
select t1.*,t2.account,t2.showit
from (select t3.account,myfunc(t3.account) showit
from tbl2 t3) t2,
tbl1 t1
where t1.account=t2.account
and ...
/* "hang" this query by uncomment this */
-- and t2.showit=1;
-- functions
function myfunc(p_acc varchar2)
return number is
v_tmpdate date;
v_invdate date;
v_tmpcount number(8);
v_accid number(8);
v_curodisp number(14,4);
v_curdisp number(14,4);
v_curdisprev number(14,4);
v_rowcount number(8);
v_tmpshow number(8);
p_vkey number(8);
p_inv varchar(50);
cursor cur(cv_vkey number, cv_accid number, cv_lastdate date) is
select a.vkey vkey,a.invdate invdate, b.odisp odisp
from inv a, recon b
where a.vkey=cv_vkey
and a.akey = cv_accid
and a.invdate between to_date('01/01/2000','DD/MM/YYYY')
and cv_lastdate
and b.vkey = a.vkey
and b.inv# = a.inv#
order by invdate DESC;
begin
select vkey,inv#,akey, invdate into p_vkey,p_inv,v_accid, v_invdate
from inv
where akey = p_acc;
v_tmpdate := add_months(v_invdate, 1);
select count(*) into v_tmpcount
from recon a, inv b
where b.vkey = p_vkey
and b.akey = v_accid
and b.invdate between to_date('01/01/2000','DD/MM/YYYY')
and v_tmpdate
and a.inv# = b.inv#
and a.vkey = b.vkey;
if v_tmpcount = 0 then
return 0;
end if;
v_rowcount := 0;
for c1 in cur(p_vkey,v_accid,v_tmpdate) loop
v_rowcount := v_rowcount + 1;
v_curdisp := getcurdisp(c1.vkey,c1.inv#);
v_curdisprev := getcurdisprev(c1.vkey,c1.inv#);
v_curodisp := nvl(c1.odisp, 0) - v_curdisp - v_curdisprev;
if v_curodisp >= 1000 then
return 1;
elsif v_curodisp = 0 then
return 0;
end If;
end if;
if extract(month from c1.invdate) in ('1','01')
and extract(year from c1.invdate) = '2000' then
select a.showodisp into v_tmpshow
from acc a, inv b
where b.vkey = c1.vkey
and b.inv# = c1.inv#
and a.akey = b.akey;
return v_tmpshow;
end If;
end loop;
return 0;
end myfunc;
function getcurdisp(p_vkey,p_inv)
return number is
v_tmp number(15,4);
begin
select sum(amount) into v_tmp
from cost
where vkey=p_vkey
and inv#=p_inv
and desc like '%disp';
return v_tmp;
end;
function getcurdisprev(p_vkey,p_inv)
return number is
v_tmp number(15,4);
begin
select sum(amount) into v_tmp
from cost
where vkey=p_vkey
and inv#=p_inv
and desc like '%disprev';
return v_tmp;
end;
Autotrace only showed the index usage on the main query, but nothing on the queries within the functions, so here is the tkprof that shows index usage on the queries within the functions.
TKPROF: Release 9.2.0.1.0 - Production on Mon Jan 17 00:31:39 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Trace file: ora92_ora_4092.trc
Sort options: default
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
alter session set sql_trace=true
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
total 1 0.00 0.00 0 0 0 0
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 59
select t1.*, t2.account, t2.showit
from tbl1 t1,
(select account, myfunc(account) showit
from tbl2) t2
where t1.account = t2.account
and t2.showit = 1
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.11 1.81 0 1 0 0
total 3 0.11 1.81 0 1 0 0
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 59
Rows Row Source Operation
0 NESTED LOOPS
0 INDEX FULL SCAN OBJ#(69662) (object id 69662)
0 INDEX RANGE SCAN OBJ#(69661) (object id 69661)
select user#
from
sys.user$ where name = 'OUTLN'
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 2 0 1
total 3 0.00 0.00 0 2 0 1
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: SYS (recursive depth: 2)
Rows Row Source Operation
1 TABLE ACCESS BY INDEX ROWID USER$
1 INDEX UNIQUE SCAN I_USER1 (object id 44)
select a.vkey, a.invdate, b.odisp, a.inv#
from inv a, recon b
where a.akey = :b1
and a.invdate between to_date ('01/01/2000', 'DD/MM/YYYY')
and add_months (a.invdate, 1)
and b.vkey = a.vkey
and b.inv# = a.inv#
order by a.invdate DESC
call count cpu elapsed disk query current rows
Parse 1 0.00 0.10 0 0 0 0
Execute 105 0.00 0.01 0 0 0 0
Fetch 105 0.01 0.01 0 309 0 100
total 211 0.01 0.13 0 309 0 100
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 59 (recursive depth: 1)
Rows Row Source Operation
100 SORT ORDER BY
104 TABLE ACCESS BY INDEX ROWID RECON
313 NESTED LOOPS
104 INDEX FULL SCAN INV_IDX (object id 69658)
104 INDEX RANGE SCAN RECON_IDX (object id 69659)
SELECT sum (amount)
from cost
where vkey = :b2
and inv# = :b1
and descr like '%disp'
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 100 0.00 0.00 0 0 0 0
Fetch 100 0.01 0.00 0 100 0 100
total 201 0.01 0.01 0 100 0 100
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 59 (recursive depth: 1)
Rows Row Source Operation
100 SORT AGGREGATE
0 TABLE ACCESS BY INDEX ROWID COST
0 INDEX RANGE SCAN COST_IDX (object id 69657)
SELECT sum (amount)
from cost
where vkey = :b2
and inv# = :b1
and descr like '%disprev'
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 100 0.00 0.00 0 0 0 0
Fetch 100 0.01 0.00 0 100 0 100
total 201 0.01 0.01 0 100 0 100
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 59 (recursive depth: 1)
Rows Row Source Operation
100 SORT AGGREGATE
0 TABLE ACCESS BY INDEX ROWID COST
0 INDEX RANGE SCAN COST_IDX (object id 69657)
SELECT a.showodisp
from acc a, inv b
where b.vkey = :b2
and b.inv# = :b1
and a.akey = b.akey
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 100 0.01 0.00 0 0 0 0
Fetch 100 0.03 0.00 0 299 0 99
total 201 0.04 0.01 0 299 0 99
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 59 (recursive depth: 1)
Rows Row Source Operation
99 TABLE ACCESS BY INDEX ROWID ACC
299 NESTED LOOPS
100 INDEX RANGE SCAN INV_IDX (object id 69658)
99 INDEX RANGE SCAN ACC_IDX (object id 69660)
begin
for x in ( select * from session_trace_file_name )
loop
if ( dbms_lob.fileexists( bfilename('UDUMP_DIR', x.filename ) ) = 1 )
then
insert into avail_trace_files (filename) values (x.filename);
end if;
end loop;
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.01 0.00 0 0 0 1
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.01 0.00 0 0 0 1
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 736 (recursive depth: 1)
select *
from
session_trace_file_name
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.00 0 0 0 1
total 4 0.00 0.00 0 0 0 1
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 736 (recursive depth: 2)
INSERT into avail_trace_files (filename)
values
(:b1)
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 3 1
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.00 0.00 0 0 3 1
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 736 (recursive depth: 2)
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 2 0.00 0.00 0 0 0 0
Fetch 1 0.11 1.81 0 1 0 0
total 4 0.11 1.81 0 1 0 0
Misses in library cache during parse: 0
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 8 0.00 0.11 0 0 0 0
Execute 409 0.02 0.04 0 0 3 2
Fetch 408 0.06 0.03 0 810 0 401
total 825 0.08 0.19 0 810 3 403
Misses in library cache during parse: 4
9 user SQL statements in session.
1 internal SQL statements in session.
10 SQL statements in session.
Trace file: ora92_ora_4092.trc
Trace file compatibility: 9.00.01
Sort options: default
1 session in tracefile.
9 user SQL statements in trace file.
1 internal SQL statements in trace file.
10 SQL statements in trace file.
10 unique SQL statements in trace file.
945 lines in trace file.
Similar Messages
-
User-Defined Function and Context Manipulation
Hi Mapping Gurus, I need your help.
I have a user-defined function and one of my input parameter (c) is in a loop (EDI segment). So one, if I execute my function I get:
Exception:[java.lang.ArrayIndexOutOfBoundsException: 0]
If I change the context or use the remove context node function its working but its always taking the first row in consideration since I'm using c[0] . Here is the logic:
String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[0]"'";
So since c is an array [], I have tried different logic to get to the right row.
1- I tried using another parameter (e) to pass a counter or an index to my function. So each time it's looping, it's passing a new value to the function but Im still getting the first row and Im not to sure why?
int G = Integer.parseInt(e[0]); // e[] = My counter field
String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
2- I tried using a parameter stored in the container:
String Num;
Num = (String)getParameter(counter);
if (Num == null) G = 0;
else
G = Integer.parseInt(Num);
G = G + 1;
String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
Num = "" + G;
setParameter(e[0], Num);
and Im still getting the first one, look like its using a different container each time its looping so the Value is always the same?
4- I created a new user-defined function with the container logic, then its working but Im back to the same problem in my main function, its only looking at e[0] for my counter all the time.
5- I tried using the Seeburger Java Variables and guess what in the main fonction, as new UDF,... and guess what, same result!
So anybody out there that was able to get UDF's working into a multiple context scenario?
Am I missing something?
I will reward points and beer for any help!This is one of the text with passing a counter to the function to try to go to the right row in the array since I'm doing a remove context and I'm getting all the d_234's:
public void ReadTable(String[] a,String[] b,String[] c,String[] d,String[] e,ResultList result,Container container){
int G = Integer.parseInt(e[0]); // My counter
String var;
String DBTABLE = a[0];
String lookUpField = d[0];
String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
Now this one was with the internal container logic:
int G;
String DBTABLE = a[0];
String lookUpField = d[0];
String Num;
Num = (String)getParameter(e[0]);
if (Num == null) G = 0;
else
G = Integer.parseInt(Num);
G = G + 1;
Num = "" + G;
setParameter(e[0], Num);
String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
And now with the Seeburger Variables:
int G;
try {
VariableBean be=VariableFactory.getVariableInstance("");
G = Integer.parseInt(String.valueOf(be.getStringVariable("yves")));
} catch (Exception f) {
throw new RuntimeException(f);
String DBTABLE = a[0];
String lookUpField = d[0];
String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
try {
G = G + 1;
Num = "" + G;
VariableBean be=VariableFactory.getVariableInstance("");
be.setStringVariable("yves",Num);
catch (Exception f) {
throw new RuntimeException(f);
All 3 logics were returning always the first row or a counter of 1 if the logic is in the main ReadTable function. -
Where are User Defined Functions and Stored Procedures kept in SQL Server?
Hi,
I have a growing list of Stored Procedures and User-Defined Functions in SQL Server, and would like to be able to list all my user SP and UDF easily.
Is it possible to write a query to list all SP and UDF?
I saw the following specimen code in an SQL book, but am not sure this is what I need because I could not make it work.
SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE SPECIFIC_SCHEMA = N'CustomerDetails'
AND SPECIFIC_NAME = N'apf_CusBalances'
I tried:
SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
but it does not work.
Suppose all my SP are named following this pattern:
dbo.usp_Storeproc1
How would I modify the above code? or is there a better code?
Thanks
Leon LaiHi ,
try this to get list of all stored procedures:
SELECT *
FROM sys.procedures where name like 'dbo.usp%'
Thanks,
Neetu -
How to migrate sql server 2000 user defined function returns table
Hi,
How do I capture the SQL Server 200 user defined function that returns table? Is this supported in the current version of Oracle Migration Workbench? I am using the latest version - Release 9.2.0.1.0 with SQL SERVER 2000 plug-in.
I was able to capture the SQL Server 2000 user defined function that returns string and smalldatetime but not the functions return table during the migrate data source stage.
Thanks in Advance,
SusanSusan,
This is not currently supported. The next release of the Oracle Migration Workbench (due very soon), will do a better job of catching this mad reporting an error. We are looking into a suitable mapping and have created bug # 2355073 - TABLE DEFINITIONS NOT ACCEPTED FOR TABLE FUNCTIONS to track this issue.
Once possible solution we are looking into is using the object type to emulate. Here is an example from the bug:
Original table
SQL> create table tabela (a number, b number, c number, d number);
SQL> insert some values...
SQL> select * from tabela;
A B C D
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
SQL Server 2000 code
CREATE FUNCTION FUNCRETORNATABELA()
RETURNS TABLE
AS
RETURN SELECT A,B,C,D FROM TABELA
SELECT A,B,C,D
FROM FUNCRETORNATABELA()
ORDER BY A
Oracle code (workaround)
SQL> create or replace type MyObjType as object (
2 a number, b number, c number, d number);
3 /
Type created.
SQL> create or replace type MyTabType as table of MyObjType;
2 /
Type created.
SQL> create or replace function teste return Mytabtype pipelined as
2 aa MyObjType := MyObjType(null, null, null, null);
3 cursor c1 is select a,b,c,d from tabela;
4 begin
5 open c1;
6 loop
7 fetch c1 into aa.a, aa.b, aa.c, aa.d;
8 exit when c1%NOTFOUND;
9 pipe row (aa);
10 end loop;
11 close c1;
12 return;
13 end;
14 /
Function created.
SQL> select * from table(teste);
A B C D
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
SQL> select a, c from table(teste) order by c desc;
A C
4 4
3 3
2 2
1 1
Donal -
User defined function in a cursor
Hi All,
I need to use a user defined function(which returns a value based on my Procedure's input parameter) in my explicit cursor. Something like
create or replace procedure test(pi_input number)
cursor c1
is
select col1,
col2,
func(pi_input),
col4
from table;
begin
end;
Is this possible? IHi,
User-defined functions can appear in SQL statements, including cursors, if they follow certain rules (e.g., all arguments are IN arguments, in one of the SQL data types).
You really need to post your code. You don't need to post the compete code; a simplified version that gets the same error would serve just as well (actually better). Include CREATE TABLE and INSERT statements for any tables used, the function code, the code that calls the function, and the results you want from that code, given the sample data you posted.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002
Does your function work the way you want when it is not in a cursor? -
Java user-defined function for mapping a complex structure
All,
Hope one of you can help me with this. I have a structure with over 15 fields and would like to concatenate all the fields into one target field and while I do this, I need to ensure that each field is padded with blanks as defined the data type. Can one of tell me if this is possible with a java user-defined function and if so, what type of logic is needed.
Input_MT
Field_1 string len=10 "need"
Field_2 string len=6 "java"
Field_3 string len=7 "help"
Field_4 string len=8 "asap"
etc,
Output_MT
DataOut string "need java help asap "
(for some reason the exact spaces in between the words disappear in my Preview message)
I have several fields in the input mt and therefore I find graphical mapping using concatenate and my own user defined function padWithSpace too messy.
Thank you for you help.Hi,
If your final req is to write all these fields next each other in a file, you can configure this in receiver file adapter by specifying the fixed length for each field.
If you want the padded string as your MM o/p, you can create a simple user defined funtion with 15 fields as input and 15 constants for their lengths, and find out the length of the each string and pad it with required no of spaces.
int max_len = 10;
int actual_len;
actual_len = a.lengh();
for(int i=0; i < (max_len-actual_len; i++)
a = a.append(" ");
return a;
praveen -
Getting "Unexpected end of formula" error in user-defined function
I created a user-defined function and registered it successfully in Discoverer Admin (10g), and it shows up in Discoverer Plus. However, when I call the function, I get this error:
"Error in formula -- unexpected end of formula"
If I hard-code in parameters, I can successfully run the function as such from Oracle SQL Developer:
SELECT PAYLINETOT('2324', '111', to_date('01-Sep-2010'), to_date('31-Oct-2010'))
FROM DUAL;
But I still get the same error if I enter this in the calculation dialog in Discoverer:
PAYLINETOT('2324', '111', to_date('01-Sep-2010'), to_date('31-Oct-2010'))
Any idea what's going on and how to get this to work?Michael,
I tried your suggestion, and this time I got a different error message that said that the function had not been registered with the EUL. I thought I had registered it, but when I checked, the return data type was wrong. I corrected it, and the function is "valid" in Discoverer Admin. Yet, when I go back to Discoverer Plus and attempt to use the function (and yes, I logged out and logged back in), I get the same error message:
"Error in formula - unexpected end of formula - Error: Function PAYLINETOT has not been registered with the EUL."
Any idea where the disconnect is? Are these two separate errors? How could Discoverer Admin tell me that the function is registered and Discoverer Plus tell me otherwise? And yes, I've made sure that the "Available in Desktop/Plus" checkbox is checked. -
Error in conditional map using User Defined Function
All,
In my mapping I basically have a user defined function that returns the filename of my inbound file from the adapter-specific message attributes (file adapter). I know this is coded properly because if I simply assign this function to my destination field I can see the filename in the payload XML.
However if I conditionally check that returned value using if,then,else I get an error message stating:
"During the application mapping com/sap/xi/tf/_MaterialData2ZcustProdMastMulti_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformation"
Essentially in my if I'm checking if the value returned by my user defined function is equal to the constant "SOMECONSTANT" then I'm setting my destination field to some other constant value. Otherwise it's equal to a different constant value.
Any thoughts?Claus,
Thanks for the help. I actually had figured the problem out on my own. Sorry for not updating the thread sooner. What happened was this (as I suspected it wasn't related to my user defined function). For the newbies out there (of which I'm one) the problem was I was comparing strings in the graphical mapping tool using the Boolean "EQUALS" rather than the Text "EQUALSS".
Can you give yourself points for solving -
User-defined function in FILTER clause
hi,
can i create the user-defined functions and use them in the FILTER clause in the sem_match function? there are some built-in functions for the FILTER clasue. however, only one function (DATATYPE(literal)) support for date/time in the built-in functions. i want to implement some user-defined funcitons in the FILTER clause which can check time intervals in ontology. there are some functions about valid time in the WorkSpace Manager such as WM_OVERLAPS, WM_CONTAINS,WM_MEETS, etc. so, can i write some functions using the these valid time functions in WM and use them in the FILTER clause? thanks a lot in advance.
hongHi Hong,
You don't need user-defined functions to do time interval comparisons. You can directly compare xsd:dateTime values with the built-in comparison operators: <, >, =, !=, <=, >=
For example, the query pattern below could find events that happened during event1 if we have data such as:
:event1 :startTime "2013-01-01T03:15:00Z"^^xsd:dateTime .
:event1 :endTime "2013-02-01T02:15:00Z"^^xsd:dateTime .
:event2 :startTime "2013-01-11T14:15:00Z"^^xsd:dateTime .
:event2 :startTime "2013-01-14T12:15:00Z"^^xsd:dateTime .
SELECT ?e2
WHERE
{ :event1 :startTime ?e1_st; :endTime ?e1_et .
?e2 :startTime ?e2_st; endTime ?e2_et .
FILTER (?e1_st < ?e2_st && ?e2_et < ?e1_et) }
In general, it is trivial to convert interval relations such as meets and overlaps to conditions on start and end times.
Hope this helps.
- Matt -
User Defined Function Error - Can't find function
Hi All,
Version: 11.1.1.4
I created a user defined function and added it to one of my BPEL Processes. I can see the function in JDeveloper and can compile the project without issue. We placed the jar file out on the SOA Server following the oracle user defined function examples. After placing the file out on weblogic I was able to successfully deploy the project.
Oracle Deployment Steps:
To deploy user-defined functions to runtime:
1. Copy the user-defined function JAR files to BEA_Home/user_projects/domains/domain_name/lib or a subdirectory of lib. Where domain_name is the name of the Oracle WebLogic Server domain (for example, soainfra).
2. Restart the Oracle WebLogic Server.However, when I try to run the composite application I get the below error. I am not really sure why it can't find the Function? The jar is out on the server and the jar was added to the project?
Error:
Non Recoverable System Fault :
<bpelFault><faultType>0</faultType><subLanguageExecutionFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is pnl:GetManager(string(bpws:getVariableData('inputVariable','payload','/client:process/client:input'))). The XPath expression failed to execute; the reason was: Function 'GetManager' not found.. Check the detailed root cause described in the exception message text and verify that the XPath query is correct. </summary></part><part name="code"><code>XPathExecutionError</code></part></subLanguageExecutionFault></bpelFault>Any suggestions would be greatly appreciated!
Thanks,
S
Edited by: Scarpacci on Apr 1, 2011 6:06 AMtry putting the jar location explicitly in weblogic server's classpath i.e. add BEA_Home/user_projects/domains/domain_name/lib to wls classpath and restart server.
-
How to call User defined functions in Mathscript Node ?
Hi,
I have created a user defined function and saved it to Search path of Labview as an M file. If I run my program in Math script window, the function is recognized and the program works properly. If I do the same with MathScript node , the user defined functions are not identified.
Kindly help me with this problem. Thanks in advance
Cheers
Lenord MelvixThis page may help:
http://zone.ni.com/reference/en-XX/help/373123C-01/lvtextmathmain/caveats_recommendations_ms_search_...
Kevin C. -
User - defined functions for calculating the taxes of state and country
hi expects,
how can write user-defined function in message mapping in which i want to calculate the states taxes (2500) and country taxes (5000) and give the result as grand total in output.please help me?Hi,
Activities
1. To create a new user-defined function, in the data-flow editor, choose Create New Function (This
graphic is explained in the accompanying text), which is located on the lower left-hand side of the
screen. In the menu, choose Simple Function or Advanced Function.
2. In the window that appears, specify the attributes of the new function:
Name
Technical name of the function. The name is displayed in the function chooser and on the data-flow
object.
Description
Description of how the function is used.
Cache
Function type (see above)
Argument Count
In this table, you specify the number of input values the function can process, and name them. All
functions are of type String.
3. In the window that appears, you can create Java source code:
a. You can import Java packages to your methods from the Imports input field, by specifying them
separated by a comma or semi-colon:
You do not need to import the packages java.lang., java.util., java.io., and java.lang.reflect. since
all message mappings require these packages and therefore import them. You should be able to
access standard JDK and J2EE packages of the SAP Web Application Server by simply specifying the
package under Import. In other words, you do not have to import it as an archive into the Integration
Repository. You can also access classes of the SAP XML Toolkit, the SAP Java Connector, and the
SAP Logging Service (see also: Runtime Environment (Java-Mappings)).
In addition to the standard packages, you can also specify Java packages that you have imported as
archives and that are located in the same, or in an underlying software component version as the
message mapping.
b. Create your Java source text in the editor window or copy source text from another editor.
4. Confirm with Save and Close.
5. User-defined functions are limited to the message mapping in which you created the function. To
save the new function, save the message mapping.
6. To test the function, use the test environment.
The new function is now visible in the User-Defined function category. When you select this category,
a corresponding button is displayed in the function chooser pushbutton bar. To edit, delete, or add the
function to the data-flow editor, choose the arrow next to the button and select from the list box
displayed.
Regards
Seshagiri -
How do you create a user defined functions UDF and passing a value like a ID to GEt a Value.
How do you create a user defined functions UDF and passing a
value like a ID to GEt a Value.
using a query.
are there example.
Thankstons of examples at cflib.org - good place to start, even
though many
udfs there are a bit outdated in their code...
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com -
How to call Microsoft SQL User defined function??
I am trying to call Miscrosoft SQL user defined function (not stored procedure) and experience problems. The function -- func_profile_history takes 3 inputs and returns resultSet.
Please let me know if there is any examples some where. All the examples I found are for stored procedure.
Thanks....
Siu
************ source *************
public Vector callSqlFunction(String eidTradcom, String idSku, String endDate, String idUserPost)
throws TradcomException, RemoteException
System.out.println("--------------in callSqlFunction--------------1");
Connection conn = null;
java.sql.CallableStatement cstmt = null;
ResultSet rs = null;
ForecastInfo info = null;
Vector v = new Vector();
try{
conn = TradcomUtils.getConnection();
String sql = "{call func_profile_history(?,?,?)}";
System.out.println("--------------in callSqlFunction--------sql="+sql);
cstmt = conn.prepareCall(sql);
System.out.println("--------------in callSqlFunction-------2");
cstmt.setString(1, eidTradcom);
cstmt.setString(2, idSku);
cstmt.setString(3, endDate);
System.out.println("--------------in callSqlFunction-------3");
rs = cstmt.executeQuery();
System.out.println("--------------in callSqlFunction-------4");
while (rs.next()){
info = new ForecastInfo ();
info.setEidTradcom(rs.getString("eid_tradcom"));
info.setIdSku(rs.getString("id_sku"));
info.setQtOnHand(rs.getDouble("qt_on_hand"));
info.setQtOnHold(rs.getDouble("qt_hold"));
info.setQtNetOnHand(rs.getDouble("qt_net_on_hand"));
info.setQtAlloc(rs.getDouble("qt_alloc"));
info.setQtAvailUnalloc(rs.getDouble("qt_avail_unalloc"));
info.setQtPoShip(rs.getDouble("qt_po_ship"));
info.setQtPoRcvd(rs.getDouble("qt_po_rcvd"));
info.setQtTransit(rs.getDouble("qt_transit"));
info.setQtAsn(rs.getDouble("qt_asn"));
info.setQtPo(rs.getDouble("qt_po"));
info.setQtPoBalance(rs.getDouble("qt_po_balance"));
info.setQtSoShip(rs.getDouble("qt_so_ship"));
info.setQt4Cast(rs.getDouble("qt_4cast"));
v.addElement(info);
System.out.println("--------------in callSqlFunction-------5");
System.out.println("--------------in callSqlFunction-------v="+v);
return v;
}catch(Exception ex){
System.out.println("Error in callSqlFunction:"+ ex.getMessage());
throw CachingManager.getTradcomException(ex, "Error in callSqlFunction");
}finally{
try{ if (cstmt != null) cstmt.close(); } catch(Exception ex){}
try{ if (conn != null) conn.close(); } catch(Exception ex){}
********************* error output ***************
********************* bef calling callSqlFunction
--------------in callSqlFunction--------------1
--------------in callSqlFunction--------sql={call func_profile_history(?,?,?)}
--------------in callSqlFunction-------2
--------------in callSqlFunction-------3
Error in callSqlFunction:The request for procedure 'func_profile_history' failed
because 'func_profile_history' is a function object. Severity 18, State 1, Proc
edure 'LAP_DUAL null', Line 4
ERROR=Error in callSqlFunction...The request for procedure 'func_profile_history
' failed because 'func_profile_history' is a function object. Severity 18, State
1, Procedure 'LAP_DUAL null', Line 4well, I tried the preparedStatemnet and it worked. Case closed.
-
How to resolve the error while using user defined function.
EPN Assembly file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:wlevs="http://www.bea.com/ns/wlevs/spring"
xmlns:jdbc="http://www.oracle.com/ns/ocep/jdbc"
xmlns:spatial="http://www.oracle.com/ns/ocep/spatial"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.bea.com/ns/wlevs/spring
http://www.bea.com/ns/wlevs/spring/spring-wlevs-v11_1_1_3.xsd
http://www.oracle.com/ns/ocep/jdbc
http://www.oracle.com/ns/ocep/jdbc/ocep-jdbc.xsd
http://www.oracle.com/ns/ocep/spatial
http://www.oracle.com/ns/ocep/spatial/ocep-spatial.xsd">
<wlevs:event-type-repository>
<wlevs:event-type type-name="TestEvent">
<wlevs:class>com.bea.wlevs.event.example.FunctionCEP.TestEvent</wlevs:class>
</wlevs:event-type>
</wlevs:event-type-repository>
<wlevs:adapter id="InputAdapter"
class="com.bea.wlevs.adapter.example.FunctionCEP.InputAdapter">
<wlevs:listener ref="inputStream" />
</wlevs:adapter>
<wlevs:channel id="inputStream" event-type="TestEvent">
<wlevs:listener ref="processor" />
</wlevs:channel>
<wlevs:processor id="processor">
<wlevs:listener ref="outputStream" />
<wlevs:function function-name="sum_fxn" exec-method="execute">
<bean>com.bea.wlevs.example.FunctionCEP.TestFunction</bean>
</wlevs:function>
</wlevs:processor>
<wlevs:channel id="outputStream" event-type="TestEvent">
<wlevs:listener ref="bean" />
</wlevs:channel>
<bean id="bean" class="com.bea.wlevs.example.FunctionCEP.OutputBean">
</bean>
</beans>
Event class
package com.bea.wlevs.event.example.FunctionCEP;
public class TestEvent {
private int num_1;
private int num_2;
private int sum_num;
public int getSum_num() {
return sum_num;
public void setSum_num(int sumNum) {
sum_num = sumNum;
public int getNum_1() {
return num_1;
public void setNum_1(int num_1) {
this.num_1 = num_1;
public int getNum_2() {
return num_2;
public void setNum_2(int num_2) {
this.num_2 = num_2;
Adapter class
package com.bea.wlevs.adapter.example.FunctionCEP;
import com.bea.wlevs.ede.api.RunnableBean;
import com.bea.wlevs.ede.api.StreamSender;
import com.bea.wlevs.ede.api.StreamSource;
import com.bea.wlevs.event.example.FunctionCEP.TestEvent;
public class InputAdapter implements RunnableBean, StreamSource {
private StreamSender eventSender;
public InputAdapter() {
super();
public void run() {
generateMessage();
private void generateMessage() {
TestEvent event = new TestEvent();
event.setNum_1(10);
event.setNum_2(20);
eventSender.sendInsertEvent(event);
public void setEventSender(StreamSender sender) {
eventSender = sender;
public synchronized void suspend() {
Output Bean class
package com.bea.wlevs.example.FunctionCEP;
import com.bea.wlevs.ede.api.StreamSink;
import com.bea.wlevs.event.example.FunctionCEP.TestEvent;
import com.bea.wlevs.util.Service;
public class OutputBean implements StreamSink {
public void onInsertEvent(Object event) {
System.out.println("In Output Bean");
TestEvent event1 = new TestEvent();
System.out.println("Num_1 is :: " + event1.getNum_1());
System.out.println("Num_2 is :: " +event1.getNum_2());
System.out.println("Sum of the numbers is :: " +event1.getSum_num());
Function Class
package com.bea.wlevs.example.FunctionCEP;
public class TestFunction {
public Object execute(int num_1, int num_2)
return (num_1 + num_2);
config.xml file
<?xml version="1.0" encoding="UTF-8"?>
<wlevs:config xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
xmlns:jdbc="http://www.oracle.com/ns/ocep/config/jdbc">
<processor>
<name>processor</name>
<rules>
<view id="v1" schema="num_1 num_2">
<![CDATA[
select num_1, num_2 from inputStream
]]>
</view>
<view id="v2" schema="num_1 num_2">
<![CDATA[
select sum_fxn(num_1,num_2), num_2 from inputStream // I am getting error when i am trying to call this function
]]>
</view>
<query id="q1">
<![CDATA[
select from v2[now] as num_2* // Showing error while accessing the view also ]]>
</query>
</rules>
</processor>
</wlevs:config>
Error I am getting is :
Invalid statement: "select >>sum_fxn<<(num_1,num_2),age from inputStream"
Description: Invalid call to function or constructor: sum_fxn
Cause: Probable causes are: Function name sum_fxn(int,int) provided is invalid, or arguments are of
the wrong type., or Error while handling member access to complex type. Constructor sum_fxn of type
sum_fxn not found. or Probable causes are: Function name sum_fxn(int,int) provided is invalid, or
arguments are of the wrong type., or Error while handling member access to complex type.
Constructor sum_fxn of type sum_fxn not found.
Action: Verify function or constructor for complex type exists, is not ambiguous, and has the correct
number of parameters.
I have made a user defined function in a java class and configured this function in the EPN assembly file under the processor tag.
But when i am trying to access the function in the config.xml file , it is giving me an error in the query.
Please provide urgent help that how to write the exact query.Hi,
In the EPN Assembly file use
<bean class="com.bea.wlevs.example.FunctionCEP.TestFunction"/>
instead of
<bean>com.bea.wlevs.example.FunctionCEP.TestFunction</bean>
Best Regards,
Sandeep
Maybe you are looking for
-
I have music on one computer but need to move to another
I am sure this has been asked several times but I have not been able to find a concrete answer. I have two laptops. The original one has tons of songs that have not been purchased through itunes but instead downloaded from CD's and an Itunes account
-
I am evaluating the sun RI of javax.sql package . I downloaded the jdbc_rowset_tiger-1_0_1-mrel-jwsdp.zip package and installed in my machine. I tried the JdbcRowSet implmenation and it worked pretty smooth. I wanted to try the disconnected Rowset im
-
Who are inactive employees in SAP in regards to Personnel Administration?
HI folks, In PA an ee becomes inactive or withdrawn after we terminate someone. I was wondering why there is a distinction between inactive and withdrawn. So, the question arises who are inactive and who are withdrawn ees. and one more question on th
-
I have got error 6 problem this is the Log file of what came back
Any ideas on how to solve this 2009-08-11 23:37:30.897 iTunes.exe[4696:1788]: restore library built Jul 8 2009 18:40:00 2009-08-11 23:37:30.897 iTunes.exe[4696:1788]: iTunes: iTunes 8.2.1.6 2009-08-11 23:37:30.898 iTunes.exe[4696:1788]: iTunes: Softw
-
Background Video Menu with Buttons on Top
Hi there. I am trying to create a menu that has a looping video background with the buttons on top of the video. I have created a short, 1min video in PPro, and imported it into the background of the menu by first creating a blank menu, then alt/drag