JDBC Sender - Wrong SELECT statement (Oracle driver)

Hi,
3 days ago I was having a problem with my JDBC Sender adapter [JDBC Sender adapter is reading but then there isn't the message in SXMB_MON; .
Finally I discovered what's wrong but I can't understant why is not working. When I deleted the "WHERE" condition in my SELECT statement all worked OK (except that I need the WHERE statement...).
Why that statement is not working in my JDBC Sender:
SELECT * FROM MATERIALES WHERE LEIDO<>'X'
and that statement works:
SELECT * FROM MATERIALES
The field "LEIDO" is my flag that I must set to X when I read with the UPDATE statement, so I need the where condition...

Thanks Christopher but still not working
I tried two new statements:
1 - Escaping:    SELECT * FROM MATERIALES WHERE LEIDO <> 'X'
2 - Changing the operator symbol: SELECT * FROM MATERIALES WHERE LEIDO != 'X'
The nº1 gives me an error of invalid character
The nº2 has the same effect than the other symbol, the adapter reads from the DB but no XML message is generated and no payload to check what's happening... just a message ID without information and without a message generated in SXMB_MONI

Similar Messages

  • Avoid JDBC sender error: Execute statement did not return a result set

    Hi!
    My JDBC sender adapter towards MS SQL server works fine, with an Execute statement calling a stored procedure that returns the source data needed. The stored procedure itself updates the status of database table records, so that only the unread records are returned each time the stored procedure is called.
    However, the communication channel monitoring sets a red flag for the JDBC sender adapter, when there are no values to fetch from the database table (using the stored procedure). Message says: "Database-level error reported by JDBC driver while executing statement 'EXECUTE FetchMessage 1, 9000'. 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."
    This is not an error situation, as I do not expect there to be any values to fetch from the database at all times.
    I do not see how to change the stored procedure to avoid this error.
    Is there a parameter to be set on the JDBC adapter that I can use, so the red flag is avoided?
    Thanks for any input!
    Regards,
    Oeystein Emhjellen

    Hi Oeystein Emhjellen.
    The problem is Store Procedure that has to generate always a ResultSet (or cursor). If it doesn't have a output, you have to generate an Empty ResultSet.
    Like a SELECT Statement:
    If there are data, SELECT get an output result but if it get nothing the SELECT Statement get a empty ResultSet.
    Ask to your database team.
    I hope it helps you.
    Bruno.

  • JDBC Sender -Not selecting records

    Hi all
    I have set up a JDBC sender. The communication channel monitor shows that "Polling interval started" but It is not retrieving data from the JDBC table using a select statement.
    This is a sql select statement.
    SELECT * FROM table
    there is also a corresponding update statement.
    clearly ,XI is unable to pick up data from the table.
    if i change the name of the table , it does throw an SQL exception that the object doesnt exist. I have also checked with other tables and it is fetching data correctly. The table under problem does contain a row of data in ORacle side.
    Why doesnt XI select the records of the table?
    Any help will be highly appreciated
    thanks
    krishna

    Hi
    yes, the table does contain data
    and the sql stmnt is actually
    select * from table where flag= 'true' ( i also tried it without the where condition)
    here are the other parameters
    QOS : Exactly Once
    Poll interval: 6
    Document name: Resultset
    Update sql stmnt : UPDATE TBL SET FLAG = 'FALSE' WHERE FLAG = 'TRUE'
    hope this helps
    regards
    krishna

  • 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 - SQL-Statement

    Hi,
    I'm using the JDBC-Sender-Adapter and need to use a SQL-Statement like this:
    SELECT * FROM myTable WHERE myDate = <current_date>
    Is such a dynamic-sql possible, or can I only use static sql-statements. And if yes how can I solve this problem.
    many thx

    Hi Werner,
    inside the <b>Query SQL Statement</b> you can use <b>SQL EXECUTE</b>
    which can execute a stored procedure
    in which you can do
    SELECT * FROM myTable WHERE myDate = <current_date>
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • Wrong Select statement being generated

    The problem is to do with querying an object (db table) in an inheritance. The main comment is at the end.
    A. Here is the base class:
    @javax.persistence.Table(name = "DATA_PROFILE", schema="LPDS")
    @javax.persistence.Entity
    @javax.persistence.Inheritance(     strategy = javax.persistence.InheritanceType.JOINED)
    @javax.persistence.DiscriminatorColumn(name="DOMAIN_TYPE" , discriminatorType=javax.persistence.DiscriminatorType.STRING)
    public abstract class DataProfileEntity implements java.io.Serializable{
    B. And here is the sub class being queried:
    @javax.persistence.Table(name = "DATA_CONSTRAINT", schema="LPDS")
    @javax.persistence.Entity
    @javax.persistence.DiscriminatorValue("DataConstraint")
    @javax.persistence.PrimaryKeyJoinColumn(name="ID", referencedColumnName="ID")
    public class DataConstraintEntity extends DataProfileEntity implements java.io.Serializable, Cloneable{
    C. Here is my DAO using the Eclipselink API:
    @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.NOT_SUPPORTED)
    public java.util.Collection<T> queryByExample(T entity) {
         if (type == null) {
              throw new UnsupportedOperationException("The type must be set to use this method.");
         if (entity == null) {
    throw new java.lang.NullPointerException(DAOExceptionMessageBuilder.buildMessage("param.value.empty", new Object[] { entity}));
         try{
    ReadAllQuery readAllQuery = new ReadAllQuery(type);
    readAllQuery.setExampleObject(entity);
    return (java.util.Collection<T>) getUnitOfWork().executeQuery(readAllQuery);
    } catch (org.eclipse.persistence.exceptions.DatabaseException dbe) {
    dbe.printStackTrace();
    throw new DAOException(DAOExceptionMessageBuilder.buildMessage("object.find.exception"), dbe);
    } catch (java.lang.RuntimeException rte) {
    rte.printStackTrace();
    throw new DAOException(DAOExceptionMessageBuilder.buildMessage("object.find.exception"), rte);
    D: When I do the following:
         DataConstraintEntity entity = new DataConstraintEntity();
         entity.setParentTable("User");
         entity.setCrudMode("All");
    dao.queryByExample(entity);
    The log message shows the following:
    2009-11-20 20:43:11,671 INFO [STDOUT] (http-127.0.0.1-8080-1) Begin profile of{ReadAllQuery(referenceClass=DataConstraintEntity )
    2009-11-20 20:43:11,689 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Fine]: 2009-11-20 20:43:11.68--ServerSession(25760263)--Connection(32815217)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])
    --SELECT t0.ID, t0.DOMAIN_TYPE, t0.IS_LOCKOUT, t0.VERSION, t0.UPDATED_BY, t0.HITS, t0.CREATED_BY, t0.DESCRIPTION, t0.NAME, t0.DATE_LAST_UPDATED, t0.DATE_CREATED, t0.NOTES, t0.owner, t1.ID, t1.DATA_TYPE, t1.READ_ONLY, t1.ENABLED_ON_USER_ROLE, t1.RENDERED_ON_USER_ROLE, t1.CRUD_MODE, t1.PARENT_TABLE, t1.DATA_NAME FROM ODMS.DATA_PROFILE t0, ODMS.DATA_CONSTRAINT t1 WHERE ((((t0.DOMAIN_TYPE = ?) AND (t1.CRUD_MODE = ?)) AND (t1.PARENT_TABLE = ?)) AND ((t1.ID = t0.ID) AND (t0.DOMAIN_TYPE = ?)))
         bind => [DataProfile, All, User, DataConstraint]
    2009-11-20 20:43:12,412 INFO [STDOUT] (http-127.0.0.1-8080-1) Profile(ReadAllQuery,
         class=com.xoftsystems.odms.domain.bean.DataConstraintEntity,
         total time=736,
         local time=736,
         profiling time=1,
         connect=1,
         logging=10,
         query prepare=5,
         sql prepare=1,
         sql execute=716,
         sql generation=3,
    }End profile
    In "bind => [DataProfile, All, User, DataConstraint]", I don't know why Eclipselink is passing "DataProfile" as a value to the query or even why the two "(t0.DOMAIN_TYPE = ?)" in the statement. t0.DOMAIN_TYPE cannot be "t0.DOMAIN_TYPE = 'DataProfile'" and "t0.DOMAIN_TYPE = 'DataConstraint'". It should only be "t0.DOMAIN_TYPE = 'DataConstraint'".
    Testing the above Select statement directly on my database fails but succeeds when I remove the first "(t0.DOMAIN_TYPE = ?)" and run it.
    Questions:
    1. Could this be a bug in Eclipselink?
    2. How do I get rid of the first "(t0.DOMAIN_TYPE = ?)" in the Select statement?
    3. What am I doing wrong?
    Thanks in advance.

    Hello,
    First question should really be where is the "'DataProfile" DOMAIN_TYPE value coming from? I don't see a descriminatorValue annotation set with this value, so do you have it set through a mapping some where?
    Best Regards,
    Chris

  • How to insert variable value using select statement - Oracle function

    Hi,
    I have a function which inserts record on basis of some condition
    INSERT INTO Case
    Case_ID,
    Case_Status,
    Closure_Code,
    Closure_Date
    SELECT newCaseID,
    caseStatus,
    Closure_Code,
    Closure_Date,
    FROM Case
    WHERE Case_ID = caseID
    Now i want new casestatus value in place of select statement caseStatus value. I have a variable m_caseStatus and i want to use the value of this variable in above select statement.
    how can i use this.
    thanks

    Hi,
    I have a function which inserts record on basis of some condition
    INSERT INTO Case
    Case_ID,
    Case_Status,
    Closure_Code,
    Closure_Date
    SELECT newCaseID,
    caseStatus,
    Closure_Code,
    Closure_Date,
    FROM Case
    WHERE Case_ID = caseID
    Now i want new casestatus value in place of select statement caseStatus value. I have a variable m_caseStatus and i want to use the value of this variable in above select statement.
    how can i use this. Do not select Case_Status from inner select, so null will be inserted then after inserting it update the case status with m_caseStatus.
    Regards.

  • JDBC Sender Adapter, Update statement

    Hi ALL,
               I have a JDBC to proxy scenario. We have stored procedure in the database that executess and sends the data to SAP.
    Also the same store procedure updates the field Status_ID to distinguish between read and unread records. Status_ID acts as a Flag.
    Now because the Stored procedure itself does what 'Update SQL Statement' in sender JDBC adapter does, what shall I put in 'Update SQL Statement' as it is not needed, but it's a mandatory field??
    XIer
    Message was edited by:
            XIer

    Do you need that update in the sender jdbc adaptor to do anything....?
    Dint think so..
    Change your update statement to update Status_ID if its not updated..and if the sql procedure has run already then its not going to be updated ..as it already is.......
    Regards
    Ravi Raman

  • Case Statement in Select Statement - Oracle 8.0.6

    I am trying to do the following, but am getting error -
    "FROM keyword not found where expected"
    select s.item, s.dest, s.qty ,
    case when s.dest = 'x'
    then (sales - returns)
    else 0
    end
    from table1 s
    Is this an error or is it because of the version of Oracle?

    As I recall, CASe was not supported until 8.1. So, you need to use decode instead.
    SELECT s.item, s.dest, s.qty ,
           DECODE(s.dest,'x',s.sales - s.returns,0)
    from table1 sTTFN
    John

  • Select Statement-Oracle

    What is wrong with the query be;ow ? Dont work ...
    ======
    SELECT ctrData.FACILITY AS Facil,ctrData.CONTRACTNO AS
    CONTRACTNO,ctrData.CONTRACTDATE AS
    CONTRACTDATE,ctrData.CONTRACTTITLE AS
    CONTRACTTITLE,ctrData.DRWPROVIDEBY AS
    DRWPROVIDEBY,ctrData.TOTALNODRW AS TOTALNODRW,ctrData.COMMENTS AS
    COMMENTS,ctrDocs.DRWSTATUS AS DRWSTATUS,ctrDocs.DRWNO AS
    DRWNO,ctrDocs.SHEETNO AS SHEETNO,ctrDocs.CONTRACTNO AS
    DocCtrNo,ctrDocs.DRWTYPE AS DRWTYPE,ctrDocs.DISCIPLINE AS
    DISCIPLINE,ctrDocs.DRWTITLE AS DRWTITLE,ctrDocs.CONFCADDFILENAME AS
    ImageName,ctrDocs.DRWDATE AS DRWDATE ,ctrDocs.DOCID AS
    DOCID,ctrLoc.READONLYMEDIAPATH AS READONLYMEDIAPATH,
    ctrLoc.CONTRACTNO AS LocCtrNo
    FROM CONTRACTS ctrData,CONTRACT_DOCS
    ctrDocs,IMGS_LOCATION_FOLDER ctrLoc
    WHERE LOWER(ctrData.CONTRACTNO)=LOWER(ctrDocs.CONTRACTNO(+))
    AND LOWER(ctrData.CONTRACTNO)=LOWER(ctrLoc.CONTRACTNO(+))
    NOT IN (
    SELECT
    DECODE(INSTR('AW-06,AW-13',CONTRACTNO),0,CONTRACTNO,NULL)C FROM
    CONTRACTS )

    What is wrong with the query below? Don't work ...
    ======
    I'm sorry, etiquette lesson here, not an answer.
    How does it not work? Is it returning the wrong data? If so a
    description of what is desired and an example of what is
    being returned
    would be very helpful. Is it throwing some kind of error? If
    so please
    provide the error message. I'm I expected to have intimate
    knowledge of
    your data schema so that I can just look at all that and know
    what the
    heck it does? I can't run it for myself and see what it does,
    I am not
    on your system!
    Add to that, please format the output so that is is readable,
    whitespace
    please!!!! There very well may be a simple syntax error in
    all that,
    but I am afraid I do not have the time to dissect it to make
    sure every
    comma is correctly placed.
    Back to your regular forum reading.

  • JDBC provides wrong meta information (Oracle 8.1.7)

    Hi all
    When I get the meta information about the datatype 'date', the literal prefix and the literal suffix are delivered as 'null'.
    When I execute an insert statement such as: 'insert into TEST_TABLE (BIRTHDATE) values (31.01.2002)' I get the error: 'ORA-00917: missing comma'
    Now I change the statement to 'insert into TEST_TABLE (BIRTHDATE) values ('31.01.2002')' everything works fine.
    It seems that the meta information are not correct! Does anybody have a hint?
    Thanks
    Kind regards

    Just a guess...
    The Oracle comm processes (net8 or whatever it is called) allows for different protocols to communicate. Your server is set up for a different protocol than the old one was. Either the client or the server needs to adjust.
    You can test this by creating a TSN and using sqlplus to connect. Once it works open up the TSN file (*.ora?) and get the correct params from there.

  • Please send me select statement for the below query.....

    FOR i IN 1..9 LOOP
    IF shift(i) IS NULL THEN
    FOR y IN i+1..9 LOOP
    IF shift(y) IS NOT NULL THEN
    shift(i) := shift(y);
    shift(y) := NULL;
    EXIT;
    END IF;
    END LOOP;
    END IF;
    END LOOP;
    please how to write select query to replace loops in above code

    CREATE or REPLACE function MyFun(
    code_1 IN VARCHAR2,
    code_2 IN VARCHAR2,
    code_3 IN VARCHAR2
    )RETURN INTEGER IS
    out_param INTEGER:=0;
    TYPE t_cos IS TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER;
    shift t_cos;
    i NUMBER;
    y NUMBER;
    BEGIN
    shift(1) := TRIM(code_1);
    shift(2) := TRIM(code_2);
    shift(3) := TRIM(code_3);
    FOR i IN 1..3 LOOP
    IF shift(i) IS NULL THEN
    FOR y IN i+1..3 LOOP
    IF shift(y) IS NOT NULL THEN
    shift(i) := shift(y);
    shift(y) := NULL;
    EXIT;
    END IF;
    END LOOP;
    END IF;
    END LOOP;
    For i IN 1..3 Loop
    IF substr(shift(i),1,1) = 'E' THEN
    out_param := shift(i);
    EXIT;
    ELSE
    out_param := NULL;
    END IF;
    END LOOP;
    out_param := 1;
    RETURN (out_param);
    END;
    For Ex we have 100 recors this loops i.e For loops executes more than 100 times we need to avoid this thing and replace for loop's and write select stmt on this.
    Edited by: 867554 on Jun 22, 2011 6:31 AM

  • JDBC sender adapter - driver problems

    Hi.
    Iu2019m struggling with a little problem regarding the JDBC sender adapter, querying an Oracle database.
    Iu2019m making a simple SELECT statement, where one of the fields is of the typeu201DTIMESTAMP(0) WITH LOCAL TIMEu201D.
    Making the query in a SQL client works just fine, but in the JDBC sender adapter, it generates this error u201DError during conversion of query result to XML: java.sql.SQLException: Session Time Zone not set!u201D
    Iu2019ve searched for answers on numerous forums, and found one place, where the following where the solution:
    >>> Hi. The issue is that the driver itself needs to have a time zone
    >>> set. You have to call setSessionTimeZone() on the connection object.
    Unfortunately it is a bit hard to call this function in the adapter.
    Any of you guys have an idea what to do?
    I can add, that making a query, where no date fields are selected, works fine in the adapter.
    Regards...
    Peter

    Problem solved...
    Put a conversion (CONCAT, SUBSTR, TO_CHAR, etc.) around the date field you are about to fetch, and it works just fine.

  • Stored Procedure call from JDBC sender for Oracle Database

    Hi,
    I have a requirement to call stored procedure using JDBC sender adapter for retriving data from an Oracle database.
    I need to execute first stored procedure call from Querry SQL statement and then trigger second stored procedure call for confirming the succesful retrival of those records from the update SQL statement.
    Querries:
    1. Can we trigger stored procedure from Update statement of JDBC sender.
    2. Can we call stored procedure from Querry statement, since I have read on other sdn threads that stored procedure calls on Oracle database are not allowed. If not possible to have "Execute stored procedure" would the function call (select * from table(function name)) work same as stored procedure.
    3. In a JDBC sender the Querry statement and Update statement are executed in same session call and same database connection. What happens if the querry statement was not succesful, would the update be still triggered.
    Please note PI does not have direct access to main table and hence the need to have separate stored procedure calls.
    The PI version is PI 7.11 sp4.
    Appreciate your inputs.
    Thanks.
    Siddhesh S.Tawate

    >1. Can we trigger stored procedure from Update statement of JDBC sender.
    I think not possible using update statement.
    > Can we call stored procedure from Querry statement, since I have read on other sdn threads that stored procedure calls on Oracle database are not allowed. If not possible to have "Execute stored procedure" would the function call (select * from table(function name)) work same as stored procedure.
    Yes using select query you can call stored procedure.
    >. In a JDBC sender the Querry statement and Update statement are executed in same session call and same database connection. What happens if the querry statement was not succesful, would the update be still triggered.
    No select and update handles in the same session using the same thread so if one transaction fails update should not proceed.

  • JDBC Sender - Different number of records selected and updated.

    Hi people,
    We have a JDBC -> Abap proxy scenario. The JDBC sender is pooling an Oracle database to retrieve data from a table X, each 30 minutes. The select and update statements in jdbc sender are below
    SELECT FIELD1, FIELD2, FIELD3 FROM MY_TABLE WHERE STATUS = 1
    UPDATE MY_TABLE SET STATUS = 2 WHERE STATUS = 1
    Sometimes the message sent to Abap proxy has, for example, 400 records. Looking at runtime workbench, message monitoring, for the same message there is a log like this
    Channel SENDER_JDBC_CHANNEL: Query executed successfully. Start update
    Channel SENDER_JDBC_CHANNEL: 510 row(s) updated successfully
    Someone has already experienced something like this? How can I handle this to guarantee to update only those read records?
    regards.
    roberti

    Hi All,
    Even we are facing the same problem.
    In our scenario, receiver is SAPR3. (IDOC)
    Will this parameter serialization work in our case?
    1. SELECT XBLNR, WERKS, MATNR, MDV01, BACKFLQUANT, STATUS, SAPTIMESTAMP, PITSTIMESTAMP, PMTIMESTAMP, BATCH FROM PMBPITS.PITS_UNITY WHERE STATUS = '01' and rownum<200 . 
    2. UPDATE PMBPITS.PITS_UNITY SET STATUS = '02' , SAPTIMESTAMP = sysdate WHERE STATUS = '01' and rownum<200  ( currently the value is rownum < 5 )
    Thanks!!
    Regards
    Gouri

Maybe you are looking for

  • How do you know your wireless is secure?

    I want to know how you know your internet is secure so no one in your neighbor hood can steal or hack my internet service. A few people in our house use a mix between ethernet cable and wireless. I don't use the wireless so i don't know how you set i

  • Phantom of the Ethernet

    My wife has been using our PowerBook G4, running 10.3.9 Out of the blue, she can only connect to our home LAN using the built-in Airport. When I check the Network Status, the Built-In Ethernet is completely gone from the Network Status list, even tho

  • X300: External Monitors and port replicator

    The X300 looks really good, but when not traveling I'd be using it with a 24" 1920x1200 monitor. A couple questions I can't see to find answers for: 1)  Is the X300 capable of driving that resolution for an external monitor? 2)  Assuming a good answe

  • 8.0.2 Searching for Signal

    I have an iPhone 5c and at random times keeps saying "Searching". It's the most aggravating thing! I followed all the steps on one forum(Airplane mode and restarting my phone, resetting network settings, taking my sim card out, Restoring phone, setti

  • Two WLC over the same SUBNET - selection from AP for determinate WLC

    Hi I have the next problem, my company have two WLC (WISM1 - IOS 7.0 and WLC2504 - IOS 7.4), and we have 4 types of APs (1131, 1242, 1040 and 1600), well the WISM 1 manages the old APs 1131, 1040 and 1242, the 2504 manages the 1600, this because the