Sender jdbc update sql error
hello friend ,
my xi-content scenario is oracle -> xi ->sapr/3
i am getting erro message in adapter monitor as following
Sender Adapter v0915 for Party '', Service 'oracle':
Configured at 04:26:46 2006-04-03
Last message processing started 05:17:12 2006-04-03
Error: SQLException during update 'TEST': java.sql.SQLException: ORA-00900: invalid SQL statement
last retry interval started 05:17:12 2006-04-03
length 60,000 secs
but update sql query is running fine on DB. still i am getting invalid SQL statement .
no message in sxmb_moni.
how should i check my jdbc adapter is running fine if it fine then what is error .
thanks friends.
amit ranjan
Amit,
You are using a sender JDBC adapter. There are 2 SQL querries you write in a sender adapter(JDBC).
1. Select querry which selects the fields and fetch it to your XI server.
2. Update SQL. This is a crucial one coz you can not process same set of rows again and again. So you may want to maintain a flag. This happens here.
In your case update SQL querry does not seem to work.
Check it.
For more help post us the 2 querries(select & update).
Look into this link for info on config of sender JDBC adapter
http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm
<i>(P.S: Reward replies that are helpful)</i>
Regards,
Jai Shankar.
Similar Messages
-
SAP XI JDBC update SQL statement
Hi,
I am new to JDBC to RFC configuration and is currently on a deadlock.
We are running a real time JDBC update statement where records are created based on employee login. We have configured the sender adapter to retrieved 5 records for every 5 seconds using the SQL query below:
select * from dtable where uploaded=false order by recordno asc limit 5;
and update using:
update dtable set uploaded=true where uploaded=false order by recordno asc limit 5;
The problem is that when there are only 3 records retrieved in the selection, the update statement always update 5 records back. This makes records created in-between the select and update to be updated as well.
Can anyone suggest the correct update statement? Can I use the record numbers retrieved from the first statement in the update?
Thanks,
RyanHi,
>>>>Can anyone suggest the correct update statement?
1. you have a few choices but one of them would be to use a stored procedure in the select statement (which would have both select and update statements)
2.
a) select * from dtable where uploaded=false order by recordno
b) update dtable set uploaded=true where uploaded=false
c) split them by 5 rows in the mapping (multimapping)
Regards,
Michal Krawczyk -
Hi
I tried to update a document but keep getting this error " java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in
UPDATE statement." I checked my update statements for any missing " or ' but everything seem ok.Anyone know what will be the likely reason behind this?? Thanks in advance
DocMgr mgr = new DocMgr();
int modDoc = mgr.modDoc("2","John","test","300803","file.txt","3","this is a test");
[DocMgr.java]
public int modDoc(String docNo , String name , String title , String date , String path , String docType,String comment)
System.out.println("entering modDoc");
try{
long res = db.UpdateSQL(doc.updateDocument(docNo , name , title , date , path ,docType ,comment));
System.out.println("Change rs value is"+""+res);
return (int)(res);
}catch(Exception e){System.out.println(e);}
return -1;
[Document.java]
doc = new Documents();
public String updateDocument(String docNo , String name , String title , String date , String path , String docType ,String comment)
String updateString= " UPDATE Document SET "+ "Name= '"+name+"', "+ "Title= '"+title+"', Date = '"+date+"', Path= '" +path+"' , DocumentType= '"+docType+"' , Comment='"+comment+"' WHERE DocNo ='" + docNo + "'";
return updateString;String updateString= "UPDATE Document SET Name= '"+name+"', Title= '" + title + "', Date = '" + date + "', Path= '" + path + "', DocumentType= '" + docType + "' , Comment='" + comment + "' WHERE DocNo ='" + docNo + "'";
System.out.println("--------------- SQL follows ----------------");
System.out.println(updateString);
System.out.println("--------------- SQL end ----------------");
Look at the output, maybe copy & paste to a query tool to check it. My money is on the date not being formatted correctly for the database. -
Sender JDBC Communication Update SQL Command Problem!
Hi all,
I am trying to do a SENDER JDBC Scenario in XI.
I fetch the Records from the table Once per day based on the Current Date.
I do not have any Update Credentials in the table.
I can only perform Select Querry.
But when i am trying to configure the SENDER JDBC Channel its asking me to enter value for Update SQL Command in Sender JDBC communication channel Process Parameters.
Its not accepting BLANK or ' * ' Values.
But i have only Select Querry credentials in the table. I can only pick the values cant Update the tables but.
In the Above scenario how can i configure the Sender JDBC CC without Updating the Table after fetching the value?
Please Advice
Regards,
Senthilprakash.Hi,
Specify the Update SQL Statement value as .
http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
Thanks
SaNv...
Edited by: Sãnthosh Kûmãr V on Oct 8, 2008 10:44 AM
Edited by: Sãnthosh Kûmãr V on Oct 8, 2008 10:45 AM -
Sender JDBC adapter -- Update SQL statement NOT work for the last record
I'm trying to use SAP XI to send records from Oracle database to As/400 using JDBC adapter. I've defined the communication channel for sender
(1) The "Query SQL statement" = select a_bgn_dt, a_end_dt from PX_PXXD WHERE NOT CU_ACTION_CD='P'
(2) The "Update SQL statement" = update PX_PXXD set CU_ACTION_CD='P' WHERE NOT CU_ACTION_CD='P'
Supposed that 3 records were retrieved from (1) and successfully updated to AS/400 but only the first 2 records in Oracle database are updated according to (2)
Any advise.
PansyHi Pansy,
You select and update query is looking like wrong
kindly check below query,If you are using oracle
(1) The "Query SQL statement" = select a_bgn_dt, a_end_dt from PX_PXXD WHERE CU_ACTION_CD !='P'
(2) The "Update SQL statement" = update PX_PXXD set CU_ACTION_CD='P' WHERE CU_ACTION_CD !='P'
Thank you
Sateesh -
Sender JDBC adapter : Update SQL Statement : stored procedure
Hi,
Can we use a stored procedure in the sender jdbc adapter in 'Update SQL Statement'.
The problem i am facing is like, we are selecting data from two tables in 'SQL statement for query' and then in 'Update SQL Statement' , we need to delete that data from these two tables.
Please let me know if it is possible.
Thanks,
Rohityou can use a Stored procedure in the
Query SQL Statement
You have the following options:
· Specify a valid SQL SELECT statement to select the data to be sent from the specified database.
· 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.
so have your whole select and update as part of this single Stored procedure -
JDBC Sender update SQL Statement Question.
I was wondering if there is a way to have the update SQL statement line in the JDBC sender update by time stamp, this would be very helpful. Does anyone know a method of doing this?
In the SAP documentation of the adapter it has this example for using the update SQL statement after the query statement:
SQL statement for query: SELECT * FROM table WHERE processed = 0;
SQL statement for update: UPDATE table SET processed = 1 WHERE processed = 0;
What I want is to be able to put processed = (the current date) instead of processed =1 in the update statement, like this example:
SQL statement for query: SELECT * FROM table WHERE processed = 0;
SQL statement for update: UPDATE table SET processed = (the current date) WHERE processed = ' ';
I seems like you can only use a fixed value for the update statements in the JDBC Sender though, I would like to know if you can use a time stamp or variable there. -
JDBC sender adapter, ...Processing parameters, Update SQL statement
in JDBC sender adapter, ...Processing parameters, there is an Update SQL statement field, can u tell me ...why this is required,,,,,and in one of the example scenario...it was given as <TEST>..
Sudheep,
In the sender JDBC adapter you have the select query to select data from the database.
Let us summer 2 cases,
1. You have <test> in the UPDATE . In this case, during every polling interval the JDBC adapter will end up selecting the same data from the Database. This would not be needed in most f the cases. Why would you want to select the same data over an over again?
2. If you have an update Statement in the Update field you can make sure that the data selected in the selected statement is updated so that the same rows are not selected again.
Take a look at this blog,
/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
Regards
Bhavesh -
Update sql statement in sender/receiver jdbc adapter
Hi
What is the update sql statement we give in the sender/ receiver adapter when
1) SELECT statement was written in query sql statement
2) EXECUTE statement was written for a stored procedure in query sql statement
thanks
Anitha> 1) SELECT statement was written in query sql statement
your table should have some value "already_processed" which prevents a second processing of that table.
the update statement sets that value.
> 2) EXECUTE statement was written for a stored procedure in query sql statement
the same as above.
when your stored procedure already does the update, then write a second stored procedure which does nothing. -
Update SQL statement in JDBC sender (system fields)
All,
Is it possible to update more than 1 field via the update sql statement ?
Also, is it possible to use system fields ?
Something like this
UPDATE database.table SET processed='Y', date = sy-datum
Regards, MichelHi
use sysdate as suggested above
Check your generated SQL query format is correct
At runtime you can find the genereated sql statements by doing configuraitons in Receiver JDBC adapter.
In the JDBC Receiver adapter you have the Advanced Properties .
Over there enter the following
left column logSQLStatement
right column true
To see the query created ..
Login to adapter monitoring ..select the relevant jdbc adapter.
Now when any message is processed by the jdbc adapter in adapter monitoring at that time you will see a message link. When you click on that link a new window will open. In that window if you click on page down you will get to see the sql statement generated by the jdbc adapter. -
I have a select query as
SELECT * FROM ULIDTA2.F5631505 where QSINTF ='Y'
update query is
Update ULIDTA2.F5631505 set QSINTF='Y' where QSINTF ='N'
i get the following error in my Adapater .
Sender Adapter v2108 for Party '', Service 'BS_Database_to_RFC_BPM':
Configured at 2006-03-10 12:31:18 GMT+08:00
History:
- 2006-03-10 12:33:06 GMT+08:00: Retry interval started. Length: 60.000 s
- 2006-03-10 12:33:05 GMT+08:00: Error: SQLException during update 'Update ULIDTA2.F5631505 set QSINTF='Y' where QSINTF ='N'': SQLException: [SQL7008] F5631505 in ULIDTA2 not valid for operation.
- 2006-03-10 12:33:00 GMT+08:00: Processing started
- 2006-03-10 12:32:05 GMT+08:00: Error: SQLException during update 'Update ULIDTA2.F5631505 set QSINTF='Y' where QSINTF ='N'': SQLException: [SQL7008] F5631505 in ULIDTA2 not valid for operation.
- 2006-03-10 12:32:00 GMT+08:00: Processing startedHi Amit,
A JDBC sender adapter has 2 essential fields,
1. SQL Statement
2. Update Statement
Your SQL statement will contain your SELECT statement and once your SQL statement is executed, UPDATE statement is executed. This is done so that records that have been selected by the SQL statement should not be selected again as the JDBC sender adapter will poll over the database for every poll interval.
If you want to SELECT something from your Database, then you will have to go for a JDBC sender adapter.
But, if you want to insert/update your Database, then you can go for a JDBC receiver adapter.
Multiple insertions are possible for a JDBC receiver, but multiple Selection queries (different select queries) are not possible for a single JDBC sender adapter.
Just check these links to understand how JDBC adapters work,
If you wanna do update/insert you will have to follow the
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm">Document Formats for the Receiver JDBC Adapter</a>
For Configuring the Receiver JDBC Adapter refer:
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm">Configuring the Receiver JDBC Adapter</a>
For Configuring the Sender JDBC Adapter refer:
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm">Configuring the Sender JDBC Adapter</a>
Regards,
Abhy -
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 -
Error in Sender JDBC communication channel
Dear All,
We have an interface in which we are fetching data from SQL database through sender JDBC communication channel.
Last week SQL server was upgraded from 2000 to 2008 and the communication channel has stopped working and is giving the following error:
Database-level error reported by JDBC driver while executing statement 'SELECT * FROM mstemp_tbl WHERE Active='0''. The JDBC driver returned the following error message: 'java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 1 (""): Data type 0x38 is unknown.'. For details, contact your database server vendor.
Please let me know if any JDBC drivers are to be installed for SQL 2008 or how can we resolve this.
Thanks,
NJHi,
You may need to update your JDBC driver to 1.2 or 2.0. Kindly see supportability matrix on this link (question #2):
http://msdn.microsoft.com/en-us/sqlserver/cc325721
Regards,
Jenny -
JDBC Adapter - Sender - Stored Procedure - SQLException Error
Hi,
I have created one stored procedure in our Oracle database. I give below that stored procedure.
CREATE OR REPLACE PROCEDURE sp_stud
IS
l_row student%ROWTYPE;
TYPE t_ref_cursor IS REF CURSOR RETURN l_row%TYPE;
c_cursor t_ref_cursor;
BEGIN
OPEN c_cursor FOR
SELECT *
FROM student where readflag= ' ';
LOOP
FETCH c_cursor into l_row;
EXIT WHEN c_cursor%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(l_row.id || ' : ' || l_row.name);
END LOOP;
close c_cursor;
END;
This is a procedure to retreive rows from the table student which is having the field read_flag = ' '; (Student table contains the fields ID, NAME, BIRTHYEAR, BIRTHMONTH, READFLAG).
In JDBC Sender Adapter, I set the values for the following fields under Parameters tab.
Query SQL Statement: EXECUTE sp_stud
Update SQL Statement: UPDATE student SET readflag = 'Y' where readflag = ' '
The scenario is every 5 minutes JDBC adapter checks the table whether any new row is inserted, if it is inserted and commit, it will send that record to File. This is the Scenario.
In Runtime Workbench, Communication Channel Monitoring, it shows the following error, when JDBC Polls the table.
Database-level error reported by JDBC driver while executing statement 'EXECUTE sp_stud'. The JDBC driver returned the following error message: 'java.sql.SQLException: ORA-00900: invalid SQL statement '. For details, contact your database server vendor.
Note : If we execute the Stored Procedure ad SQL command level, it works fine.
Kindly help friends to solve this, where the error is happened.
Thanking you,
Kind regards,
Jegatheeswaran P.Hi,
Not a Database expert. But , in case you have not seen the note pointed by Deepu,
<i> The JDK 1.1.x, 1.2 and 1.3 versions (classes111. zip, classes12.zip, classes12.jar) of the driver are not compatible with the SAP XI JDBC Adapter. Use the JDK 1.4 driver (ojdbc14.jar) instead. For details, refer to Oracle MetaLink note # 203849.1.
<b>Invoking Oracle stored procedures from within a JDBC sender channel is only possible for Oracle DBMS versions >= 10.2.x using so-called table functions:</b>
Example:
pkg1 -
CREATE PACKAGE pkg1 AS
TYPE numset_t IS TABLE OF NUMBER;
FUNCTION f1(x NUMBER) RETURN numset_t PIPELINED;
END pkg1;
CREATE PACKAGE BODY pkg1 AS
-- FUNCTION f1 returns a collection of elements (1,2,3,... x)
FUNCTION f1(x NUMBER) RETURN numset_t PIPELINED IS
BEGIN
FOR i IN 1..x LOOP
PIPE ROW(i);
END LOOP;
RETURN;
END;
END pkg1;
pkg1 -
<b> This function has to be invoked from the sender channel configuration (SELECT statement) as follows:
SELECT * FROM TABLE(pkg1.f1(5));</i></b>
Check this, confirm your Oracle DB version and then use the Table Functions as described in this note.
A Database Expert wil be able to crack this for sure.
Regards
Bhavesh -
Sender JDBC adapter SELECT / UPDATE issue - updates more rows than selected
Hi,
We have configured a Sender JDBC Adapter to poll records from an Oracle table based on a flag field and then update the flag for the selected records. When tested in DEV and QA environments (where test data comes in intermittently and not in huge volumes), itu2019s working fine.
Both SELECT and UPDATE queries written in the Sender JDBC adapter are getting properly executed and are changing the status of the flag for the selected records from Y to N once read from the database.
select * from <table> where flag = 'N'.
update <table> set flag = 'Y' where flag = 'N'.
But in the PROD environment (with records getting updated in the database every second), after XI executes the SELECT query and just before the UPDATE query is executed, new records come into the Oracle table with status flag 'N". So when the UPDATE query runs just after the SELECT query, then these unselected records also get updated to 'Y'. Thus these records never get into the resultset and hence XI and thus remain unprocessed.
So when XI does a SELECT and UPDATE on the Oracle DB table and concurrently there is an INSERT happening into the table from the other end, the JDBC sender adapter is picking up a certain number of records but updating the status of more records than it picked up.
So how does XI deal with such a common scenario without dropping records?
Thanks,
VishakThe condition being checked is the same for both SELECT and UPDATE statements.
Initially I tried setting transaction isolation levels on the database to repeatable_read and serializable but it was throwing me a java.sql.SQLException error saying that these transaction levels were not valid.
I asked for these transaction level permissions for the XI user from my DBA but the DB I am accessing provides only a view into other databases and so it's not possible.
Maybe you are looking for
-
Unassigned Values in PS reports
Hi , We have not assigned few Cost elements in transaction code OPI2 , mainly COGS and SFGs consumption Cost elements. So they are coming in the unassigned value category. But when we run the hierarchical report S_ALR_87013532 - Plan/Actual/Variance,
-
How to hide a field from table maintenance view?
Hi, How to hide a field from table maintenance view? The field is used for data created date. I need to hide it from display. Thanks
-
How to disable Shredded Storage in SharePoint 2013?
Hi, My understanding is that SharePoint provide "FileOperationSettings" property to disable Shredded Storage but this property is not working in SharePoint 2013 RTM release. Only the way they provide is modify the FileWriteChunkSize property and set
-
ORACLE 10g IN THE W2K - Is able to help me?
Hi, I is installing the Oracle 10g in a Pentiun 4, Windows 2000 and service pack 4, by in the installation appears an alert informing that was not possivel carry OCI. The installation continues normally to that the assitente try create the DB, there
-
The virtual Infocube in Cash Flow Statement
Hi Experts, In Business Content the Sequence of Cash Flow Statement is below 0FI_GL_6->0FIGL_O06->0FIGL_C01->0FIGL_VC1->0FIGL_VC1_Q0002 Cash Flow Statement (Cash Flow) I follow the flow and extract the transaction data from the datasource, finally I