File to JDBC Scenario using stored procedure Question
Does anyone have an aswer (or have you seen a Blog that covers it) to the problem of having to do a table refresh before doing inserts in a file 2 jdbc scenario?
Essentially the details are as follows:
I have an input file that has all the data for a table (it's a complete table dump) of lets say userdata (username, name, hiredate).
I need to pass that to an oracle database via stored procedure(s). But before I start issuing my insert (via insert stored procedure) I have to somehow issue a delete statement to delete all the contents of the table I'm about to update. I'm on XI 3.0 and aren't sure what the best solution to this may be.
Again if there is a blog that covers this then if you could point me in that direction it would be great. Otherwise if anyone has any good ideas it would be appreciated.
Hi,
For structure refer this blog..
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
Use two <Statement> tags as shown here and there you may have separate tablenames.
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm
Thanks,
Jogula Ramesh
Similar Messages
-
XI/PI: jdbc receiver using stored procedure with arrays
The company needs an interface to search for header data and detail to a legacy system.
This interface from ERP to legacy system is synchronous and uses stored procedure.
The definition of the stored procedure is as follows:
PROCEDURE
Generar_Detalle_Vtas_Pagadas
(p_cvendedor IN bdc_vendedores.cvendedor%TYPE,
p_fdesde IN DATE,
p_fhasta IN DATE,
v_encabezado_ct OUT encabezado_ct,
v_detalle_vtas_pagadas_ct OUT detalle_vtas_pagadas_ct,
err_num OUT NUMBER
Data types used in stored procedure:
TYPE encabezado_ct AS OBJECT
( CREGION NUMBER(22),
XREGION VARCHAR2(50),
CMERCADO NUMBER(22),
XMERCADO VARCHAR2(50),
CTVENDEDOR VARCHAR2(5),
XCTVENDEDOR VARCHAR2(50),
XDENOMINACION VARCHAR2(15))
TYPE detalle_vtas_pagadas_ct AS OBJECT
( CITEM VARCHAR2(10),
XIDENTIFICADOR VARCHAR2(15),
XCONTRATO VARCHAR2(15),
XVALOR VARCHAR2(30),
CCUENTA VARCHAR2(15),
FACTIVACION DATE,
XDOMINIO VARCHAR2(30),
CCED VARCHAR2(20),
XCLIENTE VARCHAR2(161),
CCPO VARCHAR2(60) )
As shown, this has three input parameters varchar and date respectively and has three output parameters, two of which are defined with a data
type such as table and the other number.
The problem is to define the signature of the stored procedure in XI when defining the data type request, the message type and mapping system
legacy because the data type is not supported (tables: detalle_vtas_pagadas_ct,encabezado_ct )FORM 2:
defined as an array, but the error tells me that we need to define the attribute either input or output
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_VtasPagadas_VYC xmlns:ns0="urn:VentasPagadas:VE_ALTASDEDCALIDAD_SD_VYC">
<VtasPagadasRequest><Generar_Detalle_Vtas_Pagadas action="EXECUTE">
<table>vyc.Vyc_Pack_Reportes_Sap.Generar_Detalle_Vtas_Pagadas</table>
<p_cvendedor type="VARCHAR"></p_cvendedor>
<p_fdesde type="DATE"></p_fdesde>
<p_fhasta type="DATE"></p_fhasta>
<v_encabezado_ct>
<CREGION isOutput="1" type="NUMERIC">X</CREGION>
<XREGION isOutput="1" type="VARCHAR">X</XREGION>
<CMERCADO isOutput="1" type="NUMERIC">X</CMERCADO>
<XMERCADO isOutput="1" type="VARCHAR">X</XMERCADO>
<CTVENDEDOR isOutput="1" type="VARCHAR">X</CTVENDEDOR>
<XCTVENDEDOR isOutput="1" type="VARCHAR">X</XCTVENDEDOR>
<XDENOMINACION isOutput="1" type="VARCHAR">X</XDENOMINACION>
</v_encabezado_ct>
<v_detalle_vtas_pagadas_ct>
<CITEM isOutput="1" type="VARCHAR">X</CITEM>
<XIDENTIFICADOR isOutput="1" type="VARCHAR">X</XIDENTIFICADOR>
<XCONTRATO isOutput="1" type="VARCHAR">X</XCONTRATO>
<XVALOR type="VARCHAR">X</XVALOR>
<CCUENTA isOutput="1" type="VARCHAR">X</CCUENTA>
<FACTIVACION isOutput="1" type="DATE">X</FACTIVACION>
<ICTA isOutput="1" type="VARCHAR">X</ICTA>
<CCED isOutput="1" type="VARCHAR">X</CCED>
<XCLIENTE isOutput="1" type="VARCHAR">X</XCLIENTE>
<CCPO isOutput="1" type="VARCHAR">X</CCPO>
</v_detalle_vtas_pagadas_ct>
<err_num isOutput="1" type="NUMERIC">X</err_num>
</Generar_Detalle_Vtas_Pagadas>
</VtasPagadasRequest></ns0:MT_VtasPagadas_VYC>
Edited by: ymonasterio on Mar 31, 2010 4:48 PM -
File - to - JDBC- to - File Scenario using Stored Procedure
Hi,
I want to do File - to - JDBC - to - File scenario, because I'm getting data in a file format and that data i want to load in a database. Database level i have a stored procedure. if any exceptions. my stored procedure will give the Response. so, now i want to store that resposne in a file..
for this. what are the steps we have to use. is this scenario will comes in Synch ronous or Asynchronous ? and I have searched the web blogs also. al the blogs are related to Http or Soap with JDBC . so, please give me some input help about this...
how many data types we have to create... any body having step step procedure for this...
regards
JainHi,
You will need a BPM in your design as Sender File adapter does not support Synchronous messaging. Refer my answer in this thread (page 2) and have your design accordingly....instead of RFC you will have a file adapter as the ultimate receiver.
Re: BPM FILE--> JDBC--> RFC
Just take care of below things:
1) JDBC message format is as per the guidelines
[Message format for sending req to JDBC|http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm]
2) check for the format of your source and target file format (if it is a Flat-file with a xml structure that XI can parse then no need of FCC but if it is a CSV file then you will need FCC)
Regards,
Abhishek
Edited by: abhishek salvi on Apr 14, 2009 7:32 PM -
SOAP TO JDBC scenario: calling stored procedure which will return the value
Hi
I have Soap To Jdbc scenario in which I am going to call the Stored Procedure at target side which will be executed and it is going to return the result set .
Result contains following values.
return code as ( 0 Or 1) and also specific exception message if its return code as 1.
Could you suggest me the way by which I can handled this return code and send it back to the Sap PI system then the same thing is directed the to SMTP server for sending mail to consern person.
Regards
KumarThe OUT parameters of stored procedure will be returned as response. Where exactly are you facing the proble? Here is a complete walkthourgh
/people/luis.melgar/blog/2008/05/13/synchronous-soap-to-jdbc--end-to-end-walkthrough
In your case, you don't want response at sender. Instead you want to mail it. For this you may use BPM to design your scenario with following steps
Receive (to receive data from sender)
Send Sync (to stored procedure and get response)
Send Async (to mail receiver)
Regards,
Prateek -
XI JDBC Adapter using stored procedures
Hi
I am using the JDBC adpapter to call a stored procedure on a SQL database.
In the adapter configuration I am using 'com.microsoft.jdbc.sqlserver.SQLServerDriver' as the JDBC Driver parameter and 'jdbc:microsoft:sqlserver://LIBOEE01:1433;DatabaseName=DEV_OEE;SelectMethod=cursor;' as the connection string.
My payload is as follows:
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<Statement>
<PL101_SAPR3_SKU_OBJ action="EXECUTE">
<p_verb isInput="true" type="varchar">CREATE</p_verb>
<p_site_id isInput="true" type="varchar">GPK</p_site_id>
<p_sap_line_id isInput="true" type="varchar">LN005</p_sap_line_id>
<p_sku_id isInput="true" type="varchar">4014847</p_sku_id>
<p_sku_desc isInput="true" type="varchar">Klipdrift Exp - 12x750ml</p_sku_desc>
<p_bottles_in_sku isInput="true" type="float">12</p_bottles_in_sku>
<p_bps_sap isInput="true" type="float">2.083</p_bps_sap>
</PL101_SAPR3_SKU_OBJ>
</Statement>
</root>
However, when I cal lthe interface I receive the follwoing error in the adapter:
2007-07-18 11:25:03 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: JDBC Adapter configuration not initialized: null
2007-07-18 11:25:03 Error Exception caught by adapter framework: JDBC Adapter configuration not initialized: null
2007-07-18 11:25:03 Error Delivery of the message to the application using connection failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: JDBC Adapter configuration not initialized: null.
Is this possibly casued by the driver being the incorrect version?
Regards
MichaelHi Kanth,
Thanks for your response, but the blog by Siva Maranani is actually where I got my code from. Upon further research I think have found the problem as experienced in this blog --> Re: MS SQL Server jdbc Driver installation on XI . There are 2 jar files missing from our SQL JDBC driver --> msbase.jar and msutil.jar, I think once I have added these to the driver it might work. Strange that when you download the driver from microsoft's website that these 2 files are only available in the UNIX download though!
Regards
Michael -
Error in File to JDBC Scenario using File Content Conversion.
Hi ,
I am sending a text file in CSV format, with all the configurations done in the sender and receiver channels.
But the adapter monitoring says this:
Initialization error: Conversion initialization failed with java.lang.Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found:
Parameter 'EmployeeDetails.fieldFixedLengths' or 'EmployeeDetails.fieldSeparator' is missing
Consistency check: no. of arguments in 'EmployeeDetails.fieldFixedLength' does not match 'EmployeeDetails.fieldNames' (0 <> 6)
One thing to note here is that
1. EmployeeDetails.fieldSeparator is given as ','
2. I haven't used any fieldFixedLengths.
Pointers in this regard would be higly appreciated.
Regards,
Younuscross check if you have specified EmployeeDetails.fieldFixedLengths and EmployeeDetails.fieldSeparator. only one must be used.
in case you have already specified,
EmployeeDetails.fieldSeparator as ',' , then delete that line and reenter the details again, activate and run the scenario. -
JDBC(using stored procedure) to RFC Scenario
Hi
I am doing JDBC(using stored procedure) to RFC Scenario
While running the scenario i am getting the following error
Database-level error reported by JDBC driver while executing statement 'EXECUTE EMU.EXTRACTRECON'. The JDBC driver returned the following error message: 'com.ibm.db2.jcc.a.SqlException: [ibm][db2][jcc][10100][10910] java.sql.Statement.executeQuery() was called but no result set was returned. Use java.sql.Statement.executeUpdate() for non-queries.'. For details, contact your database server vendor.
Can anybody sortout my problem
Regards
sunilreddyHi,
i am doing the scenario file to rfc scenario.
when i run my scenario xi system is picking the data from file system
but rfc is not accepting the data.this is the error i am getting
Delivery of the message to the application using connection RFC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Exception thrown in method process. The transaction is marked for rollback.: com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback..
so please any one give me the solution for that -
How to use Stored Procedures in JDBC sender side and receiver side
Hello,
Can anyone explain how to use stored procedures in configuring the scenario using JDBC adapter at bothe sides sender nad receiver..
Thanks,
SooryaHi,
Refer the below link:
JDBC:
Receiver JDBC scenario MS access - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 --> for jdbc receiver: file -JDBC
Stored Procedures-
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
http://www.ics.com/support/docs/dx/1.5/tut6.html
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
http://www.ics.com/support/docs/dx/1.5/tut6.html
http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html
http://www.sqlteam.com/article/stored-procedures-an-overview
HI in the message mapping structure u need to specify the different action and also u need to specify the procedure name.
refer the below link which has all the associated action
http://help.sap.com/saphelp_nw04s/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
Chirag -
Dear All,
I am having one scenario in which I have to update third party's SQL Tables with the data from a flat file. The data is stored in the flat file in the following way:
0000000119690607Sunjay Shrivas
0000000419641029Shishir Bhandarkar
0000000519671004Harvinder Singh
0000000619700101Shashi Kant Tiwari
0000000719690911Kamala Rai
0000000819680914Vishav Bhushan Monga
0000000919610829Moloy Mitra
In this file, first eight characters are for employee number, next eight are for date of birth of employee, next 40 characters for employee first name and then for employee last name.
Kindly guide me out in creating in the Data Types and Message Mapping for this scenario.
Warm Regards,
N.JainHi
Have a look
jdbc /people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter
JDBC receiver
/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 - File to JDBC
use SELECT statement in JDBC
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1725 [original link is broken] [original link is broken] [original link is broken] [original link is broken]
stored procedure
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
/people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
Sender adapter
/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
for jdbc adapter...
http://help.sap.com/saphelp_nw04/helpdata/en/22/b4d13b633f7748b4d34f3191529946/content.htm
for configuring receiver jdbc adapter...
http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
Might be useful. -
Using jdbc-odbc from stored procedur
why connect to MSACCESS by jdbc-odbc bridge from java stored procedure get exception : NO SUITABLE DRIVER?
Hi
Please go through below links that would be helpful to you
SAP Network Blog: Connecting to MS Access using receiver JDBC Adapter (Without DSN)
/people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
If required Try the following driver. I havent used it but its available.
HXTT Access is such a type 4 driver at http://www.hxtt.net/en/software/access/document.html .
Thanks
Swarup -
How to use Stored Procedure Call in Sender JDBC adapter
Hi All,
Could someone send me a blog on how to use Stored Procedure call in Sender JDBC adapter?
XierHi Xler
refer these links
/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
Also, you can check Sriram's blog for executing Stored Procedures,
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
/people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
This blog might be helpfull on stored procedures for JDBC
JDBC Stored Procedures
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
Please go through these threads and see if it helps...
Re: How to execute Stored Procedure?
Re: Problem with JDBC stored procedure
Thnaks !! -
Error while refreshing bqy file on workspace using stored procedure
Hi,
I am using stored procedure which returns ref-cursor. The report is running fine locally but on Workspace, while refresh, it gives the following error.
An Interactive Reporting Service error has occurred.-SQL API: [SQLNumResultCols], SQL RETURN: [-1], SQL STATE: [HY010], SQL NATIVE ERROR: [0], SQL MESSAGE: [[Microsoft][ODBC Driver Manager] Function sequence error]
(0)
I have ODBC/ODBC connection set up at BI+ configurator.
Thanks,
ManishWe also met this issue. Some guy told me this is a Hyperion limitation, is it true? I really need this function in Hyperion:(
-
Hi All,
I need to create Report Models using stored procedures. But whenever I am going to create data sources for same, I am just getting tables and views to use. Please see the screenshot below:
Is there any way out to create data source based on stored procedure? Please help.
Thanks in Advance
Regards
KumudHi Kumud,
As per my understanding, it is not support to create a Datasource View (DSV) using stored procedures.
In a DataSource View, only views, tables or named queries can be used. We can use stored procedures in a query. No parameterized queries, parameterized stored procedures or parameterized UDFs can be used in a DSV named query. You can try to using below approach
to achieve what you are require:
To build views in our relational source and add the views to the datasource view to proceed with modelling.
There is a similar issue, you can refer to it.
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/22207c21-03c7-4e5a-bb67-0372f29220a3/sql-server-reporting-services-2008-creating-report-models-using-stored-procedures
Regards,
Alisa Tang
Alisa Tang
TechNet Community Support -
How to use stored procedures in AJAX operations?
Hi,
First of all I hope this is the right place to post my question.
I am creating an application which involves AJAX style update of a specific page. I managed to make it work via the "classical JavaScript calling an On Demand Application Process then passing back result to JavaScript" way.
Despite everything works just fine the only annoyance is that I would like to call a Stored Procedure instead of an On Demand Application Process. But this is where I'm stuck.
I don't know whether the htmldb_Get() function inside the the JavaScript calling the On Demand Application Process can be used to call a Stored Procedure.
My motivation behind this are the follows:
- Stored Procedures can be edited by SQLDeveloper while On Demand Processes not (at least I could not find a way)
- The source code of an AJAX request/operation would me much more structured if it is made from smaller Stored Procedure parts instead of wiriting one "giant" On Demand Process.
Any suggestion is highly appreciated!
Thanks!
Zahoo
Edited by: user5516029 on Jan 19, 2009 1:20 AMHi,
Refer the below link:
JDBC:
Receiver JDBC scenario MS access - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 --> for jdbc receiver: file -JDBC
Stored Procedures-
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
http://www.ics.com/support/docs/dx/1.5/tut6.html
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
http://www.ics.com/support/docs/dx/1.5/tut6.html
http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html
http://www.sqlteam.com/article/stored-procedures-an-overview
HI in the message mapping structure u need to specify the different action and also u need to specify the procedure name.
refer the below link which has all the associated action
http://help.sap.com/saphelp_nw04s/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
Chirag -
Error in File-XI-JDBC Scenario
Dear All,
I am working on File-XI-JDBC scenario which is using stored procedure (SP_UPDATE). When I am processing the file it is giving me the following error in the message monitoring:
Unable to execute statement for table or stored procedure. 'SP_UPDATE' (Structure 'Statement') due to java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'access' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)
Please guide me what is this error all about and how this can be resolved.
Warm Regards,
N.JainDear All,
Now, I am able to update the SQL Server database but only one record is coming at the target. Can anyone please guide me what is he error in my Data types o in my mappings. Following is the source Data Type:
MT_TEST_FILE_T179T 1..1 DT_TEST_FILE_T179T
ROOT 1..unbounded
PRODH 1..unbounded xsd:string
VTEXT 1..unbounded xsd:string
DATUM 1..unbounded xsd:string
Following is the target Data Type:
MT_TEST_JDBC_T179T 1..1 DT_TEST_JDBC_T179T
STATEMENT 1..1
SP_UPDATE 1..1
action required xsd:string
TABLE 1..1 xsd:string
PRODH 1..unbounded xsd:string
type optional xsd:string
VTEXT 1..unbounded xsd:string
type optional xsd:string
DATUM 1..unbounded xsd:string
type optional xsd:string
Following are the mappings done:
EXECUTE-->@action
storedprocedurename-->TABLE
PRODH-->PRODH
VTEXT-->VTEXT
DATUM-->DATUM
CHAR-->@type.
With this stucture and mapping i am able to insert only one recored in the database even though there are multiple entries in the file.
Please guide me in solving this error so that multiple records can be inserted.
Warm Regards,
N.Jain
Maybe you are looking for
-
How do i get photos from my laptop onto my i touch 2nd gen
ive synced the photo file from my laptop of pics i want on there. shared it with apple tv. but no pics in my photos section on my i touch?
-
Adding Field to maintenance view
Hi I have added a field to Z Table wich has already created a maintenance view (SM30) , but this field does not appears in maintenance view even the table is active. (This is a basic Z table with one key field, the new field is not key field) I go t
-
I have an application that I've written so that a user can send a group of people an email message. It is in two parts, the form and the action page that actually sends the email. The first page's code is as follows: <cfquery name="getEmail" datasour
-
What can i do when my Xcode project shows me That UIKit/UIKit.h file not found.
When i going to run my Xcode project on my iPad i got an issue,it was UIKit/UIKit.h file not found. what can i do?
-
How do I import home DVD's into my iMOVIE?