QUESTION abt "SQL_DML" of the Receiver JDBC Adapter
HI ALL,
i hav a doubt abt "SQL_DML" of the Receiver JDBC Adapter.
i wanna use two SQL Statements in the "SQL_DML" structure to manipulate two tables.
i.e.
<root>
<stmt>
<Customers action="SQL_DML">
<access>
INSERT INTO Customers VALUES (u2019$NAME$u2019, u2019$ADDRESS$', '$KEYFIELD$u2019);
INSERT INTO Companys VALUES('$NAME$')
</access>
<key>
<NAME>Company</NAME>
<ADDRESS>Street 3 </ADDRESS>
<KEYFIELD>CO</KEYFIELD>
</key>
</Customers>
</stmt>
</root>
BUT i cant ascertain if it permit like this writting above ??
Requset help in this regards.
Thx in advance.
brian
Hi,
You need to have two different statements. Each for one insert query. Your query will come under access tag and palceholders under kay tag. Action will remain same as you have given, but under both statements.
Ex:
<root>
<stmt1>
<Customers action="SQL_DML">
<access>
INSERT INTO Customers VALUES (u2019$NAME$u2019, u2019$ADDRESS$', '$KEYFIELD$u2019);
</access>
<key>
<NAME>Company</NAME>
<ADDRESS>Street 3 </ADDRESS>
<KEYFIELD>CO</KEYFIELD>
</key>
</Customers>
</stmt1>
<stmt2>
<Customers action="SQL_DML">
<access>
INSERT INTO Companys VALUES('$NAME$')
</access>
<key>
<NAME>Company</NAME>
</key>
</Customers>
</stmt2>
</root>
Hope this helps.
Regards,
Siddhesh S.Tawate
Edited by: siddhesh tawate on Apr 24, 2009 8:10 AM
Similar Messages
-
Error in the Receiver JDBC Adapter
Hi Guys,
Iam getting the below given error when trying to insert the data into the Legacy DB...
2006-06-20 01:16:25 Error Unable to execute statement for table or stored procedure. 'Table_Name' (Structure 'STATEMENT') due to java.sql.SQLException: ORA-01861: literal does not match format string
2006-06-20 01:16:25 Error Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'Table_Name' (structure 'STATEMENT'): java.sql.SQLException: ORA-01861: literal does not match format string
Can anybody tell me what the error is ?
Regards,
Kittu.Kittu,
this is how your Target Datatype should be,
<nr1:MT_tablename xmlns:nr1="urn:XXXXXX.XX.yyyyy">
<StatementName>
<dbTableName action=INSERT>
<table>TABLENAMETO WHICH INASERTING DATA</table>
<access>
<ts_matl>2006-06-14</ts_matl>
<no_matl>M181127</no_matl>
<qt_do>1</qt_do>
</access>
</dbTableName>
</StatementName>
</nr1:MT_tablename >
Regards,
Bhavesh
Message was edited by: Bhavesh Kantilal -
Want Batch mode in the Receiver JDBC adapter
Hi,
My scenario is File to JDBC . from the source file I'm getting 20 records for file. after processing by XI while inserting the records into database level but due to some problem some records are not inserting.. suppose first 5 records got successfully inserted. but 6th record due to unique contarin problem that was failed. but due to this problem remaing records are also not inserting from the 6th record onwards it was not inserting any more records .
But i want to process all the Records or If any error is there in those records i want to fail all the records. I dont want any partial posting of the data.
Plesae suggest me some solution for this.
Regards
JainHi Joel,
Already i have selected that Batch Mode in Advanced tab. my transport protocol is JDBC 2.0 .
And my SQL query is only INSERT . in the mapping i have mapped action tag to INSERT Command for inserting the rows...
still my SQL query is inserting first 5 records only out of 20 records ... if the sixth record contain any problem the process has been terminating .
Please suggets me some solution for avoiding those problems. if any error is there then i want to fail teh complete message otherwise process all the records. I dont want any partial posting of the file.
Regards
Jain -
Table name in Receiver JDBC Adapter
Hi All,
I am using receiver JDBC adapter.
But table name consist of " like BPC."#II" .
After mapping table name becomes BPC."#II" .
I am getting error while pulling data from DB.
Is the table name creating a problem.
Please remedy of this if you have come across such scenario.
Regards
PiyushHi Piyush,
All that i could get from the SAP Help regarding JDBC Adapters are these links where i never found anything much regarding the table name.anyways just go through these links and see if you find anything useful.
http://help.sap.com/bp_bpmv130/Documentation/Planning/XIUnicodeGuide030411.pdf
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/content.htm">Configuring the Receiver JDBC Adapter</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/406642ea59c753e10000000a1550b0/content.htm">Mapping Lookups</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/22/b4d13b633f7748b4d34f3191529946/content.htm">JDBC Adapter</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm">Configuring the Receiver JDBC Adapter - part 2</a>
This is all i got from the help files, anyways you can also go through those links and see if you find anything else useful.
- Escape Symbol for Apostrophe
The apostrophe character () is a reserved character in SQL syntax and is therefore replaced by an escape character if it occurs within value strings. This replacement character can be database-specific. Typical replacement characters are \ or (default value). If a character occurs that is invalid for the database being used, the adapter triggers an error message (an SQL exception) concerning the SQL syntax that is generated by the database.
- Column Name Delimiter
Depending on the database being used, column names can be enclosed by a special delimiter character, for example, if the names can contain special characters (such as ). This character can be specified at this point. The default setting is no delimiter character. If a character occurs that i
Also check if there are notes in the service market place related to the same.
Regards,
abhy
Message was edited by: Abhy Thomas -
How to handle BLOB field in receiver JDBC adapter into ABAP table
Dear Experts,
I am working in a synchronous scenario with Sender ABAP Proxy to Oracle Database as receiver via SAP PO 7.4.I will be calling a stored procedure view with fields ID, NAME,Age,*** and BLOB (Image binary).
1. The response from Oracle Database field BLOB is to be stored in ABAP table.Would I have to write any JAVA program to read the BLOB or the receiver JDBC adapter will handle it and store in a table by using ABAP proxy once it reaches ECC.
2. If yes, would the JAVA program have to deal with other 4 fields.
3. Can I use a UDF mapping to this BLOB field.
Regards
Rebecca...Dear Praveen,
Thanks for your response...
Please correct me if I am wrong.
1. For 1-1 response mapping for BLOB field, I will use just use the below UDF code.
public static byte[] hexStringToByteArray(String s) {
int len = s.length();
byte[] data = new byte[len / 2];
for (int i = 0; i < len; i += 2) {
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
+ Character.digit(s.charAt(i+1), 16));
return data;
2. ===Using the byte data, create binary attachment in mapping for abap proxy response===
Could you please share how to create the binary attachment.. I am not clear
Regards... -
Specify Keys in Data Type for receiver JDBC adapter
Hi guys,
I have the following issue:
In a proxy to JDBC scenario, I want to specify somehow the key values for the SQL statement in the data type that I define for the receiver JDBC adapter. Thus, I am using the following structure in data type:
root
Statement
dbTable
action
table
access
CustomerID
Name
HouseNo
Key
CustomerID
But in the SQL statement that is produced (I can see that in RWB, CC Monitoring, Audit Log), the "Key" segment is translated into "OR". E.g. UPDATE_INSERT ("A100" "Evaggelos Gkatzios" "El Alamein 19") OR ("A100")
Do you have any ideas ?Hi,
Its clear from the statement in RWB (in CC monitoring's auditlog) you are using UPDATE_INSERT as the action.
Please correct me if this is OK. Now the interpretation of input xml file will be like this,
If the input XML is in the following format
<root>
<Statement>
<dbTable action=UPDATE_INSERT>
<table>EXAMPLE</table>
<access>
<CustomerID>ABC</CustomerID>
<Name>xyz</Name>
<HouseNo>123</HouseNo>
</access>
<key>
<CustomerID>DEF</CustomerID>
</key>
</dbTable>
</Statement>
</root>
Resultant SQL after parsing the XML file will be,
1. It will first check with the condition WHERE CustomerID = DEF. If it finds the record with this condition then it will update the record with CustomerID=ABC, Name =xyz & HouseNo=123.
2. If it doesn't find any record with that CustomerID then, it will insert a new record with the same details.
In auditlog, you will find two SQL statements like,
1.UPDATE EXAMPLE SET CustomerID=ABC, Name =xyz & HouseNo=123 WHERE CustomerId=DEF
2.INSERT INTO EXAMPLE VALUES(ABC,xyz,123)
hope this has given clear information about your query,
Regards,
Soorya -
RECEIVER JDBC ADAPTER----ROLLBACK IN XI
Hi Gurus,
I have a scenario with the receiver as JDBC adapter.If there is any error in updating to Database during the interface flow,how do Rollback occurs in XI???
Please help......
Regards,
SriparnaHi Sripam1,
select SQL statement 'batch mode' ,
i.e,
see
8. Defining Parameters in Advanced Mode
6. If you want to collect SQL statements in a batch, select Batch Mode.
of the SAP online help
[Configuring the Receiver JDBC Adapter|http://help.sap.com/saphelp_nwpi711/helpdata/en/48/465581929734d9e10000000a42189d/content.htm]
Also ensure that 'Database Auto-Commit-Enabled (No Transaction Handling)' is not enabled.
Regards
Kenny -
Receiver jdbc adapter:how to implement the insert or update action in a sql
Hi,gurus:
I'm using receiver jdbc adapter now.
You know, we have to gave the action the value 'update' or 'insert',but in our case,the action is variant--update or insert.It decides whether the record exists in the outer database.
Can stored procedure do this?If I use stored procedure,then must I create a stored procedure in the outer database?
Or some other ways to solute my issue?
THanks in advance.Hi
Use Action UPDATE_INSERT .
This action check if a record exist with same key value then update that record. In case no record with key value found in database then record inserted to database.
look receiver structure
http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm -
What are the Batch mode parameters for Receiver JDBC Adapter
Hi All,
Could some pls tell me how to set bacth mode in receiver JDBC adapter and what are its parameters and how to configure them. i beleive there is something like max count parameters etc..
Regards,
XierHi,
Check this for more info
http://help.sap.com/saphelp_nw04s/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
Regards
Seshagiri -
Exactly-Once Handling in Receiver JDBC Adapter
Hi,
I have doubt abt Exactly-Once Handling in Receiver JDBC Adapter.
For Conflict Resolution as Database.
Why there is need to define table as below ?
In the database where the write-to tables are located you must create an additional table with two columns for this purpose. To define the table, specify the following:
Database Table Name
Enter the name of the table.
Key Column Name
Enter the name of the column in which the key is entered.
Value Column Name
Enter the name of the column in which the key value is entered.
Please explain in simple language.Hi Abhishake,
Thanks for your reply.
I understant that the tables needs to be created in DB.
But if you read the SAP Docs for conflict resolution. My undestanding is "During Database commit if AS Java is terminated then the message will be in unknown state, for this type of messgaes when the AS Java restarted the behaviour is defined by this parameters. If the message doesn't have primary key, then there is probablity when AS Java will try second time it may get the message in DB so a message can be duplicated. To avoid this condition it is mentioned that you must create additional table with three column".
Please correct my understanding if I am wrong.
My additional table needs to create & how it will resolve the problem.
Thanks in advance. -
FCC Parameters are required in the Receiver File Adapter
Hi ,
Sorry for posting this question again.. my Structure is
MT_CADVICE_STRING
. . Batach -
1:Unbounded (Node)
. . .Header_String -
1:1
. . .Line_Item -
1:Unbounded (Node)
. . . .LineItem_String -
1:1
for this structure I'm geting data in the XML format.. .. my scenario is simple File to File scenario.. now i want to convert this XML to a normal Text file by using FCC in the Receiver file adapter..
and in the Receiver side i want the file in the bellow format: (each field i want to get in the separate line but at presnt I'm getting the continution of all lines I'm not getting the data in a separate lines..)
Header_string
LineItem_String
LineItem_String
Header_String
LineItem_String
so, any abody can help on this...
And in the Receiver Communication channel i keep the FCC parameters like as bellow :
RecordsetStructure : Batch,LineItem
Batch.fieldSeparator: 'nl'
LineItem.fieldSeparator: 'nl'
Batch.endSeparator: 'nl'
LineItem.endSeparator: 'nl'
For more information.. My source file is like bellow
<?xml version="1.0" encoding="utf-8" ?>
- <nr1:MT_CADVICE_STRING xmlns:nr1="urn:Test.com:SD:CAdvice">
- <Batch>
<Header_String>1 B 1110300014200804108218 36892.80 03 10.000 10.000 0.00 0.00 008000021720080410558000.00 91958.40 649958.40 0.00 649958.40 2678.40 1000003461100000346110000034611000003461123456 18 18 0.00 $</Header_String>
- <LineItem>
<LineItem_String>2 B 1110300014 1 000000000001234567000000000001 5.000 0.00 45000.00 10800.00.00 16.00 279000.00 0.00 rcl/ML0080200804100000000357 200804100.00 01 02 000000002.00 860.13321.00 $</LineItem_String>
</LineItem>
- <LineItem>
<LineItem_String>2 B 1110300014 2 000000000001234567000000000001 5.000 0.00 45000.00 10800.00.00 16.00 279000.00 0.00 rcl/ML0080200804100000000357 200804100.00 01 02 000000002.00 860.13321.00 $</LineItem_String>
</LineItem>
</Batch>
</nr1:MT_CADVICE_STRING >
Regards
JainHi jain
Provide as below definitely it will work,
RecordSet Structure : batch,Line_Item,LineItem_String
batch.fieldSeparator --- 'nl'
Line_Item.fieldSeparator -
'nl'
LineItem_String.fieldSeparator --- 'nl'
All your fields will come in a separate line.
Regards,
Sasi
Edited by: sasitharan on Jul 28, 2008 11:36 AM -
Hi All,
I was trying to make a synchronous call to a receiver jdbc adapter with the help of
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3928. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
I am getting the following error in jdbc adapter.
<i>com.sap.aii.af.ra.ms.api.DeliveryException: ERROR:Processing request: Error when executing statement for table/stored proc. 'MISDetails': java.sql.SQLException: FATAL ERROR document format: structure 'STATEMENT', key element 'FiscalYear' contains no values</i>
My Source message is
<i><?xml version="1.0" encoding="UTF-8"?>
<ns:MT_FILE_OUT xmlns:ns="urn:ters">
<REQUEST>
<FISCALYEAR>2007</FISCALYEAR>
<YEARMONTH>1</YEARMONTH>
<OPERATION>EQ</OPERATION>
</REQUEST>
</ns:MT_FILE_OUT></i>
And JDBC request message is ..
<i><?xml version="1.0" encoding="UTF-8"?>
<ns:MT_JDBC_REQ xmlns:ns="urn:ters">
<STATEMENT>
<TABLENAMEACTION="SELECT">
<TABLE>MISDetails</TABLE>
</TABLENAME>
<ACCESS>
<FiscalYear> </FiscalYear>
<YearMonth> </YearMonth><ProductCode> </ProductCode><TargetVolume> </TargetVolume>
</ACCESS>
<KEY>
<FiscalYear compareOperation="EQ">2007</FiscalYear>
</KEY>
</STATEMENT>
</ns:MT_JDBC_REQ></i>
Regards,
SumitSumit, the problem is that </TABLENAME> is closed ealier than necessary.
This is how the JDBC datatype should be,
<?xml version="1.0" encoding="UTF-8"?>
<ns:MT_JDBC_REQ xmlns:ns="urn:ters">
<STATEMENT>
<TABLENAME ACTION="SELECT">
<TABLE>MISDetails</TABLE>
<ACCESS>
<FiscalYear> </FiscalYear>
<YearMonth> </YearMonth>
<ProductCode> </ProductCode>
<TargetVolume> </TargetVolume>
</ACCESS>
<KEY>
<FiscalYear compareOperation="EQ">2007</FiscalYear>
</KEY>
<b></TABLENAME></b>
</STATEMENT>
</ns:MT_JDBC_REQ>
The TABLE, ACCESS and KEY come under the TABLENAME tag.
Regards,
Bhavesh -
Messages are in hold state due to one message at receiver JDBC adapter
Hello,
I am using a receiver JDBC adapter and trying to send an XML file which has an insert query to insert some data into the database i.e., Oracle 9i.
Here at the receiver side due to one message ( which is in to be delivered state) all other messages are got hold and waiting for long time.
I am getting the exceptions as this,
JDBC Adapter processing failed with Error processing request in sax parser: Error when executing statement for table/stored proc. 'FSASMGR.XTBL_KL06_IINQUIRY' (structure 'REC01'): java.sql.SQLException: ORA-12899: value too large for column "FSASMGR"."XTBL_KL06_IINQUIRY"."CASE_TITLE" (actual: 81, maximum: 80)
Exception caught when executing statement for table/stored proc. 'FSASMGR.XTBL_KL01_ISTAFF_MST' (structure 'REC1'):
java.sql.SQLException: ORA-00001: unique constraint (FSASMGR.XTBL_KL01_ISTAFF_MST) violated
Can anyone help me out in solving this issue.
THanks,
Sooryahi surya,
jdbc channel tries a request for n number of times(no of rettries),if that request fails it will take up the following requests,its not like it will process a request forever.
to be delivered will be resulting if reciever is down or network between XI and database server is bad.
try to ping databse server from XI host system.
if everything is fine then look at the channel configuration->advanced->no of retries of database transaction on sql server.
just redue the count to 1 and recheck.
Regards,
rama Krishna -
Multiple table insert using receiver jdbc adapter
Hi,
I am trying to insert data in to two tables in a single structure using receiver jdbc adapter. I am not using any stored procedure to insert data instead directly inserting the data using PI. Please see the structure I am using.
SOURCE side:
DT_ABC_SENDER
--IT_HEADER_TEXT
-- EBELN
-- LINENO
--TDTEXT
--IT_ITEM_TEXT
-- EBELN
-- LINENO
--TDLINE
TARGET side:
DT_ABC_RECEIVER
--InsertStatement
--HEADER_TEXT
-- action (insert)
-- Table (Table 1)
--access
-- IDS_ENQ_NO
-- IDS_DESC
-- IDS_TEXT
--ITEM_TEXT
-- action (insert)
-- Table (Table 2)
--access
-- IIS_ENQ_NO
-- IIS_DESC
-- IIS_TEXT
Using the above structure I am able to successfully insert the data in Table 1 but data is not getting inserted in Table 2.
In sxmb_moni it is saying message successfully delivered but I but there is data insertion took place in Table 2.
Please help me urgently.
Thanks in advance.
NeeerajHi Neeraj,
Add --InsertStatement statement for the second table structure in the same level of first InsertStatement.
Target structure like this:
DT_ABC_RECEIVER
--InsertStatement
--HEADER_TEXT
-- action (insert)
-- Table (Table 1)
--access
-- IDS_ENQ_NO
-- IDS_DESC
-- IDS_TEXT
--InsertStatement
--ITEM_TEXT
-- action (insert)
-- Table (Table 2)
--access
-- IIS_ENQ_NO
-- IIS_DESC
-- IIS_TEXT -
When would you write a stored procedure in sender/receiver jdbc adapter
Hi Everybody
Can you tell any situation where you would need to write a stored procedure in the query sql statement of sender/ receiver jdbc adapter instead of writing SELECT statement there
why do we need to write stored procedures
thanks and regards,
AnithaHi Anitha,
why do we need to write stored procedures
Some times a single SQL statement will not suffice for ur transactions....
Say u want to access from 2 tables and update based on some condition..
or nested select statement...
or u want to update a 2 nd table based on the values from 1st table... etc..
In those places it's preferable for going for a Stored Procedure.
The Stored Procedure can be used in both Sender and Receiver JDBC Adapter.
Still nt clarified do post..
Babu
Maybe you are looking for
-
Error while opening an workbook
Hi I have done some changes to a query and transported Query as well as Work book to production. When i open the work book I get the below error and gets disconnected form BW <internal Error > Receiving from theBW server failed BW server raised exc
-
How to make a free apple ID account
How to make a free apple ID account
-
I've purchased a new laptop and would like to upgrade to Acrobat X on it. I have Acrobat 8 Pro on my old system, but I've misplaced the original disk. I have the serial number for the original program. What is the best way to upgrade, without purc
-
Hello everyone, So When I use the eraser on a photo and try to save it as jpeg is makes is save it as a copy but the parts that I erased are replaced with a white background and thats not what I want
-
Increase Subordinate CA validity
Hy, I want to build a Subordinate CA but using a different validity period. As you know the default it's 5 years (SubCA template), and I want to make it 10 years. So before I installed the Subordinate Certification Authority on the second server I cr