Executing an Oracle Stored Procedure from Sender JDBC adapter
I could really use some help from someone who had done this before.
I've read the help about using the JDBC sender adapter, but it's not helping enough.
I found this line: "Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs."
That's definately what we want to do, but we can't figure out the syntax.
The procedure in oracle looks like this:
CREATE OR REPLACE PROCEDURE test_ref_cursor
( cur_generic IN OUT result_sets.cur_generic)
as
BEGIN
Open cur_generic for
select
proposal_number,
to_char(sequence_number),
column_name,
column_value,
update_timestamp,
update_user
from
coeus.sap_test;
END test_ref_cursor;
And we have tried every kind of statement we can think of, but the file adapter always gives us an "invalid sql statement" error.
Does anyone know what syntax we need to put in the "Query SQL Statement" in the JDBC sender adapter in order to call this procedure? Or is there something wrong with the procedure that is causing the error?
<i>I will absolutely return and give points, but PLEASE read my whole post before answering and do not just link me to or quote the help for configuring a sender JDBC adapter or blogs that are about the JDBC adapter in general but do not deal with the issues I am having. Thank you.</i>
Hi Vanda,
Unfortunately, the sender JDBC adapter does not support Oracle's store procedure/function. Unlike stored procedures from other database vendors, Oracle returns a cursor, not a resultset. The sender JDBC adapter must send a resultset to XI.
There are 2 possible ways you can accomplish this:
1. Use BPM and call the Oracle stored procedure using a receiver adapter via a asynch-synch bridge.
2. Develop a user-module for the adapter, which can be used with a sender adapter.
Thanks
Prasad
Similar Messages
-
Parameters to stored procedure from sender JDBC
Hi,
I am using the JDBC sender adapter to call the Oracle stored procedure. Oracle version is 10.2. hence I m using function call using select.
My concern is, how to pass the input parameter to Oracle function from JDBC sender.
Regards,
KavitaHi Kavita,
<i>I am using the JDBC sender adapter to call the Oracle stored procedure</i>
<i>Unfortunately, the sender JDBC adapter does not support Oracle's stored procedure/function. Unlike stored procedures from other database vendors, Oracle returns a cursor, not a resultset. The sender JDBC adapter must send a resultset to XI.</i>
Executing an Oracle Stored Procedure from Sender JDBC adapter
[Not sure about latest versions of Oracle]
<i>can I pass the input parameter to this function? </i>
In my opinion, No
<i>If not, I need to change the approach, and need to use receiver JDBC[as need to pass input parameter]. </i>
This could be possible but havent tried it
<i>Can JDBC Receiver adapter support stored procedure for Oracle[10.2]</i>
Yes
Regards,
Prateek -
Error while executing the stored procedure through sender JDBC adapter
Hi All,
I am getting below error while executing the stored procedure through sender JDBC adapter.
Database-level error reported by JDBC driver while executing statement 'exec SapgetNextEntity 'SalesOrder''. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor.
what is the problem? any idea to anyone...
regards
Rameshhi Dharamveer,
I am not getting below statement for your reply
Try to use Refrence Cursor it will return u reference of resultset.
I mention SP like this
exec SapgetNextEntity 'SalesOrder'
SapgetNextEntity -
> SP Name
SalesOrder----
> Parameter I am passing...
regards
Ramesh -
Error in calling stored procedure in sender JDBC adapter
Hi Experts,
I am working on MySQl to SAP scenario. I have to use stored procedure in sender JDBC adapter.
I am calling SP as fallows: execute proc_dtdc_booking_interface_sd
But it returned following error,
Database-level error reported by JDBC driver while executing statement 'execute proc_dtdc_booking_interface_sd'. The JDBC driver returned the following error message: 'java.sql.SQLException: Unknown prepared statement handler (proc_dtdc_booking_interface_sd) given to EXECUTE'. For details, contact your database server vendor.
the way i called SP is correct ??
please suggest me how to resolve the issue ??
Regards,
Bhuvan.Hi
Below is the code , when we are using this code directly in the mySQl command promp, it fetches 10 record but when the same code is called through XI adapter its fetching only one record
DELIMITER $$
DROP PROCEDURE IF EXISTS `proc_dtdc_booking_interface_sd` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_dtdc_booking_interface_sd`()
BEGIN
declare done int(1);
declare v_dsr_booked_by char(1) ;
declare v_dsr_branch_code char(3) ;
declare v_dsr_cust_code varchar(7) ;
declare v_dsr_booking_date date ;
declare v_dsr_cnno char(9) ;
declare v_dsr_cn_type char(3) ;
declare v_dsr_cn_weight decimal(8,3) ;
declare v_dsr_dest char(3) ;
declare v_dsr_mode char(2) ;
declare v_dsr_amt decimal(10,2) ;
declare v_dsr_dox char(1) ;
declare v_office_code char(3) ;
declare v_dsr_status char(1) ;
declare v_dsr_remarks varchar(25) ;
declare v_dsr_refno varchar(20) ;
declare v_dsr_transmf_no varchar(10) ;
declare v_dsr_trans_status_xi char(1) ;
declare v_ndsr_cnno char(9) ;
declare v_ndsr_product char(3) ;
declare v_ndsr_sercharge decimal(8,3) ;
declare v_ndsr_ins_amt decimal(8,3) ;
declare v_ndsr_others decimal(8,3) ;
declare v_dr_amt_type decimal(2,0) ;
declare v_dr_extra_amt decimal(10,2) ;
declare v_sales_document varchar(2) ;
declare bookcur CURSOR for
SELECT *
FROM dtdcdb_rw.dtdc_booking_interface_sd
LIMIT 10;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET DONE=1;
set done=0;
OPEN bookcur;
bookloop: loop
FETCH bookcur
INTO
v_dsr_booked_by ,
v_dsr_branch_code,
v_dsr_cust_code,
v_dsr_booking_date,
v_dsr_cnno,
v_dsr_cn_type,
v_dsr_cn_weight,
v_dsr_dest,
v_dsr_mode,
v_dsr_amt,
v_dsr_dox,
v_office_code,
v_dsr_status,
v_dsr_remarks,
v_dsr_refno,
v_dsr_transmf_no,
v_dsr_trans_status_xi,
v_ndsr_cnno,
v_ndsr_product,
v_ndsr_sercharge,
v_ndsr_ins_amt,
v_ndsr_others,
v_dr_amt_type,
v_dr_extra_amt,
v_sales_document ;
IF DONE=1 THEN
LEAVE bookloop;
END IF;
select
v_dsr_booked_by As dsr_booked_by,
v_dsr_branch_code As dsr_branch_code,
v_dsr_cust_code As dsr_cust_code,
v_dsr_booking_date As dsr_booking_date,
v_dsr_cnno As dsr_cnno,
v_dsr_cn_type As dsr_cn_type,
v_dsr_cn_weight As dsr_cn_weight,
v_dsr_dest As dsr_dest,
v_dsr_mode As dsr_mode,
v_dsr_amt As dsr_amt,
v_dsr_dox As dsr_dox,
v_office_code As office_code,
v_dsr_status As dsr_status,
v_dsr_remarks As dsr_remarks,
v_dsr_refno As dsr_refno,
v_dsr_transmf_no As dsr_transmf_no,
v_dsr_trans_status_xi As dsr_trans_status_xi,
v_ndsr_cnno As ndsr_cnno,
v_ndsr_product As ndsr_product,
v_ndsr_sercharge As ndsr_sercharge,
v_ndsr_ins_amt As ndsr_ins_amt,
v_ndsr_others As ndsr_others,
v_dr_amt_type As dr_amt_type,
v_dr_extra_amt As dr_extra_amt,
v_sales_document As sales_document;
update dtdcdb_rw.dsr_table
set dsr_trans_status_xi='T'
where dsr_cnno=v_dsr_cnno;
end loop;
SELECT *
FROM dtdcdb_rw.dtdc_booking_interface_sd
LIMIT 10;
END $$
DELIMITER ;
Please help
Regards
Bhuvan -
Stored procedure in Sender JDBC Adapter
Hi All,
My Scenrio goes like this ...
Stored Procedure(SQL Server) --- PI -
File
I need to write the results of stored procedure to File.Here I don't need any mapping.So how many DT , MT and MI need to be created?
The interface need to run by 6AM from Monday to Thrusday, how can i achieve this ?
Stored Procedure has only select statement and no Update statement , but it takes Date as Input parameter , so what i need to provide in sender JDBC adapter.
Thanks,
MonishHi Monish,
As per your requirement it is JDBC to File. Please be careful with the structure to be created for sender JDBC. I am unable to understand why you donot require a mapping for this. How XI will send the data to a file then.As per my knowledge if it's file to file and just pick and drop then we can neglect IR and go for ID.But here you are working with JDBC and File so you will be in need of it.
IR:
DT: 2
JDBC_Sender_DT
File_Output_DT(Optional)
You can use the JDBC sender data type structure for File output also.
MT as per your DT
MI:2
Outbound MI: JDBC structure
Inbound MI : File structure
MM: 1
IM: 1
ID as similar to other scenarios.All 1 objects for RD,ID,Sender Agreement and Receiver Agreement.
Sender JDBC channel:
Query: Select * from table where date
But I have a query how are you providing date in input paramerter.It will be dynamically entered into the query right.
You can mention the Avalibility planning for your interface to work in RWB.
Go to RWB>Component Monitoring>Adapter Engine->Communication Channel Monitoring>Avaliablity Planning
Please explain.
Regards,
Nutan -
How to use Stored Procedures in Sender JDBC Adapter.
Hi Experts,
we are having a lot of legacy application which are on .Net. basicaly using MS SQL & stuff. As a Integration scenario we have to triggered some events from JDBC to XI. How can i do this. Secondly there are multiple tables from which i will be selecting a record & sending it to XI for further processing the Receiver Side we are having SAP system.
How can i use a Stored procedure in XI Sender Adapter ?
Can anybody tell me step by step how to get the XSD of Stored procudere & used in XI. ?
I am new to XI. I have not yet configured any sceneario.
Can anybody guide me step by step how to do this.
I am only intersted in Sender Side configuration.
Regards,
UmeshHey,
check this in the JDBC Sender Adapter Configuration
Query SQL Statement -> Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs.
http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
JDBC adapter
/people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter
<b>Cheers,
*RAJ*
*REWARD POINTS IF FOUND USEFULL*</b> -
Execute Oracle Stored Procedure from Excel
Is it possible to execute an Oracle Stored Procedure from Microsoft Excel and return the result of the Oracle Store Procedure into the excel spreadsheet.
Yes. You can use Oracle Objects for OLE to accomplish this. It comes with Excel examples and an online help file with many more examples.
-
SOS..How to execute an Oracle Stored procedure
Please help me.
I need to execute an oracle stored procedure from a JSP.
I'M using Jakarta Tomcat and I dont have the Oracle Jbo tags and no BC4j tags.
Anyone have an example using standar tags or directives???.
This an emergency call..!!!!!!To execute a stored procedure (Oracle or other), you must create a CallableStatement.
Here is the link to the API description:
http://java.sun.com/products/jdk/1.2/docs/api/java/sql/CallableStatement.html
You use it like a query but the the syntax is:
{call <procedure-name>[<arg1>,<arg2>, ...]} -
Invoking Oracle stored procedures from within a JDBC channel for PI 7.1
Hi ,
Can anybody tell me that is it possible to invoke Oracle stored Procedure from within a JDBC sender channel for PI 7.1.
Its working in XI3.0 and XI 7.0 for Oracle DBMS versions >= 10.2.x. But I am not sure,whether it will work for PI 7.1 also.
Thanks & Regards,
SaruHI,
refer below link,there is no much difference in PI7.1 ,executing stored procedure is same .
http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/7b72b2fde93673e10000000a114a6b/content.htm
Regards,
Raj -
Stored Procedure in sender JDBC
Hey all,
I am trying to call a stored procudure in my sender JDBC adapter to send to an Idoc adapter. In the query statement, do I need to give just EXECUTE <stored proc name> or do I need to set up any special setting in the sender adapter?
-TeresaTeresa,
Which DB are you trying to access?
If it is an oracle DB, then unfortunately, Sender JDBC adapter does not support stored procedures for an Oracle DB.
Reason is that JDBC adapter expects a RESULTSET while Oracle Stored Procedure returns a Cursor.
For any other DB, EXECUTE <STOREDPROCNAME> will suffice.
Regards,
Bhavesh -
Executing an oracle stored procedure in xMII 11.5
Dear all,
I am facing problem executing an oracle stored procedure using sql query in MII. The SP does not have any input or output parameters & consists of only 2 insert statements. I tried to use Command Mode, FixedQuery & FixedQuery With output mode, but the SP doesn't run.
This is the error i get when i use :
execute InsertTest or exec InsertTest - A SQL Error has occurred on query, ORA-00900: invalid SQL statement
I read in one of the posts to use 'CALL' instead of 'exec' or 'execute'. Even with this i get error which states:
A SQL Error has occurred on query, ORA-06576: not a valid function or procedure name
The syntax i used is CALL InsertTest - 'InsertTest' is the SP name.
I also checked Sam's comment in one of the posts about jdbc driver. We are using oracle 9i, so i guess there is no problem with the version of DB.
The stored procedure is working fine in SQL Developer, How else can i invoke the SP in MII?
Any help would be greatly appreciated.
Thanks,
Sushma.Hi all,
for insert create procedure
CREATE PROCEDURE MII_TEST_INSUPD
(ID_IN IN NUMBER,
NAME_IN IN VARCHAR2)
IS
BEGIN
-- UPDATE ROW
UPDATE TEST SET
NAME = NAME_IN
WHERE
ID = ID_IN;
-- NOT RETURN INSERT NEW LINE IN TABLE
IF SQL%ROWCOUNT = 0 THEN
INSERT INTO TEST (ID, NAME) VALUES (ID_IN, NAME_IN);
END IF;
END;
In MII you create a query template
Mode - Command
FixedQuery - insert the code below
CALL MII_TEST_INSUPD ([Param.1],'[Param.2]')
for returns the grid using procedures in oracle you need create a package on oracle server
CREATE PACKAGE PKG_test IS
TYPE cursortype is ref cursor;
PROCEDURE test (mycursor in out cursortype);
END PKG_test;
CREATE PACKAGE BODY PKG_test IS
PROCEDURE test (mycursor in out cursortype) AS
BEGIN
open mycursor for select * from test;
END;
END PKG_test;
In MII you create a query template
Mode - FixedQueryWithOutput
FixedQuery - insert the code below
CALL PKG_TEST.TEST(?)
Danilo -
Executin oracle stored procedure from shell script
Hi everyone,
I want to know how to execute a orace stored procedure from a shell script not a sql file.
Its a oracle stored procedure with in parameters.
Can anyone send immediate reply its very urgent.
Thanks in Advance
with regards
ThazulHello everyone,
Whenever i am using the previous script
because of <<! and !>> in the beginging and the end of oracle scrip. Shell is displaying the error 'newline or ;' unxexpeted and the error no is 48.
After that i used a different script like
DIRRUNNER=/oracle/tvg
count=0
while [ 1 -eq 1 ]
do
for x in `ls $DIRRUNNER/RUNNER_*.TXT`
do
count=`grep -c $x $DIRRUNNER/runner.log`
if [ $count -lt 1 ]
then
chstr=`echo $x|awk -F/ '{printf $NF }'`
dir=$DIRRUNNER
file=$chstr
PATH=$PATH:/usr/local/bin:.
export PATH
ORACLE_SID=BBPROD
ORAENV_ASK=NO
. oraenv
ORAENV_ASK=YES
echo "exec runrace('$dir', '$file')" > runner.sql
sqlplus -s tvgus/tvgus@bbprod @runner.sql
echo $x >>$DIRRUNNER/runner.log
fi
done
count=0
sleep 2
done
The above one is working fine but after executing the procedure control is still remaing in the sqlplus environment, but i want the control back to my shell
Can anyone help to resolve this, its pretty urgent.
Thanks in Advance
Thazul.
null -
Problem in calling Oracle stored procedure from Java.
I am trying to invoke the Oracle stored procedure from Java. The procedure does not take any parameters and does not return anything. If I call it from SQL prompt it is working perfectly. I am calling it in my program as follows.
callable_stmt=con.prepareCall("{call pkg_name.proc_name()}");
callable_stmt.execute();
The problem is the control-of-flow is getting strucked in the second line I wrote. It is not giving any error also.
Please clarify me what's wrong with my code?
Seenu.And how long does the stored procedure take to run from your client machine when running it via sqlplus?
-
Calling Oracle stored procedure from xMII Query Templates.
Hi All,
We have a requirement to call a Oracle stored procedure from xMII, the SP expects some inputs and then it returns multiple rows.
I tried different approches with no results, I remember some posts on the same topic but I could not get in search results.
Looking for some help in this regards
Rupesh.Hi Rupesh Bajaj,
In oracle stored procedure we have to use Packages..if you used packages the u have to assign to some variable.
To calling Stored procedure in Query Template is CALL Testing('[Param.1]','[Param.2]',,:X)
In above line Testing is Stored procedure name and Param.1 is parameters and X is Package.
Thanks
Ravilla Ramesh -
How to call multiple stored procedure from same DB Adapter
Hi,
I want to invoke 3 stored procedures from my message flow in BUS . I created a DB adapter and invoked 1 successfully . Now I don't to configure 2 other DB adapters for calling other 2 stored procedures . I want some how to be able to call the other 2 from the first DB adapter only . Somehow I need the flexibility to have procedure names as the operation names in 1 wsdl and be able to configure this in JDeveloper for this at time of DB adapter configuration . I am using 11G . Is it possible ?You can probably create a DB adapter with operation type selected as Execute Pure SQL and write SQL code to invoke the stored procedures depending on the procedure name (which you can get as one of the parameters of DB Adapter).
However, Even if you were able to do it, the DB Adapter schemas are generated based on stored procedure parameter list and types. If you use Execute Pure SQL type of DB Adapter the schema will be generated based on the parameters which you are using in your custom SQL code within DB Adapter. Which means that if you want to add a new stored procedure as target which has a different name and different parameters then you will need to regenerate the DB adapter and update your custom SQL code. This also means that you will need to do regression testing interfaces to all stored procedures whenever there is any change in this DBAdapter.
Now, my question is why do you want to invoke multiple stored procedures from same DB adapter?
This is not a good way to design integration solutions and makes your services resistance to change as it will take more time to change and test.
If all that you want is to have a web service which can have different operations for different stored procedures then you should create three business services and create a wrapper proxy service which has one operation for each stored procedure, within the proxy transform and call the correct backend service (you can use operational branch). This way you have a modular code where each module (read interface to one stored procedure) can be independently modified and tested.
Maybe you are looking for
-
Unable to update Sales order item level prices after invoice is created
Dear All , I have the following issue . When the sales order was created Z001 price was populated based on the condition record and the order was in complete status Then we created delivery and invoice , the invoice had the same price as that of s
-
Not connecting to UK Landline numbers
Have unlimited calling accountt for Europe. FOR LAST THREE WEEKS, have been trying to call UK landline numbers but not getting connected. Seems like phone is ringing at other end but actually it does not connect and phone (being called) does not rin
-
How to import a XFDF file into a PDF?
I need to import a XFDF file into a PDF through javascript. Manually in Acrobat 8.0 we are doing through the following steps. Comments->import comments->browser window open(select the corresponding xfdf file and then click select button)->After that
-
Error running SSIS package to do with encrypting/decrypting password. Help needed.
Getting this error. Can anyone shed some light? This is the first promote since 2009. Protection level of the package is 'EncryptSensitiveWithPassword' I'm new at SSIS so don't assume I know anything. 10/30/2014 16:11:06,HPAddress_Export,Error,0,SSQL
-
Is it possible to turn off the updates that make your iphone need to be activated again?
Is it possible to turn off the updates that make your iphone need to be activated again? Because you need wifi in order to activate and sometimes I don't have wifi so my iphone becomes unusable untill I get wifi again.