Invoking a PL/SQL function from BPEL throws fault.
Hi, I'm trying to invoke a PL/SQL function that inserts data in to a table from a BPEL via DB Adapter. The process, when I test it, throws a runtime fault as follows:
*Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'EmpRegister' failed due to: JCA Binding Component connection issue. JCA Binding Component is unable to create an outbound JCA (CCI) connection. AddEmployee:EmpRegister [ EmpRegister_ptt::EmpRegister(InputParameters,OutputParameters) ] : The JCA Binding Component was unable to establish an outbound JCA CCI connection due to the following issue: BINDING.JCA-12510 JCA Resource Adapter location error. Unable to locate the JCA Resource Adapter via .jca binding file element <connection-factory/> The JCA Binding Component is unable to startup the Resource Adapter specified in the <connection-factory/> element: location='eis/DB/DBConn_215'. The reason for this is most likely that either 1) the Resource Adapters RAR file has not been deployed successfully to the WebLogic Application server or 2) the '<jndi-name>' element in weblogic-ra.xml has not been set to eis/DB/DBConn_215. In the last case you will have to add a new WebLogic JCA connection factory (deploy a RAR). Please correct this and then restart the Application Server ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.*
Also, the fault description was a s follows:
*JCA Resource Adapter location error. Unable to locate the JCA Resource Adapter via .jca binding file element <connection-factory/> The JCA Binding Component is unable to startup the Resource Adapter specified in the <connection-factory/> element: location='eis/DB/DBConn_215'. The reason for this is most likely that either 1) the Resource Adapters RAR file has not been deployed successfully to the WebLogic Application server or 2) the '<jndi-name>' element in weblogic-ra.xml has not been set to eis/DB/DBConn_215. In the last case you will have to add a new WebLogic JCA connection factory (deploy a RAR). Please correct this and then restart the Application Server.*
I know, it looks like a JCA adapter error, but when I do a DB to DB table synchronization with this connection factory, no problems happen. Is ther any special procedure I should follow in mapping input data to db schema?
HI,
I am working on BPEL process and human workflow...
I created a process and a Data control and now can see it as JCA Adapter in console..in this adapter I am executing a sql procedure.. we can execute in in BPEL process through invoke activity, now my requirement is how to invoke this data control through custom java code. please help...\
now i have two wsdl files.
RegistrationUpload.wsdl(process name)
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="RegistrationUpload"
targetNamespace="http://xmlns.oracle.com/RegistrationUpload_jws/RegistrationUpload/RegistrationUpload"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:client="http://xmlns.oracle.com/RegistrationUpload_jws/RegistrationUpload/RegistrationUpload"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and use them as part of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://xmlns.oracle.com/RegistrationUpload_jws/RegistrationUpload/RegistrationUpload" schemaLocation="xsd/RegistrationUpload.xsd" />
</schema>
</wsdl:types>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<wsdl:message name="RegistrationUploadRequestMessage">
<wsdl:part name="payload" element="client:process"/>
</wsdl:message>
<wsdl:message name="RegistrationUploadResponseMessage">
<wsdl:part name="payload" element="client:processResponse"/>
</wsdl:message>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- portType implemented by the RegistrationUpload BPEL process -->
<wsdl:portType name="RegistrationUpload">
<wsdl:operation name="process">
<wsdl:input message="client:RegistrationUploadRequestMessage"/>
</wsdl:operation>
</wsdl:portType>
<!-- portType implemented by the requester of RegistrationUpload BPEL process
for asynchronous callback purposes
-->
<wsdl:portType name="RegistrationUploadCallback">
<wsdl:operation name="processResponse">
<wsdl:input message="client:RegistrationUploadResponseMessage"/>
</wsdl:operation>
</wsdl:portType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
the RegistrationUpload partnerLinkType binds the provider and
requester portType into an asynchronous conversation.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plnk:partnerLinkType name="RegistrationUpload">
<plnk:role name="RegistrationUploadProvider">
<plnk:portType name="client:RegistrationUpload"/>
</plnk:role>
<plnk:role name="RegistrationUploadRequester">
<plnk:portType name="client:RegistrationUploadCallback"/>
</plnk:role>
</plnk:partnerLinkType>
</wsdl:definitions>
uploadDataToPermananentDB.wsdl
<?binding.jca uploadDataToPermananentDB_db.jca?>
<wsdl:definitions name="uploadDataToPermananentDB"
targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/RegistrationUpload/RegistrationUpload/uploadDataToPermananentDB"
xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/DAMSMGR/TEMP_TO_PERMANENTDB/"
xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/RegistrationUpload/RegistrationUpload/uploadDataToPermananentDB"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
<plt:partnerLinkType name="uploadDataToPermananentDB_plt">
<plt:role name="uploadDataToPermananentDB_role">
<plt:portType name="tns:uploadDataToPermananentDB_ptt"/>
</plt:role>
</plt:partnerLinkType>
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://xmlns.oracle.com/pcbpel/adapter/db/DAMSMGR/TEMP_TO_PERMANENTDB/"
schemaLocation="xsd/DAMSMGR_TEMP_TO_PERMANENTDB.xsd"/>
</schema>
</wsdl:types>
<wsdl:message name="args_in_msg">
<wsdl:part name="InputParameters" element="db:InputParameters"/>
</wsdl:message>
<wsdl:portType name="uploadDataToPermananentDB_ptt">
<wsdl:operation name="uploadDataToPermananentDB">
<wsdl:input message="tns:args_in_msg"/>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>
please help me how to call the data adaper from my java code..
hope i will get some hint in this forum...
Edited by: user13370040 on Mar 22, 2011 5:55 AM
Similar Messages
-
Error PLS-00306 during calling PL/SQL function from Java
Hi all,
I am facing a problem during call of oracle PL/SQL function from java using CallableStatement.
I receive following error message.
java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'EXPORT_HIST_ALARMS_FUNC'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
As per above error EXPORT_HIST_ALARMS_FUNC in oracle has this signature.
CREATE OR REPLACE FUNCTION EXPORT_HIST_ALARMS_FUNC(startDateTime VARCHAR2, endDateTime VARCHAR2, meType VARCHAR2) RETURN VARCHAR2 IS
END EXPORT_HIST_ALARMS_FUNC;
Above function I have called following way in java.
String sql = "begin ?:= EXPORT_HIST_ALARMS_FUNC(?, ?, ?); end;" ;
CallableStatement cStatement = null;
cStatement = connection.prepareCall(sql);
cStatement.registerOutParameter(1,Types.VARCHAR);
cStatement.setString(2,startDateTime);
cStatement.setString(3,endDateTime);
cStatement.setString(4,meType);
cStatement.execute();
msg = cStatement.getString(1);
Actually above function requires three input parameters and one return parameter.
During execution of above java code it throws SQLException and shows PLS-00306: wrong number or types of arguments in call to 'EXPORT_HIST_ALARMS_FUNC' error.
I have run this function directly from oracle with three parameters and run successfully and finally it returns string.
But I am unable to figure out why it doesn't run from above java code.
Please help regarding this.
Thanks.
Regards,
Shardul BankerTry this:
String sql = "begin ?:= EXPORT_HIST_ALARMS_FUNC(?, ?, ?); end;" ;
CallableStatement cStatement = null;
cStatement = connection.prepareCall(sql);
cStatement.registerOutParameter(1,Types.VARCHAR);
cStatement.setString(1,startDateTime);
cStatement.setString(2,endDateTime);
cStatement.setString(3,meType);
cStatement.execute();
msg = cStatement.getString(1);Regards,
Martijn Teigeler
Edited by: mTeigeler on Oct 13, 2007 10:22 AM -
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 -
How to call pl/sql function from element values
EBS 11.5.10.2
XMLP 5.6.3
Hello,
I noticed that the output of the rdf-to-data template conversion process makes use of an undocumented feature of data templates, and I would like to get input from experts as to which situations this feature is usable.
The closest thing I can find in the documentation is a sample in the user guide. There is a "General Ledger Journals Data Template Example" that has a <dataStructure> section that contains <element> nodes which are NOT children of a <group> node. I can't find any explanation of this in the user guide.
I've noticed from converted templates that in these un-grouped elements you can make calls to PL/SQL functions in the "value" attribute, like this:
<dataStructure>
<group name="G_LINES" source="Q_MAIN">
<element name="Line_Num" value="Line_Num"/>
</group>
<element name="C_CALCULATED_VALUE" dataType="number" value="XX_CUSTOMPROCS.SOME_FUNCTION"/>
</dataStructure>Has anyone had any success being able to call PL/SQL functions from grouped elements? Whenever I try, it doesn't seem to work.
When I try something like this:
<dataStructure>
<group name="G_LINES" source="Q_MAIN">
<element name="Line_Num" value="Line_Num"/>
<element name="some_calculation" value="XX_CUSTOMPROCS.SOME_FUNCTION"/>
<element name="some_calculation_b" value="XX_CUSTOMPROCS.SOME_FUNCTION_B(:Line_Num)"/>
</group>
<element name="C_CALCULATED_VALUE" dataType="number" value="XX_CUSTOMPROCS.SOME_FUNCTION"/>
</dataStructure>The <SOME_CALCULATION/> and <SOME_CALCULATION_B/> nodes come out empty in the output data xml file, but <C_CALCULATED_VALUE> would have a value as desired.ah - perfect. That makes sense. Thank you for the response!
But what about when we need to pass parameters to those functions whos values are the results of aggregate element values?
This happens a lot in the converted data templates, where pl/sql package functions are meant to replace formula columns from the original Oracle Report. Take this example from the conversion of ARXAGMW.rdf (Aging Report, 7 Buckets):
(note the function call in the value of "Set_Percent_Inv_Inv" is using aggregate results from subgroups)
<group name="G_INV_INV" dataType="varchar2" source="Q_Invoice">
<element name="Total_Inv_Inv_Amt" function="sum" dataType="number" value="G_Invoice.C_Amt_Due_Rem_Inv"/>
<element name="Total_Inv_Inv_B0" function="sum" dataType="number" value="G_Invoice.C_Inv_B0"/>
<element name="Total_Inv_Inv_B1" function="sum" dataType="number" value="G_Invoice.C_Inv_B1"/>
<element name="Total_Inv_Inv_B2" function="sum" dataType="number" value="G_Invoice.C_Inv_B2"/>
<element name="Total_Inv_Inv_B3" function="sum" dataType="number" value="G_Invoice.C_Inv_B3"/>
<element name="Total_Inv_Inv_B4" function="sum" dataType="number" value="G_Invoice.C_Inv_B4"/>
<element name="Total_Inv_Inv_B5" function="sum" dataType="number" value="G_Invoice.C_Inv_B5"/>
<element name="Total_Inv_Inv_B6" function="sum" dataType="number" value="G_Invoice.C_Inv_B6"/>
<element name="Set_Percent_Inv_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.set_percent_inv_invformula(:Total_Inv_Inv_Amt, :Total_Inv_Inv_B0, :Total_Inv_Inv_B1, :Total_Inv_Inv_B2, :Total_Inv_Inv_B3, :Total_Inv_Inv_B4, :Total_Inv_Inv_B5, :Total_Inv_Inv_B6)"/>
<element name="Sum_Percent_B0_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B0_Inv_p"/>
<element name="Sum_Percent_B1_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B1_Inv_p"/>
<element name="Sum_Percent_B2_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B2_Inv_p"/>
<element name="Sum_Percent_B3_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B3_Inv_p"/>
<element name="Sum_Percent_B4_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B4_Inv_p"/>
<element name="Sum_Percent_B5_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B5_Inv_p"/>
<element name="Sum_Percent_B6_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B6_Inv_p"/>
<group name="G_Cust_Inv" dataType="varchar2" source="Q_Invoice">
<group name="G_Site_Inv" dataType="varchar2" source="Q_Invoice">
<group name="G_1" dataType="varchar2" source="Q_Invoice">
<group name="G_Invoice" dataType="varchar2" source="Q_Invoice">
<element name="C_Amt_Due_Rem_Inv" dataType="number" value="C_Amt_Due_Rem_Inv"/>
<element name="C_Inv_B0" dataType="number" value="C_Inv_B0"/>
<element name="C_Inv_B1" dataType="number" value="C_Inv_B1"/>
<element name="C_Inv_B2" dataType="number" value="C_Inv_B2"/>
<element name="C_Inv_B3" dataType="number" value="C_Inv_B3"/>
<element name="C_Inv_B4" dataType="number" value="C_Inv_B4"/>
<element name="C_Inv_B5" dataType="number" value="C_Inv_B5"/>
<element name="C_Inv_B6" dataType="number" value="C_Inv_B6"/>
</group>
</group>
</group>
</group>
</group>
...All of these groups and sub-groups are based on one single query, so I am not sure how I would move the function call into the query without changing the results of the function.
In the example above, elements Sum_Percent_B0_Inv through Sum_Percent_B6_Inv grab the results of the calculation done in set_percent_inv_invformula. Here is the essence of that function:
sum_percent_b0_inv := ROUND ((total_inv_inv_b0 / total_inv_inv_amt) * 100, 2);
sum_percent_b1_inv := ROUND ((total_inv_inv_b1 / total_inv_inv_amt) * 100, 2);
sum_percent_b2_inv := ROUND ((total_inv_inv_b2 / total_inv_inv_amt) * 100, 2);
sum_percent_b3_inv := ROUND ((total_inv_inv_b3 / total_inv_inv_amt) * 100, 2);
sum_percent_b4_inv := ROUND ((total_inv_inv_b4 / total_inv_inv_amt) * 100, 2);
sum_percent_b5_inv := ROUND ((total_inv_inv_b5 / total_inv_inv_amt) * 100, 2);
sum_percent_b6_inv := ROUND ((total_inv_inv_b6 / total_inv_inv_amt) * 100, 2);The only solution I can think of is to have separate queries, one for each subgroup, that do the "sum" in sql; but that seems terribly inefficient. -
Calling a PL/SQL function from java
I would like to call a pl/sql function from java. My pl/sql function is taking arrays of records as parameters. How do i proceed? Which specific oracle packages do I have to import?
Please send an example.
TIA,
Darko GuberinaDocumentation here: http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref185
says JPublisher can publish records too.
But when I change the example given at http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref190 as following:
PACKAGE "COMPANY" AS
type emp_rec is record (empno number, ename varchar2(10));
type emp_list is varray(5) of emp_rec;
type factory is record (
name varchar(10),
emps emp_list
function get_factory(p_name varchar) return factory;
END;
then I see <unknown type or type not found> at sql or java files generated. Any ideas? -
Calling PL/SQL function from external Java class
I was wondering if I was able to call a pl/sql function from an external java class? If so, would you be able to tell me briefly on how to go about it. I know I can call java methods that are internally stored in the db from pl/sql, but I was hoping I could call pl/sql from external java. Thanks,
KellyOk, I made the changes, but I'm now getting the following error:
Error code = 1403
Error message = ORA-01403: no data found
ORA-06512: at "IOBOARD.GETSTATUS", line 6
ORA-06512: at line 1
The ora-01403 I don't understand because there is data for the name Kelly.Brace.
ora-06512 error: at string line string.
Here's what the code looks like after I made the changes:
String sql = "{?=call ioboard.GetStatus(?)}";
// create a Statement object
myStatement = myConnection.prepareCall( sql );
myStatement.setString( 1, "Kelly.Brace" );
myStatement.registerOutParameter(2, java.sql.Types.LONGVARCHAR );
// create a ResultSet object, and populate it with the
// result of a SELECT statement
ResultSet myResultSet = myStatement.executeQuery();
// retrieve the row from the ResultSet using the
// next() method
myResultSet.next();
// retrieve the user from the row in the ResultSet using the
// getString() method
String status = myResultSet.getString(1);
System.out.println("Hello Kelly, your status is: " + status);
// close this ResultSet object using the close() method
myResultSet.close();Here's what the function looks like:
CREATE OR REPLACE FUNCTION GetStatus( user_name in varchar2)
RETURN VARCHAR2
is
v_status varchar2(10);
BEGIN
select iob_location into v_status
from ioboard.iob_user
where iob_username = user_name;
RETURN( v_status);
END;This works perfectly in the SQL Window:
select iob_location
from ioboard.iob_user
where iob_username = 'Kelly.Brace'; -
Calling PL/SQL function from OCI?
Hi,
How do I execute a PL/SQL function from OCI?
My test function:
CREATE OR REPLACE FUNCTION GetNodeQuery(TypeId IN INTEGER) RETURN VARCHAR2 IS
Query VARCHAR2(500);
BEGIN
Query := 'Select * from Logical_Name';
RETURN Query;
END GetNodeQuery;
char SQL[16];
strcpy(SQL, "GetNodeQuery(1)");
char ColumnVariable[500];
int VariableSize = 500;
OCIStmtPrepare(qHandle, hError, SQL, (ub4)strlen(SQL),
(ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT);
OCIDefineByPos(qHandle, &pDefine, hError, 1,
(dvoid*)ColumnVariable, (sb4)VariableSize,
1,(dvoid*)0, (ub2*)0, (ub2*)0,
OCI_DEFAULT);
OCIStmtExecute(svchp, qHandle, hError, (ub4)1, (ub4)0,
(CONST OCISnapshot *)NULL, (OCISnapshot*)NULL,
OCI_DEFAULT);
On the Execute I get an error saying that ORA-00900: invalid SQL statement
Any Help would be appreciated.
Thank You,
Scott Metzger
nullOk, I made a mistake the
select GetNodeQuery(1) from dual
only works with a simple function. My real life function has a cursor via DBMS_SQL.
I presume I would need to pass the following in my OCIStmtPrepare call:
Define
tmp Varchar2[256];
begin
tmp := GetNodeQuery(1);
end;
Now how do I get the value of tmp out?
I couldn't find any examples for calling functions from OCI. If you know of some could you post the url or send them to me?
Thanks,
*:> Scott
[email protected]
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Tiago Nodari ([email protected]):
you need to modify the sqlstatement to look something like this...
begin
GetNodeQuery(1)
end;
look into the OCI documentation, there are various examples of how to do it, including, binding and defining variables...
<HR></BLOCKQUOTE>
null -
URGENT: Error while invoking soap-based web service from BPEL process
I am trying to invoke a soap-based web service deployed in a different OC4J container but on the same iAS middle tier install as the BPEL server. The deployment is successful. I am running 10.1.2 BPEL server.
But invoking a process throws the following error.
<remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
<part name="summary">
<summary>when invoking locally the endpoint 'http://stadd53.us.oracle.com:7779/idm/ProvService/cps', ; nested exception is: ORABPEL-02052 Cannot lookup BPEL domain. The BPEL domain "ProvService" cannot be found; the domain may not have initialized properly. Please verify that the BPEL domain loader has a valid set of initialization properties in the application properties file.</summary>
</part>
<part name="detail">
<detail>ORABPEL-02052 Cannot lookup BPEL domain. The BPEL domain "ProvService" cannot be found; the domain may not have initialized properly. Please verify that the BPEL domain loader has a valid set of initialization properties in the application properties file.</detail>
</part>
</remoteFault>
Any ideas on what the problem might be ?Sandor,
Thanks. Your suggestion of turning off optSoapShortcut worked. So does that mean that by default remote web services cannot be invoked from BPEL process by SOAP - unless this configuration change is done ? -
How do I call pl/sql function from Toplink
I can easily call a stored procedure from Toplink
====================================================
public Collection executeSelectingStoredProcedure(StoredProcedureCall storedProcedureCall) throws DAOException
Collection returnValue = null;
Session session = null;
session = this.getSession();
returnValue = session.executeSelectingCall(storedProcedureCall);
session.release();
return returnValue;
====================================================
The same does not work for pl/sql functions. Doesnt Toplink treat function calls as a callable statement as in JDBC?
"select <function_name>(<arguments>) from dual" seems to be a work around. If this or using expressions is the only solution can someone please tell me the reasoning behind this shift.
Regards
Aamir DehlaviI have the same problem.
I have a PL/SQL function that returns a number. This function receives 2 parameters. I use StoredProcedureCall plus ValueReadQuery.
Session aSession = SessionManager.getManager().getDefaultSession();
StoredProcedureCall call = new StoredProcedureCall();
call.setProcedureName("CIO_UTILS.COUNT_USER_ROLES_IN_MODULE");
call.addNamedArgument("p_persid");
call.addNamedArgument("p_module");
call.addUnamedOutputArgument("rolesnum", Integer.class);
ValueReadQuery query = new ValueReadQuery();
//query.bindAllParameters();
query.setCall(call);
query.addArgument("p_persid");
query.addArgument("p_module");
Vector parameters = new Vector();
parameters.addElement(persid);
parameters.addElement(theModule);
Integer rolesnum = (Integer) aSession.executeQuery(query,parameters);
aSession.release();
if(rolesnum.intValue()<=0)return false; else return true;
However, I receive the following error:
Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 96:
PLS-00312: a positional parameter association may not follow a named association
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Error Code: 6550
Call:BEGIN CIO_UTILS.COUNT_USER_ROLES_IN_MODULE(p_persid=>'SANCRA2791', p_module=>'PSL_MONITORING', ?); END;
bind => [=> rolesnum]
If comment the line
"call.addUnamedOutputArgument("rolesnum", Integer.class);"
Toplink is trating it as a procedure, and I also receive an error from PL/SQL.
There should have to be a way of make it to receive the resoult somehow, but I do not know what.
Thanks in advance. -
How to call pl/sql function from oaf
Dear Friends,
I am trying to call a function from oaf page .but iam getting error like
java.sql.SQLException: ORA-01861: literal does not match format string
ORA-06512: at line 1
THis is my function ,,callable statement
FUNCTION CAR_LOAN_VALIDATION(P_PERSON_ID IN NUMBER
,P_DEDUCTION_START_DATE IN DATE
,P_DEDUCTION_END_DATE IN DATE
,P_LOAN_VALUE IN NUMBER
RETURN VARCHAR2
IS
l_message VARCHAR2(100);
l_contract_type VARCHAR2(50);
l_loan_eligible_date DATE;
l_grade VARCHAR2(15);
l_old_loan_end_date DATE;
l_max_loan_end_date DATE;
l_remaining_amount NUMBER;
l_eligible_amt NUMBER;
BEGIN
BEGIN
SELECT --papf.person_id,
(SELECT meaning
FROM hr_lookups
WHERE lookup_type = 'ADTC_CONTRACT_TYPE'
AND lookup_code = attribute3) contract_type,
ADD_MONTHS (papf.original_date_of_hire, 11) loan_eligible_date,
DECODE (paaf.ass_attribute2,
'Chairman', 'Chairman',
SUBSTR (ass_attribute2, INSTR (ass_attribute2, '.', 1, 1) + 1,
3)
) grade,
(SELECT nvl(MAX (deduction_end_date),null)
FROM xxadtc_car_loan_request
WHERE person_id = p_person_id) old_loan_end_date,
to_date(ADD_MONTHS (p_deduction_start_date, 47)) max_loan_end_date
--to_date(ADD_MONTHS (sysdate, 47)) max_loan_end_date
INTO l_contract_type
,l_loan_eligible_date
,l_grade
,l_old_loan_end_date
,l_max_loan_end_date
FROM per_all_people_f papf, per_all_assignments_f paaf
WHERE SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
AND papf.business_group_id = 81
AND papf.person_id = paaf.person_id
AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND papf.person_id =P_PERSON_ID;
EXCEPTION
WHEN others THEN
DBMS_OUTPUT.PUT_LINE('Error ');
END;
-- get Previous Car loan amount --
BEGIN
SELECT to_number(prrv.result_value)
INTO l_remaining_amount
FROM per_all_people_f papf,
per_all_assignments_f paaf,
pay_assignment_actions pac,
pay_run_results prr,
pay_run_result_values prrv,
pay_element_types_f petf,
pay_input_values_f pivf,
pay_element_classifications pec,
pay_payroll_actions ppa,
per_time_periods ptp
WHERE SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
AND papf.person_id = paaf.person_id
AND papf.business_group_id = 81
AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND paaf.assignment_id = pac.assignment_id
AND pac.assignment_action_id = prr.assignment_action_id
AND prr.run_result_id = prrv.run_result_id
AND prr.element_type_id = petf.element_type_id
AND SYSDATE BETWEEN petf.effective_start_date AND petf.effective_end_date
AND prrv.input_value_id = pivf.input_value_id
AND SYSDATE BETWEEN pivf.effective_start_date AND pivf.effective_end_date
AND pivf.NAME = 'Remaining Amount'
AND petf.classification_id = pec.classification_id
AND pac.payroll_action_id = ppa.payroll_action_id
AND ppa.time_period_id = ptp.time_period_id
AND TO_CHAR (ptp.pay_advice_date, 'Mon-YYYY') =
TO_CHAR (SYSDATE, 'Mon-YYYY')
AND petf.element_name = 'Motar Ahlami Loan'
--and employee_number='10185'
AND papf.person_id = p_person_id;
EXCEPTION
WHEN no_data_found THEN
--DBMS_OUTPUT.PUT_LINE('ERROR: No data!');
l_remaining_amount:=0;
WHEN others THEN
DBMS_OUTPUT.PUT_LINE('Error ');
END;
select GET_CAR_LOAN_ELIGI_AMT(P_PERSON_ID)
into l_eligible_amt
from dual;
IF l_contract_type NOT IN ('Permanent') THEN
l_message := 'Contract Type Is not valid';
END IF;
IF l_loan_eligible_date < SYSDATE THEN
l_message:= 'Date of Join is less then one year';
END IF;
IF l_grade IN ('US','00','AUS','EM') THEN
l_message:= 'Your are not Eligible Grade';
END IF;
IF l_old_loan_end_date < SYSDATE THEN
l_message:= 'Previous Loan Duration is not completed';
END IF;
IF l_max_loan_end_date > P_DEDUCTION_END_DATE THEN
l_message:= 'Maxinum number of monthly payment of 48 month';
END IF;
IF l_remaining_amount >0 THEN
l_message:= 'Previous Car Loan amount is pending till';
END IF;
IF l_eligible_amt < p_loan_value THEN
l_message:= 'Please check Eligible Amount ';
END IF;
RETURN nvl(l_message,'S');
EXCEPTION
WHEN NO_DATA_FOUND
THEN
RETURN 'Error';
END CAR_LOAN_VALIDATION;
END XX_CAR_LOAN_REQUEST_PKG;
CALLABLE STATEMENT CODE ---CO CODE
if(pageContext.getParameter("Submit")!=null) {
OAViewObject vo2 = (OAViewObject)am.findViewObject("XxadtcCarLoanRequestEOVO1");
if(vo1!=null){
vo1.getCurrentRow().setAttribute("LoanStatus","Pending Approval");
int xxpersonId = pageContext.getEmployeeId();
String xxDeductionStartDate = vo2.getCurrentRow().getAttribute("DeductionStartDate").toString();//pageContext.getParameter("DeductionStartDate").toString();
// SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy/mm/dd");
// Date convertedDate1 = dateFormat1.parse("xxDeductionStartDate");
String xxDeductionEndDate = vo2.getCurrentRow().getAttribute("DeductionEndDate").toString();//pageContext.getParameter("DeductionEndDate").toString();
// SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyy/mm/dd");
// Date convertedDate2 = dateFormat2.parse("xxDeductionEndDate");
String xxLoanValue = vo2.getCurrentRow().getAttribute("LoanValue").toString();//pageContext.getParameter("LoanValue").toString();
int iLoanValue = Integer.parseInt(xxLoanValue);
System.out.println("Entered into submit loop");
System.out.println("xxpersonId id is:"+xxpersonId);
System.out.println("xxDeductionStartDate id is:"+xxDeductionStartDate);
System.out.println("xxDeductionEndDate id is:"+xxDeductionEndDate);
System.out.println("xxLoanValue id is:"+xxLoanValue);
OADBTransaction txn = am.getOADBTransaction();
String sql ="BEGIN :1 :=XXADTC_CAR_LOAN_REQUEST_PKG.CAR_LOAN_VALIDATION(:2,:3,:4,:5); END;";
CallableStatement cs = txn.createCallableStatement(sql,1);
String outputval = null;// int outputval = 0;
try {
System.out.println("Entered in try loop of callable funtion validation");
cs.setInt(2,xxpersonId);
System.out.println("cs setInt(2,xxpersonId);is executed");
cs.setString(3,xxDeductionStartDate);
System.out.println("cs.setString(3,xxDeductionStartDate is executed);");
cs.setString(4,xxDeductionEndDate);
System.out.println("cs.setString(4,xxDeductionEndDate is executed);");
// cs.setDate(3,xxDeductionStartDate);
// cs.setDate(4,xxDeductionEndDate);
cs.setInt(5,iLoanValue);
cs.registerOutParameter(1,Types.VARCHAR);// cs.registerOutParameter(1,Types.NUMERIC);
cs.execute();
outputval = cs.getString(1);// txn.commit();
System.out.println(outputval);
txn.commit();
if(outputval.equals("S"))
am.invokeMethod("apply");
else
throw new OAException("Organization name is:"+outputval,OAException.INFORMATION);
txn.commit();
catch(Exception sqle){
try {
cs.close();
catch (Exception e)
throw OAException.wrapperException(e);
throw OAException.wrapperException(sqle);
Please help .where is the error is.
please help
let me know for any clarification.
Thanks
Aravinda.Hi Arvinda,
Refer Below code.
// In Controller
java.sql.Date DeductionSDate; //declare variable
//In PFR
String xxDeductionStartDate = vo2.getCurrentRow().getAttribute("DeductionStartDate");
OADBTransaction txn = am.getOADBTransaction();
if(xxDeductionStartDate!=null)
java.sql.Date startDate= txn.getOANLSServices().stringToDate(xxDeductionStartDate);
DeductionSDate = startDate;
Set this to cs.setDate(3,DeductionSDate);
Thanks,
Dilip -
How to test a simple PL SQL function from another PL SQL script
Hi,
I have created a function. Now i need to test that whether it is returning the correct values or not.
For that, i have written anothe pl sql script and trying to call this function. Im passing all the IN parameters in that function. I assume here that OUT parameters will provide me the result. Im trying to display the OUT parameter one by one to see my result.
I'm using toad as sql client here connected with oracle.
pl sql script:-
DECLARE
BEGIN
DBMS_OUTPUT.PUT_LINE('$$$$$$$ VINOD KUMAR NAIR $$$$$$$');
FETCH_ORDER_PRODUCT_DATA(320171302, 1006, 6999,
ODNumber OUT VARCHAR2, Line_Number OUT VARCHAR2,
ServiceID OUT VARCHAR2, BilltoNumber OUT VARCHAR2,
AnnualPrice OUT NUMBER, CoverageCode OUT VARCHAR2)
DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | ODNumber );
DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | Line_Number );
DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | ServiceID );
DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | BilltoNumber );
DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | AnnualPrice );
DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | CoverageCode );
END;
Function:-
Program Name : SPOT_Order_Product_Data_For_CFS.sql
Description : Function to Validate parameters from CFS
By : Vinod Kumar
Date : 08/19/2011
Modification History
By When TAR Description
CREATE OR REPLACE FUNCTION FETCH_ORDER_PRODUCT_DATA(orderNumber IN VARCHAR2, customerNumber IN VARCHAR2,
productLine IN VARCHAR2, ODNumber OUT VARCHAR2,
Line_Number OUT VARCHAR2, ServiceID OUT VARCHAR2,
BilltoNumber OUT VARCHAR2, AnnualPrice OUT NUMBER,
CoverageCode OUT VARCHAR2)
RETURN VARCHAR2 IS
lv_err_msg VARCHAR2(100) := '';
lv_bucket_id VARCHAR2(14);
lv_bill_number VARCHAR2(30);
lv_anual_price NUMBER;
lv_coverage_code VARCHAR2(8);
lv_quote_num NUMBER(10) := NULL;
lv_line_num NUMBER(5) := 0;
lv_customer_number VARCHAR2(30) := customerNumber;
lv_product_id VARCHAR2(14) := productLine;
lv_count_quote NUMBER := 0;
lv_quote_status VARCHAR2(5);
lv_quote_version NUMBER(2):=0;
BEGIN
IF INSTR(orderNumber, '-') = 0 THEN
lv_quote_num := orderNumber;
ELSE
lv_quote_num := SPT_Delimiter(orderNumber, 1, '-');
lv_line_num := SPT_Delimiter(orderNumber, 2, '-');
END IF;
--Check status of the quote COM, APP
SELECT COUNT(*) INTO lv_count_quote FROM sot_order_header WHERE ORDER_NUMBER=lv_quote_num
AND ORDER_STATUS IN ('APP', 'COM') AND CUSTOMER_NUMBER = lv_customer_number;
IF lv_count_quote = 0 THEN
lv_err_msg := 'Invalid Order number';
RETURN lv_err_msg;
END IF;
-- Fetch the latest version on SPOT quote
SELECT MAX(VERSION_NUMBER) INTO lv_quote_version FROM SPT_QUOTE_HEADER WHERE QUOTE_NUMBER = lv_quote_num
AND CUSTOMER_NUMBER = lv_customer_number;
-- If quote is valid fetch the data in OUT parameters
IF lv_line_num = 0 THEN
BEGIN
SELECT a.CUSTOMER_BILLTO_NUMBER,
b.LINE_NUMBER, b.BUCKET_ID,
b.ANNUAL_REF_RATE_USD, b.COVERAGE_CODE
INTO lv_bill_number,lv_line_num,lv_bucket_id,lv_anual_price,lv_coverage_code
FROM SPT_QUOTE_HEADER a, SPT_QUOTE_LINE b
WHERE a.QUOTE_NUMBER = lv_quote_num
AND a.CUSTOMER_NUMBER = lv_customer_number
AND a.VERSION_NUMBER = lv_quote_version
AND a.QUOTE_NUMBER = b.QUOTE_NUMBER
AND a.VERSION_NUMBER = b.VERSION_NUMBER
AND b.PRODUCT_ID = lv_product_id;
ODNumber := lv_quote_num;
BilltoNumber := lv_bill_number;
Line_Number := lv_line_num;
ServiceID := lv_bucket_id;
AnnualPrice := lv_anual_price;
CoverageCode := lv_coverage_code;
RETURN '';
EXCEPTION WHEN OTHERS THEN
lv_err_msg := 'Multiple PIDs existing in the SPOT order, please provide the SPOT order + line number as input data';
RETURN lv_err_msg;
END;
ELSE
BEGIN
SELECT a.CUSTOMER_BILLTO_NUMBER,
b.BUCKET_ID, b.ANNUAL_REF_RATE_USD,
b.COVERAGE_CODE
INTO lv_bill_number,lv_bucket_id,lv_anual_price,lv_coverage_code
FROM SPT_QUOTE_HEADER a, SPT_QUOTE_LINE b
WHERE a.QUOTE_NUMBER = lv_quote_num
AND a.CUSTOMER_NUMBER = lv_customer_number
AND a.VERSION_NUMBER = lv_quote_version
AND a.QUOTE_NUMBER = b.QUOTE_NUMBER
AND a.VERSION_NUMBER = b.VERSION_NUMBER
AND b.PRODUCT_ID = lv_product_id
AND b.LINE_NUMBER = lv_line_num;
ODNumber := lv_quote_num;
BilltoNumber := lv_bill_number;
Line_Number := lv_line_num;
ServiceID := lv_bucket_id;
AnnualPrice := lv_anual_price;
CoverageCode := lv_coverage_code;
RETURN '';
EXCEPTION WHEN OTHERS THEN
lv_err_msg := 'Multiple SPOT lines exist with same parameter';
RETURN lv_err_msg;
END;
END IF;
EXCEPTION
WHEN OTHERS THEN
lv_err_msg := '@@@ EXCEPTION THROWN @@@ '|| SUBSTR(SQLERRM,1,120);
RETURN lv_err_msg ;
END;
Don't look at the function, it might have errors but my primary concern is how to test this function. Once I start doing its testing then only i can understand any bugs(if any).
My pl sql is not so good. Im still learning. I don't understand IN and OUT parameters are.
I just know that IN parameters r those whick we pass in to the function wen we call it and OUT parameters are those through which we get the result.
Thanks in advance
Vinod Kumar Nair20100511 wrote:
I wondered how I could test the output of the function from within TOAD?I usually create the following function in my developer schema:
create or replace function BoolToChar( b boolean ) return varchar2 is
begin
if b then
return( 'TRUE' );
else
return( 'FALSE' );
end if;
end;To test a function like yours, the following will do in SQL*Plus/TOAD/etc:
begin
DBMS_OUTPUT.put_line(
BoolToChar( XCCC_PO_APPROVALLIST_S1.does_cpa_exist(1017934) )
end;
I'm probably doing 101 things wrong here, but thought I'd ask anyway and risk being shouted at.Shout at? You reckon? I thought people risked being beaten with a lead pipe, or pelted with beer cans and stale pretzels - which makes being shouted at a really safe and viable alternative. {noformat};-){noformat} -
10g: Invoking a web service asynchronously from BPEL
Hello,
I am trying to figure out a good, generic method for making a previously synchronous web service asynchronous and changing the way in which it is invoked from BPEL. I am using SOA Suite 10g (10.1.3.5)
As I understand, one possible method to achieve this is to use IDeliveryService.post() to deliver the web service's response to the BPEL process. For this route, the standard practice of correlation seems to be to supply a correlation Id when invoking the web service and returning the same correlation id as a part of the web service's response message. However, I want to avoid this since it would mean that all response messages from the web service (10+) would have to be modified to include a correlationId, which is problematic in the special case of this web service. Including a correlationId in the request message is possible, however.
I have tried the approach of using the conversation Id directly instead of the correlation Id, by reading the value of ora:getConversationId(), passing this to the web service and setting the property CONVERSATION_ID of the response NormalizedMessage to the same value when returning. However, I cannot seem to get this approach right. Is this possible at all?
An alternative might be to use WS-Addressing, but I do not know if I can make the web service support this - it is written using the EJB WebService-Annotations feature and runs on OC4J as well.
Do you have any suggestions on how this problem could be resolved?
Edited by: 901765 on 12.12.2011 06:01I have found the following tutorial that implements something similiar to what I am trying to do: http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135/odiscenario_bpelcallback/odiscenario_bpelcallback.htm#t3
Because of this, I am now confident that the conversation IDs can be used to achieve correlation. I have implemented the pattern by performing
an invoke activity on the web service, passing the result of ora:getConversationId() as part of the message. The conversation Id returned is of UUID-Form.
After the invoke activity, I have added a pick activity to receive the response message supplied by the web service through IDeliveryService.post(...). I can see that the message is received correctly by loooking at the contents of DLV_MESSAGE. However, the pick activity times out every time (after 10m). Looking at DLV_SUBSCRIPTION reveals that the conversation_id for the pick/receive activity is set to a value of the form bpel://localhost/default/MyBpelProcessName~1.0/7610001-BpInv0-BpSeq2.7-2. As far as I know, this should instead be set to the UUID that ora:getConversationId() returned before performing the invoke activity. What is going wrong here?
Thanks for your help! -
Calling a pl/sql function from oracle forms
I have written a pl/sql function in a package.
package name- sup
function name - func
I have written a when-button-pressed trigger .from here I want to call this function.
How can I do that?
Please help..Thanks a lot..
User may select 20-30 check boxes for respective name & id...then at the end , user will hit OK...from here when-button-click will call a procedure....that will update/insert/delete a table data.The procedure I have written is:-
DECLARE
N_CNT Number(1);
D_SYSDATE Constant date :=sysdate;
Begin
select count(1)
into N_CNT
from dbtable L
where L.land_id = :BLK1.LAND_ID and
L.Operatoer_id = :BLK1.Operatoer_id and
L.suppl_id = :BLK1.suppl_id and
L.suppl_prof_id = :BLK1.suppl_prof_id;
if ((N_CNT = 0) and (:LANDLISTE.state = 'A')) then
insert into dbtable
LAND_ID,
STATE,
suppl_prof_id,
suppl_id,
OPERATOER_ID,
SIDST_OPD_DATO,
SIDST_OPD_INIT
values
:BLK1.LAND_ID,
'Y',
:BLK1.suppl_prof_id,
:BLK1.suppl_id,
:BLK1.Operatoer_id,
D_SYSDATE,
:BLK1.SIDST_OPD_INIT
elseif
((N_CNT>0 )and (:LANDLISTE.state = 'A')) then
update dbtable L
set L.SIDST_OPD_DATO = D_SYSDATE,
L.SIDST_OPD_INIT = :BLK1.SIDST_OPD_INIT
where L.land_id = :BLK1.LAND_ID and
L.Operatoer_id = :BLK1.Operatoer_id and
L.suppl_id = :BLK1.suppl_id and
L.suppl_prof_id = :BLK1.suppl_prof_id;
elseif ((N_CNT>0 ) and (:LANDLISTE.state = 'D')) then
delete from dbtable L
where L.land_id = :BLK1.LAND_ID and
L.Operatoer_id = :BLK1.Operatoer_id and
L.suppl_id = :BLK1.suppl_id and
L.suppl_prof_id = :BLK1.suppl_prof_id;
end if;
end;
Will it be able to load multiple data(20-30 at a time) to the table?
Should I write anything to commit the data in the table?
I am very new to oracle forms...please help.. -
How to call PL/SQL function from ODBC
Greetings (and thanks for reading),
I am using Oracle 9i (9.2.0.4) database, running on SUN [sparc] Solaris 9. I have created the following types:
create or replace type NAME_VAL_TYP is object
(NAME varchar2(30)
,VALUE varchar2(30))
create or replace type PARMS_VARRAY_TYP is varray(10) of
NAME_VAL_TYP
/and the following PL/SQL function:
function F0 (P_PARAMS PARMS_VARRAY_TYP) return numberHow do I call this function from ODBC?
Thanks (in advance),
Avi.Sorry, this is not mapped in the ODBC driver--none of the object types are. The spec doesn't really account for them.
-
Calling pl/sql function from JSP to get data
Hi,
Ideally I want to pass the results of a PL/SQL function or procedure to my JSP page as a resultset or an array.
I've manage to pass all the data as a string like this:
// this works for a function that returns a string
String str;
CallableStatement cstmt = conn.prepareCall("begin ?:= temp_package.pass_string(); end;");
cstmt.registerOutParameter(1,Types.VARCHAR);
cstmt.execute();
str = cstmt.getString(1);
but if I try to pass a collection or Varray or Ref Cursor like this:
// LETS TRY A PROCEDURE THAT ALTERS THE CONTENTS OF AN ARRAY
CallableStatement cstmt = conn.prepareCall(" begin ?:= temp_package.pass_varray(); end;");
cstmt.registerOutParameter(1,Types.ARRAY);
cstmt.execute();
or this:
CallableStatement cstmt = conn.prepareCall(" begin ?:= temp_package.pass_cursor(); end;");
cstmt.registerOutParameter(1,Types.CURSOR);
cstmt.execute();
or this:
CallableStatement cstmt = conn.prepareCall(" begin ?:= temp_package.pass_cursor(); end;");
cstmt.registerOutParameter(1,OracleTypes.CURSOR);
cstmt.execute();
I get an error saying that the type can�t be translated or something similar. It seems happy with VARCHAR but not with ARRAY,VARRAY or CURSOR.
Can anyone help please as this has driven me crazy for hours surfing google and various forums. Thanks.Ok, I made the changes, but I'm now getting the following error:
Error code = 1403
Error message = ORA-01403: no data found
ORA-06512: at "IOBOARD.GETSTATUS", line 6
ORA-06512: at line 1
The ora-01403 I don't understand because there is data for the name Kelly.Brace.
ora-06512 error: at string line string.
Here's what the code looks like after I made the changes:
String sql = "{?=call ioboard.GetStatus(?)}";
// create a Statement object
myStatement = myConnection.prepareCall( sql );
myStatement.setString( 1, "Kelly.Brace" );
myStatement.registerOutParameter(2, java.sql.Types.LONGVARCHAR );
// create a ResultSet object, and populate it with the
// result of a SELECT statement
ResultSet myResultSet = myStatement.executeQuery();
// retrieve the row from the ResultSet using the
// next() method
myResultSet.next();
// retrieve the user from the row in the ResultSet using the
// getString() method
String status = myResultSet.getString(1);
System.out.println("Hello Kelly, your status is: " + status);
// close this ResultSet object using the close() method
myResultSet.close();Here's what the function looks like:
CREATE OR REPLACE FUNCTION GetStatus( user_name in varchar2)
RETURN VARCHAR2
is
v_status varchar2(10);
BEGIN
select iob_location into v_status
from ioboard.iob_user
where iob_username = user_name;
RETURN( v_status);
END;This works perfectly in the SQL Window:
select iob_location
from ioboard.iob_user
where iob_username = 'Kelly.Brace';
Maybe you are looking for
-
Error Message reads: unable to load
Error Message Reads Resource Not Found Unable to Load Sync UI Core Localized.dll This is on a Windows operating system I was trying to burn some Itune content to CD's Now I have this error message Is anyone familiar with this message? Thank you
-
Embedding into a web page, but how to connect to an SWF on the media server
If I do something like this it works fine. helloWorld.swf is an interactive SWF file thats on my application server. It then accepts parameters and successfully makes a connection to my FMS. <object width="600" height="600" classid="clsid:d27cdb6e-ae
-
Problem with Variable Entry Screen
Hello All, We upgraded our development systems to NW2004s and came across the following issue: All our Bex queries have restricted time characteristics with variables entries. When we execute a query it should pop-up the variable selection screen for
-
Could not find the enhancement for IDOC_OUTPUT_ORDRSP
Dear All, I am using message type ORDRSP, basic type ORDERS05 and IDOC function module is IDOC_OUTPUT_ORDRSP. I have done all required settings and idoc also created as per standard. But my problem is i couldn't find VBAK-ERNAM and VBAK-ERDAT in segm
-
BAPI_PO_CHANGE - Need to change POLIMITS table
Hi, We have a requirement to change the Expected Value in the PO screen for a set of POs. This Expected Value is coming from Shipment doc and the details are availbale in POLIMITS table in BAPI_PO_CHANGE. We thought of updating the field EXP_VALUE in