Current DateTime in Database polling 'WHERE Clause'

Hi,
I am trying to explore the usage of polling option with Database adapter in SOA Suite 11g.
I am doing a sample process which will poll the data from a database table which has 2 fields, one is ID and the other one is UpdatedDate which is of type TIMESTAMP. I am trying to delete the records after polling, whose UpdatedDate is less than the current date. I am using the where clause in polling option to set the condition of UpdatedDate < CurrentDate.
The problem is I am not getting, how to get the current date in the right side of the expression. To provide the right side option, we have 3 options of Literal, Query and parameter. I have tried will all the options; when I am trying with Literal, the right side is updated with Null value.
Could any one help me to resolve this issue. I need the value of current dateTime as the right side expression of the where clause.
Thanks.

Hi,
You're maybe over complicating this... The DbAdapter should be able to delete processed records automatically for you since you use one of the defined polling strategies...
http://docs.oracle.com/cd/E28280_01/integration.1111/e10231/adptr_db.htm#CHDEFACG
Cheers,
Vlad

Similar Messages

  • Where Clause - Modification via SDK

    Good morning,
    We are currently experiencing quite a large performance impact as our record selection formulas, and parameters are not hitting our database (in where clause) and therefore a large amount of data is being pulled back and then filtered out at the report level. Was hoping someone might be able to provide some information on how we could either dynamically append to the where clause via sdk, or devise optional workaround to make sure our selected parameters are passed to the db.
    Environment
    Solaris, with custom User Interface that passes information to crystal reports via SDK. Crystal Reports (2008) with Universe as datasource.
    Thanks,
    Ian S

    Good morning,
    We are currently experiencing quite a large performance impact as our record selection formulas, and parameters are not hitting our database (in where clause) and therefore a large amount of data is being pulled back and then filtered out at the report level. Was hoping someone might be able to provide some information on how we could either dynamically append to the where clause via sdk, or devise optional workaround to make sure our selected parameters are passed to the db.
    Environment
    Solaris, with custom User Interface that passes information to crystal reports via SDK. Crystal Reports (2008) with Universe as datasource.
    Thanks,
    Ian S

  • WHERE clause doesn't work in certain column

    Hi All,
    I try to filter mysql database using WHERE clause...everything seem working until i found there are 3 column that i can't use for WHERE clause query. When i use that columns to filter, there's no data appear in the table but the other column is working. Attached is my VI and mysql database. I really don't know what cause it happen. Any help would be very appreciated
    Thank you
    Attachments:
    filter.vi ‏17 KB
    db.txt ‏3 KB

    Have you tried the select from whatever SQL command interpreter that MySQL provides?
    It needs to be in the form SELECT * FROM issue WHERE 'condition'. If you want to get all the rows where person 1 is Harry then you would write
    SELECT * FROM issue WHERE person1 = 'Harry'
    The way your VI is written you will get one of two commands.
    SELECT * FROM issue WHERE 'All' or SELECT * FROM issue WHERE 'WIWI'
    That may return all rows if a string resolves to true. I don't use MySQL so I wouldn't know.
    Disregarding LabVIEW for a moment, what is the SQL command or commands that you want your VI to send to the ADO execute VI? That might help figure out what it is you want to do.
    =====================
    LabVIEW 2012

  • Teradata Source SQL Server where clause In SSIS

    Hi All,,
    I want pull the data from Teradata to SQLServer .But Teradata source query in where clause around 200 productcodes manually. Instead of that one I want pass sqlserver table dynamically . creating  one temp table in ssis for sqlserver data and  
    Teradata source query joining the temp table (with out where clause) Is it possible to implement this task in SSIS or
    Best method to implement this task in ssis
    Thanks
    CMK...

    Hi CMK,
    You can create a staging table to store the productcodes used in the WHERE clause in the Teradata source query. Then, you can use Lookup Transformation in SSIS to achieve your goal.
    If you use Enterprise or Developer Edition of SSIS 2008 or higher, you can install the Microsoft Connector Version for Teradata by Attunity to obtain the OLE DB provider for Teradata. You can use an OLE DB Source adapter to extract data from the Teradata
    database without WHERE clause, then add a Lookup Transformation which lookups records from the staging table, and output the lookup match records to the destination SQL Server table.
    Reference:
    https://www.simple-talk.com/sql/ssis/implementing-lookup-logic-in-sql-server-integration-services/
    Regards,
    Mike Yin
    TechNet Community Support

  • Where clause for polling database Adapter

    I am creating a database adapter that polls a table for documents that are more than a month old based on a last updated field. For My where clause in the select statement I would like to have something like:
    where last_updated_date < add_months(sysdate, -1)
    but the where clause wizard will only allow me to use field names or literals. Any suggestions?

    Hi Stephen,
    Have you explored the option of calling a Stored Procedure or function which will do the SQL query as specified by you?
    Regards,
    lakshmi

  • Urgent: "where" clause for polling database Adapter

    Hi
    I am creating a database Polling (logical delete OPEN to CLOSED) adapter that polls a table for records which have a "SCHEDULED" date field.
    The Polling Adapter should pick up those records where the status is OPEN and SCHEDULED<=SYSDATE.
    DB Adapter wizard does not allows this where clause(SCHEDULED<=SYSDATE) to be set; so i tried modifying the Toplink SQL with custom SQL. But it does not works. Please suggest a workaround.
    Please help.
    Thanks
    Debashis

    Hi
    Please refer ..\SOA_HOME\bpel\samples\tutorials\122.DBAdapter\advanced\polling\PollingPureSQLOtherTableInsert Readme.txt and Note 873991.1 How To Use Custom SQL To Poll Database Tables Via Database Adapter LogicalDeletePollingStrategy.
    This works.
    thanks
    --debashis                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Dynamic where clause in database adapter

    Hi
    I have requirement to develop SOA service for search page! The back-end query for search is required to have where clauses to be appended to SELECT statement dynamically depending upon search criteria the user selects!
    E.g. if user is searching employee from a portal! If employee selects mobile number of the employee, or joining date range or other criteria, then accordingly appropriate clauses are to be appended to SEARCH SELECT statement.
    Can we achieve same while implementing executing database query through database adapter from BPEL service?
    Thanks In Advance
    Priyadarshi 

    It is difficult using the standard database adapter approach. You may have to use nested sql queries.Following is a good example of the same.
    Neeraj Sehgal - Experimenting with SOA: Pass multiple parameters, dynamic query in Pure SQL in Database Adapter
    If your only problem in using this that you are hard coding the connection details  , you can use the datasource jndi name in the query. hence you will not be required to change your code when moving from one env to other env. You just have to take care of keeping the jndi name same in all the env.

  • Conditional where clauses in database adapter

    I am trying to write a query in a database adapter that allows for conditional where clauses. Specifically, I want to include or not include a where clause (and clause) if an input variable is empty or not. Can a prepared statement with lexical parameters be used in a database adapter? Or is there another way to do this?
    Thanks in advance.

    I am afraid that you can only bind parameters to the SQL, you can't bind the SQL itself to the SQL. We do have QueryByExample support, where based on what fields are set in an example object, it will construct a different SQL select.
    If you pass in
    <Address>
    <street/>
    <city>
    <state>CA</state>
    </Address>
    it will return all addresses in California. If you pass in:
    <Address>
    <street/>
    <city>Los Angeles</city>
    <state/>
    </Address>
    it will return all addresses in Los Angeles.
    Thanks
    Steve

  • Dynamic where clause in Database Adapter, or workaround?

    Hello friends,
    Is there any way to change where clause in Database Adapter (DA) dynamically.
    For e.g. i do have Database Adapter with sql statement: select col1,col2 from my_table. Originally i have many parameters which are not mandatory so instead of creating where clause in DA like:
    select col1, col2 from my_table where+
    *((#p_col_1 is not null and #p_col_1=col1) or #p_col_1 is null)*
    and ...
    and  ((#p_col_n is not null and #p_col_n=col_n) or #p_col_n is null)
    i would like to create a where clause dynamically depend on what parameters are not empty or receive where clause as parameter. Is it possible? Are there any others workarounds you can suggest?
    will appreciate any thoughts...

    Thanks Deepa for the links, their where quite helpful. And i must admit this partially answers my question (at least example i provided).
    However - how about if i'd like to use LIKE clauses instead of =, or IN or NOT IN? e.g:
    select col1, col2 from my_table where+
    ((#p_col_1 is not null and #p_col_1 LIKE col1) or #p_col_1 is null)
    and ...
    and ((#p_col_n is not null and col_n IN #p_col_n) or #p_col_n is null)
    Is it possible?
    thanks in advance

  • ORA-02020: too many database links in use ; but OK with where clause...

    Hello all,
    I have a view called V_MEDGEN_LISTRADIO but I can't run
    SELECT * FROM V_MEDGEN_LISTRADIO
    ORA-02020: too many database links in useThe cause is that we call in the view 5 tables over dblink and the open_links parameter is set to 4.
    What is strange is that when I run this select by adding a where clause then it works!
    SELECT * FROM V_MEDGEN_LISTRADIO WHERE SPRR = 3645;Can someone explain me ? (use of index so all tables are not called ???)
    Thanks

    Explain plan for SELECT * FROM V_MEDGEN_LISTRADIO WHERE SPRR = 3645;
    | Id  | Operation                              | Name            | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop | Inst   |IN-OUT|
    |   0 | SELECT STATEMENT                       |                 |     1 |   244 |    19   (6)| 00:00:01 |       |       |        |      |
    |   1 |  SORT ORDER BY                         |                 |     1 |   244 |    19   (6)| 00:00:01 |       |       |        |      |
    |   2 |   NESTED LOOPS                         |                 |     1 |   244 |    18   (0)| 00:00:01 |       |       |        |      |
    |   3 |    NESTED LOOPS                        |                 |     1 |   218 |    17   (0)| 00:00:01 |       |       |        |      |
    |   4 |     NESTED LOOPS                       |                 |     1 |   188 |    15   (0)| 00:00:01 |       |       |        |      |
    |   5 |      NESTED LOOPS                      |                 |     3 |   384 |    10   (0)| 00:00:01 |       |       |        |      |
    |   6 |       NESTED LOOPS                     |                 |     3 |   186 |     4   (0)| 00:00:01 |       |       |        |      |
    |   7 |        REMOTE                          | SPRR            |     1 |    20 |     2   (0)| 00:00:01 |       |       | DEV10~ | R->S |
    |   8 |        REMOTE                          | MPAT_MF         |     3 |   126 |     2   (0)| 00:00:01 |       |       | DEV10~ | R->S |
    |   9 |       REMOTE                           | SPER_P          |     1 |    66 |     2   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |* 10 |      TABLE ACCESS BY GLOBAL INDEX ROWID| DOSSIER_MEDICAL |     1 |    60 |     3   (0)| 00:00:01 | ROWID | ROWID |        |      |
    |* 11 |       INDEX RANGE SCAN                 | DOSMED_MPR_IDX2 |     2 |       |     1   (0)| 00:00:01 |       |       |        |      |
    |  12 |     REMOTE                             | MEP             |     1 |    30 |     2   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |  13 |    REMOTE                              | SSV             |     1 |    26 |     1   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    Predicate Information (identified by operation id):
      10 - filter("DM"."EXAM_TYPE"='TELEM')
      11 - access("DM"."MPR"="P"."SPER")
    Remote SQL Information (identified by operation id):
       7 - SELECT "SPRR","MNEMO" FROM "SPRR" "MP" WHERE "SPRR"=3645 (accessing 'DEV10_DBLK' )
       8 - SELECT "SPAT","DU","RMPB","SPRR_MF","AU" FROM "MPAT_MF" "MF" WHERE "SPRR_MF"=3645 AND NVL("AU",:1+1)>=:2 AND
           "RMPB"='PRINC' AND "DU"<=:3 (accessing 'DEV10_DBLK' )
       9 - SELECT "SPER","NOM","PRENOM","DTE_NAI" FROM "SPER_P" "P" WHERE "SPER"=:1 (accessing 'ORAP_DBLK' )
      12 - SELECT "MSJ","MEPNO_SEQ","SSV_OU_PAT_SEJOURNE" FROM "MEP" "MEP" WHERE :1="MSJ" AND :2="MEPNO_SEQ" (accessing 'ORAP_DBLK' )
      13 - SELECT "SSV","LIB_1" FROM "SSV" "SSV" WHERE :1="SSV" (accessing 'ORAP_DBLK' )Explain plan for SELECT * FROM V_MEDGEN_LISTRADIO
    Plan hash value: 3820716840
    | Id  | Operation                                | Name                  | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop | Inst   |IN-OUT|
    |   0 | SELECT STATEMENT                         |                       |     7 |  1708 |   771   (1)| 00:00:10 |       |       |        |      |
    |   1 |  SORT ORDER BY                           |                       |     7 |  1708 |   771   (1)| 00:00:10 |       |       |        |      |
    |   2 |   NESTED LOOPS                           |                       |     7 |  1708 |   770   (1)| 00:00:10 |       |       |        |      |
    |   3 |    NESTED LOOPS                          |                       |     7 |  1568 |   763   (1)| 00:00:10 |       |       |        |      |
    |   4 |     NESTED LOOPS                         |                       |     7 |  1386 |   756   (1)| 00:00:10 |       |       |        |      |
    |   5 |      NESTED LOOPS                        |                       |     7 |  1176 |   742   (1)| 00:00:09 |       |       |        |      |
    |   6 |       NESTED LOOPS                       |                       |   194 | 24444 |   414   (1)| 00:00:05 |       |       |        |      |
    |   7 |        TABLE ACCESS BY GLOBAL INDEX ROWID| DOSSIER_MEDICAL       |   194 | 11640 |    23   (0)| 00:00:01 | ROWID | ROWID |        |      |
    |*  8 |         INDEX RANGE SCAN                 | DOSMED_EXAM_TYPE_IDX2 |   194 |       |     1   (0)| 00:00:01 |       |       |        |      |
    |   9 |        REMOTE                            | SPER_P                |     1 |    66 |     2   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |  10 |       REMOTE                             | MPAT_MF               |     1 |    42 |     2   (0)| 00:00:01 |       |       | DEV10~ | R->S |
    |  11 |      REMOTE                              | MEP                   |     1 |    30 |     2   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |  12 |     REMOTE                               | SSV                   |     1 |    26 |     1   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |  13 |    REMOTE                                | SPRR                  |     1 |    20 |     1   (0)| 00:00:01 |       |       | DEV10~ | R->S |
    Predicate Information (identified by operation id):
       8 - access("DM"."EXAM_TYPE"='TELEM')
    Remote SQL Information (identified by operation id):
       9 - SELECT "SPER","NOM","PRENOM","DTE_NAI" FROM "SPER_P" "P" WHERE :1="SPER" (accessing 'ORAP_DBLK' )
      10 - SELECT "SPAT","DU","RMPB","SPRR_MF","AU" FROM "MPAT_MF" "MF" WHERE NVL("AU",:1+1)>=:2 AND "RMPB"='PRINC' AND "DU"<=:3 AND
            :4="SPAT" (accessing 'DEV10_DBLK' )
      11 - SELECT "MSJ","MEPNO_SEQ","SSV_OU_PAT_SEJOURNE" FROM "MEP" "MEP" WHERE :1="MSJ" AND :2="MEPNO_SEQ" (accessing 'ORAP_DBLK' )
      12 - SELECT "SSV","LIB_1" FROM "SSV" "SSV" WHERE :1="SSV" (accessing 'ORAP_DBLK' )
      13 - SELECT "SPRR","MNEMO" FROM "SPRR" "MP" WHERE :1="SPRR" (accessing 'DEV10_DBLK' )

  • Delete from remote location with where clause between the two databases

    I want to delete records from a source database using dblink. The criteria for the delete is a where clause, that
    looks for the values between a table at source and the remote location. I get an invalid sql statement error.
    When i do a count(*) instead of a delete, I get rows returned.
    Can anyone see an the problem here ? I've tried qualifying the delete
    delete from tabl1@remote a, tabl1_temp b where (a."id" =b."id") and (a."title" = b."title) and (a."key" = b."key");
    the error I get is ORA 00933 SQL command not properly ended....
    The * is between the 2 ands ...
    Edited by: sgonos on Nov 6, 2009 6:46 AM
    Sorry the * moved when I save it ...
    delete from tabl1@remote a, tabl1_temp b where (a."id" =b."id") and (a."title" = b."title) and (a."key" = b."key");
    it's flagging the middle and ... a.title = b.title ... seems to like key ....
    Edited by: sgonos on Nov 6, 2009 6:51 AM

    You have 2 tables specified in the delete clause of your statement.
    It should maybe be something like:
    delete from tabl1@remote a
    where exists (select 'x' from tabl1_temp b where (a."id" =b."id") and (a."title" = b."title) and (a."key" = b."key"));
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Database Adapter - Dynamic where clause

    The database adapter needs to support a search facility.
    The user can search by any one of the following
    1) Date Range
    2) Primary Keys
    3) user who created
    Based on the above options, a query needs to be dynamically created in Database adapter
    Date Range
    select column1, column2 from emp where createddate  > ... and  createddate < ....
    Primary Key
    select column1, column2 from emp where empid in (1,2,3)
    * user who created*
    select column1, column2 from emp where userid= 456
    The conditions after the where clause vary dynamically.
    The pure sql option does not seem to support something like
    select column1, column2 from emp #whereclause
    Is there a way to do this in the Database Adapter?
    Edited by: user11920125 on Jan 14, 2010 11:57 AM

    If you are using SOA Suite 11g you can use query by example option to achieve part of that.
    It support only equality check but on dynamic number of fields
    Adam

  • OVD database adapter and WHERE clause

    Hi all,
    We're using OVD 11g, and have a database adapter defined against a table in an Oracle schema. The adapter correctly maps columns to LDAP attributes and creates a virtual directory.
    However the table contains users we don't want to appear in the directory. We have no control over the data in the table hence we cannot remove the unwanted users from the source.
    Is there any way we can specify a WHERE clause in the database adapter which limits the users pulled out of the table and created in the virtual directory? Something like WHERE organisation = 'Company A'.
    Thanks
    Alan

    You can specify LDAP filters in Routing Include/Exclude in Adapter configuration which will eventually translate into where clause for the database adapter.
    For example if you want to exclude users from organization A all you have to do is Add an LDAP filter for that organization in Routing Exclude...
    Same is the case for Routing Include.
    Hope this helps,
    Saggu

  • Passing check box values to WHERE clause

    Hi,
    I have created a Data block - 'CONTACTS' (Database data block)
    and has database item - 'Code', 'Descr'
    The number of records displayed is set to 5.
    Value When checked - 'Y'
    Value When Unchecked - 'N'
    Check box mapping of other values - 'unchecked'
    I am writing the code inside 'WHEN BUTTON PRESSED'. My main objective is to return the count of records based
    based on several conditions and one among them is CODE which is can be single or multiple based on the check box checked.
    The requirement is when i check one or multiple checkboxes, i should pass the 'Code' item values to the WHERE clause.
    Right now whenver i am trying to do so, only the current record value is copied to the WHERE clause.
    I have tried using basic loop but things havnt worked.
    Logic tried with basic LOOP
    BEGIN
    GO_BLOCK('CONTACT');
    IF :contact.cb = 'Y' THEN
    LOOP
    IF p_where is null then
    p_where := :contact.code;
    else
    p_where := p_where ||','||:contact.code;
    end if;
    exit when :system.last_record = 'TRUE';
    next_record;
    END LOOP;
    end if;
    MESSAGE ( 'p_where :'||p_where);
    MESSAGE (' ');
    END;
    And Even if i write the LOOP before the first IF, it return me the current record value and move to the last record.
    please guide me where am i wrong.
    Regards.
    Anoop.

    Try something like this:
    FIRST_RECORD;
    LOOP
      IF :contact.cb = 'Y' THEN
        IF p_where is null then
           p_where := :contact.code;
         else
           p_where := p_where ||','||:contact.code;
         end if;
       END IF;
      exit when :system.last_record = 'TRUE';
      next_record;
    END LOOP;
    -- END LOOP;
    MESSAGE ( 'p_where :'||p_where);
    MESSAGE (' ');
    END;

  • How can i work with getdate() in my query if i have a varchar datatype on where clause column ?

    Hi All,
    I have a column like lastdate with varchar datatype. now I want to work with lastdate column in where clause with getdate().
    Ex:  where
    getdate()  -  lastdate < 1
    when I use above one I got error like
    Error = Conversion failed when converting date and/or
    time from character string.
    I knew the datatypes for lastdate and getdate() are different...
    how can I use...
    Thanks,
    rup

    You need to convert the string date to datetime or date. See conversion examples here:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Example for the where clause:
    WHERE DATEDIFF(DD, convert(datetime, lastdate, 101), getdate() ) < 1
    Can you post sample string dates?
    Are you looking for today's records? Another option (depends on lastdate format):
    WHERE lastdate = convert(char(8), getdate(), 112)
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Maybe you are looking for

  • Loading of classes causing 1st time to be slow...

    Well, at least I think this is why. Here is my story: When the user clicks on a menu item, a dialog pops up. On this dialog, I have a JTree that has a TreeWillExpandListener hooked up to it. When the user clicks the JTree to expand the root node, a d

  • ASA 5510 8.4(2) and IPS SSM-20 7.0(6) E4

    Hi, I'm thinking the ASA 5510, ver. 8.4(2) with IPS SSM-20 ver. 7.0(6) E4  falls into IPS unresponsive state. Now I'm testing the ASA 5510 ver. 8.4(2) with IPS SSM-20 ver. 7.0(4) E4, to verify if the system falls into the same condition. Any experien

  • HT202159 "An error has occurred". I followed the procedures for restarting OS X 8.0 download but the "pause/download"  button was dead.  What next?

    The procedures for restarting Mountain Lions downlown do not seem to apply in my ssituation. Before today's impass I had failed twice to download then was able to start all over again from the beginning.  The system knew that I had purchased the prog

  • Insert new tags after root element

    Hi, I'm trying to insert new tags immediately after the root element in a DOM tree. The data to be inserted is being passed to the program as a string parameter. I've used Dom4J to add the data as a new element immediatelty after the root. Problem is

  • Adobe Encore Blu-Ray audio out of sync

    Hey, So I'm trying to make a compiliation Blu-ray disc that has 3 seperate movies on it.  Each method I've tried as resulted in the audio being out of sync with the video. I used dvd shrink to rip a dvd to include just the movie by itself.  I played