Custom query conditions in db adapter

Hello,
How to execute custom query in bpel db adapter?
For example :
1. select * from employee where status = 'N' and address is not null
2. select * from empoyee where substatus = 'Y' and phone is null
after where keyword - query part is dynamic, parameter combinations and count is unlimited ( depends on business logic ). It is not possible to implement each condition parameter as parameter in db adapter configuration.
Db adatper query has to be something like  : select * from employee where #condition# , but #condtion# need to be interpretated as condition not string with quotes..
best Regards,
Uldis

Say your complete query looks like this -
select SUBJECT_NAME from RELATION
            where PID_GID_SSID IN (select PARTY_KEY from  xref WHERE row_id='123')
1). In assign activity, write out the query part which comes after where clause and assign to variable query
(select PARTY_KEY from  xref WHERE row_id='123') , replace the value of row_id from input value in assign.
2. Now open DB adapter and pass the rest of query as input -
select SUBJECT_NAME from RELATION
            where PID_GID_SSID IN #query

Similar Messages

  • Can I use custom query in DB Adapter with Polling

    Hi All,
    I am getting problem while using db adapter with polling. Can I use custom query in db adapter with polling.
    I am using 2 tables; table 1 and table2
    Structure of table1 is as:
    File_name
    Batch_id
    Creation_date
    Status
    Structure of table2 is as:
    Batch_id
    Employee_ID
    Last_Name
    First_Name
    Middle_Name
    Group_ID
    Site_ID
    Dept_Num
    Report_id
    I have to use below query while polling to table1
    Select count(*) as NOSEXP, Report_id
    from table1, table2
    where table2.batch_id =
    table2.batch_id
    and table1.Status= 0
    group by Report_id;
    I mean, when I use DB adapter to poll table1, I have to use above query.
    Can you Please suggest on this.
    Thanks in advance.

    I will check for existance not based on Primary key but based on three other fields in the table. I think , by default DB adapter configured for MERGE checks for existance based on PK. Can we change the Primary Key in the mapping file after the DB adapter is configured. In that case , will it check for existance based on the fields , I mention.
    Edited by: user12020809 on Sep 16, 2012 6:08 PM

  • Complex SQL Query in BPEL DB Adapter

    Hi,
    Is it possbile to write a complex query in BPEL DB Adapter using "Custom SQL Query"?
    I would like to write an IF ELSE condition in the DB Adapter similar what is given below..
    IF((SELECT COUNT(*) FROM F5898001 WHERE CT58SRCNME = 'CA_TEST' AND CTJOBNAME = '12345' AND CTEDBT = 'EDBT' AND CTEDSP = 'B') < 1)
    BEGIN
    insert into f5898001 (CTJOBNAME,CTEDSP,CTEDBT,CT58SRCNME) VALUES (#jobname, #edsp, #edbt, #srcnme)
    END.

    In a single pass no.
    You could use a DB link to perform select and return result to BPEL process variable. Put a switch decision depending on result in variable that calls a DB Adapter to perform the insert.
    Wouldn't be in a single transaction and not very elegant, but might be a way round.

  • Query Rules - length limitation on query conditions set via powershell

    My current client has 200 custom keywords in SP 2010 which they would like to migrate to SP 2013 query results.  I have powershell scripts to perform the export from SP 2010 and import into one of three SP 2013 environments.
    One limitation I have found in powershell -- that does not happen in the search service application UI! -- is a 100 character length limit on the keywords used for matching query conditions (synonym data in SP 2010).   The keywords can be set through
    the UI without limitation but are limited to 100 characters when using powershell!  It makes no sense!
    I suppose my final update could be done by hand (ugh!) and I would much rather be able to script these updates.  
    Any pointers or help?

    Hi grobinson,
    If you used this code line in your Powershell and have the following error:
    [string[]]$QueryRuleTerms=@($QueryRuleConditionTerm)
    Exception calling "CreateKeywordCondition" with "2" argument(s): "The value must be at most 100 characters long.
    Parameter name: Term"
    At line:2 char:1
    + $QueryRuleCondition = $QueryRuleConditions.CreateKeywordCondition($QueryRuleTerm ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentOutOfRangeException
    You need to use the following code line with Split() method to add the multiple terms, it will work.
    $QueryRuleConditionTerm = "a1;a10;a100;a101;a102;a103;a104;a105;a106;a11;a12;a13;a14;a15;a16;a17;a18;a19;a2;a20;a21;a22;a23;a24;a25;a26;a27;a28;a29;a3;a30;a31;a32;a33;a34;a35;a36;a37;a38;a39;a4;a40;a41;a42;a43;a44;a45;a46;a47;a48;a49;a5;a50;a51;a52;a53;a54;a55;a56;a57;a58;a59;a6;a60;a61;a62;a63;a64;a65;a66;a67;a68;a69;a7;a70;a71;a72;a73;a74;a75;a76;a77;a78;a79;a8;a80;a81;a82;a83;a84;a85;a86;a87;a88;a89;a9;a90;a91;a92;a93;a94;a95;a96;a97;a98;a99;a991"
    #use the following codeline, it worked for me
    [string[]] $QueryRuleTerms = $QueryRuleConditionTerm.Split(";")
    $QueryRuleConditions = $QueryRule.QueryConditions
    $QueryRuleCondition = $QueryRuleConditions.CreateKeywordCondition($QueryRuleTerms,$true)
    $QuerySourceContextCondition = $QueryRule.CreateSourceContextCondition($ResultSource)
    $QueryRule.Update()
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Daniel Yang
    TechNet Community Support

  • Fetch current Quarter and pass it to custom query

    Hi
    I need to pass the current date and find the quarter in which the date falls.
    The start and end date of the quarter need to be passed as a query parameter, in a custom query in UI designer.
    My query is as follows
    As shown in above screenshot,I have close_dt_upd(datatype Date).This field should have end date of the quarter as a condition.
    Similarly I will have a field start_date which should have Start date of the quarter as condition.
    I got the following table in 1402 documentation.
    But the above transformation rule is not visible in  the query.
    Can anyone tell which namespace to use?
    How can I retrieve the current quarter start and end dates, and then pass them  to the above query?
    Thanks,
    Vijaya Chavan

    Hi,
    the most easiest and straight forward approach is
    - Ckick the "Binding" tab at the bottom of the Visual Editor
    - In the Bindings section click teh green plus icon and choose Generic Bindings | Attribute Value
    - point the iterator selection to the iterator used by the table
    - choose the column's attribute name from the list of attributes
    - Create a method on the ApplicatioNModule IMPL class (should take single argument)
    - expose it as a client interfaces so it shows in the Data Controls panel
    - In the "Binding" tab, create a method binding for this exposed method
    - point the method binding argument to #{bindings.column-attribute-name.inptValue}
    So whenever you need to pass the value on to the AM, you just call the method binding
    OperationBinding oper = (OperationBinding) bindings.get("name of method");
    oper.execute();
    Frank

  • Max customized query length

    Hi all,
    anyone knows if it's possible to extend the maximum length (it seems to be 210 chars) of the data-block mask for customized query? I mean that mask Forms displays when, in enter-query mode, you use '&' to insert particular query conditions.
    Thanks,
    Marco

    I'm not sure.
    But one option is to build this mechanism on your own. Just popup a window to get the where clause and then use set_block_property(default_where) to attach it to the block.

  • Schedule Export Processes with Custom Query

    Hi,
    Can I use Schedule Export Processes, with a custom query over HZ_PARTIES and HZ_LOCATIONS, in order to export suppliers data in a specific field order with join conditions?
    I used Schedule Export Processes with "PARTY", selecting proper fields, but exported csv is in a different field order than the required by an external system.
    Thanks,
    Erick.

    Can you elaborate on the issue here. Are you looking for a way to run "ad-hoc" SQL queries for the filters ? I do not think that is possible, depending on your environment you may be able to create a custom view object to match your requirements.
    As for the orders I think you should be able to control the order using the sequence as the FAQs state:
    What happens if I change the sequence number or header text?
    Changing the sequence number changes the order of the attributes in the exported data file. Changing the header text enables you to give a more intuitive meaning to the attribute and the associated data.
    Jani Rautiainen
    Fusion Applications Developer Relations
    https://blogs.oracle.com/fadevrel/

  • Data is not populated in List based on custom Query

    Hi
    I want to query the BO and display only certain instances in a advanced ListPane based on a query condition. But when i bind the custom query to the advanced list pane no data is displayed.
    1. Created a Bo PersistForcastBo.
    2. In Ti screen of PersistForcastBo add a tab QUALIFICATIONS.
    3. Two Advanced List Panes are created in QUALIFICATIONS tab
    4.fields of second advancedlist pane are bound to respective fields of Bo.
    5.Also an absl action script I created which displays data in the advanced listpane on click of QUALIFICATIONS tab.
    6.created a SADL Query in the controller and added the fields required for selection.
    6.also created condition in the selected parameter
    6. In AdvancedListPane added the default set created., but after the querying the Bo data doesnt display in AdvancedlistPane
    Can Anyone Please suggest a solution to this.
    Regards

    hi  Fred,
    On click of QUALIFICATIONS tab , Eventhandler gets called . In the eventhandler a Bo action is called first which is a absl script- displayforecast, to get all the data . The data in the list pane is populated due to this script. But when i created the query and binded the default set to the listpane the data is not populated
    the Eventhandler is called on Click of Qualifations Tab, first action gets called and then eventhandler  that executes defaultset is fired . This eventhandler is the handler created when query->defaultset is created
    but after firing this query no data is displayed.

  • Error in running custom query from jspx(site) for Content Tracker Report

    Hi All,
    I want to generate a custom Content Tracker Report. I am able to do so from Content Tracker console, but when i try to invoke the service 'SCT_GET_DOCUMENT_INFO_ADMIN' or 'SCT_GET_DOCUMENT_INFO' with my custom query(which simply counts the number of rows in a table) from my jspx page, it gives the following error.
    oracle.stellent.wcm.server.request.RequestException: Error
    occurred in Content Server executing service
    'SCT_GET_DOCUMENT_INFO_ADMIN'
    Caused By: oracle.stellent.ridc.protocol.ServiceException: Unable to get
    document info. Unable to execute service method 'sctExecuteQuery'. The
    error was caused by an internally generated issue. The error has been
    logged.
    What could be the reason and the resolution?
    Also, I know that i am invoking the service in the right way as custom report from query as 'select * from users' works fine from site.
    P.S. I am using UCM 11g + SSXA

    Things are turning weird. The below two queries work from jspx.
    1. SELECT * FROM Users
    2. SELECT dname FROM Users
    But, the following query gives error (SQL is correct).
    select dname, count(dname) from users group by dname
    Unable to execute service method 'sctExecuteQuery'. Null pointer is dereferenced.
    $Unable to get document info.!csUnableToExecMethod,sctExecuteQuery!syNullPointerException
    intradoc.common.ServiceException: !$Unable to get document info.!csUnableToExecMethod,sctExecuteQuery
    *ScriptStack SCT_GET_DOCUMENT_INFO_ADMIN
    3:sctExecuteQuery,**no captured values**
    at intradoc.server.ServiceRequestImplementor.buildServiceException(ServiceRequestImplementor.java:2115)
    at intradoc.server.Service.buildServiceException(Service.java:2260)
    at intradoc.server.Service.createServiceExceptionEx(Service.java:2254)
    at intradoc.server.Service.createServiceException(Service.java:2249)
    at intradoc.server.Service.doCodeEx(Service.java:584)
    at intradoc.server.Service.doCode(Service.java:505)
    at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1643)
    at intradoc.server.Service.doAction(Service.java:477)
    at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1458)
    at intradoc.server.Service.doActions(Service.java:472)
    at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1391)
    at intradoc.server.Service.executeActions(Service.java:458)
    at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:737)
    at intradoc.server.Service.doRequest(Service.java:1890)
    at intradoc.server.ServiceManager.processCommand(ServiceManager.java:435)
    at intradoc.server.IdcServerThread.processRequest(IdcServerThread.java:265)
    at intradoc.server.IdcServerThread.run(IdcServerThread.java:160)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    Caused by: java.lang.NullPointerException
    at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
    at intradoc.util.IdcConcurrentHashMap.get(IdcConcurrentHashMap.java:60)
    This works fine from Content Tracker UI.
    Anyone has any idea, what could be the issue here?

  • Problem to get ResultSet when it is used a Date type in the query condition

    hello ,
    I having a bit of nightmare getting a ResultSet how result of one simple Query for a table when the condition WHERE involve a Date type.
    To change the String value in a date to use in the query condition, I tried both:
    String strDate = "dd/mm/yyyy";
    (1.) java.sql.Date sqlDate = new java.sql.Date(strDate.getTime() )
    (2.) SimpleDateFormat formatter = new SimpleDateFormat(strDate) ; sqlDate = formatter.parse(strDate);
    and finally I use this code to get the ResultSet:
    sql = "SELECT * FROM myTable Where (idCli = " + cd_Cli + " And dateReg = " + sqlDate + ")";
    statement = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    resultSet = statement.executeQuery(sql);
    boolean ok = resultSet.last();
    totNumberOfRegistration = resultSet.getRow();
    But In both the cases I get a empty resultSet.
    I shoul like if someone would look my code to say me where it is the mistake...
    thank you
    tonyMrsangelo
    P.S. I tryed using PrepareStatement too to get the ResultSet, but in that case I couldn't use the ResultSet because executing the statement resultSet.last() I get the error: "Result set type is TYPE_FORWARD_ONLY"

    In a database like Oracle, you need to use a function like TO_DATE; other databases may have something similar.
    However, the proper way to do this is to use a PreparedStatement. Then you can say
    PreparedStatement ps = conn.prepareStatement("update SOMETABLE set SOME_DATE=? where SOME_ID=?");
    ps.setDate(1, new java.sql.Date(someJavaUtilDate.getTime()));
    ps.setInt(2, theId);
    ps.executeUpdate();

  • Custom Pricing Conditions not working for a PO in SRM

    Hi Experts,
    We are on SRM 5.0, ECC 6.0 , Extended Classic Scenario.
    We configured the pricing conditions in SRM . We defined the our custom pricing condition types as below
    Condition type      ---  Condition Class       ---  Calculation Type
    Frieght(%)            ---       Prices                ---      Percentage
    Frieght Value       ---        Prices                ---  Fixed Amount
    We also defined the Calculation Schema.
    But when we try to define the pricing conditions in SRM during PO creation\change , the standard pricing condition types work but when we input the above defined custom pricing condition type, the value entered gets cleared. Pricing Overview is not calculating the values of the custom Pricing condition types.
    Please assist as where i have gone wrong. Do I need to run any standard report for pricing or do i have to implement any BADI.
    Thanks,
    Addy.

    Hi Sanjeev,
    I have run SM52 and VMC is active with 4 VM's .
    Please suggest.
    Thanks,
    Addy.
    Edited by: Addy1209 on Nov 18, 2010 4:28 PM

  • How to define the query condition of Image Theme in MapBuilder?

    Hi,
    I'm trying to add an dynamic Image Theme in OracleMap, but there's a problem.I defined the query condition of Image Theme like this:
    select scanimage,shap from image where scanimgid=467
    The shap column is the MBR column
    And the XML CODE:
    <?xml version="1.0" standalone="yes"?>
    <styling_rules theme_type="image" image_column="SCANIMAGE" image_format="JPEG" image_unit="M" image_resolution="1.0">
    <rule>
    <features> select scanimage,shap from image where scanimgid=467 </features>
    </rule>
    </styling_rules>
    When i preview this Image Theme ,there is an ORA-00936 error means lack of expression.
    Is there any problem with my definition?Or can query an image from an Image Theme?
    Thanks a lot for your help!
    Message was edited by:
    N.Mars
    null

    Hi Mars,
    predefined image theme definition does not support a "select" statement in the <features> tag. You should just define a query condition in the <features> tag.
    It seems that you are trying to use an image theme in Oracle Maps, but it currently does not support a FOI image theme. You should add a predefined image theme as part of the basemap, and maybe add scales values to set the visibility range of this image theme.
    Joao

  • Add custom query to standard PLD layout

    Hi Everybody,
    I need to change the standard Invoice PLD report, in order to include additional data that is
    kept in my UDO.
    Is it possible to define a custom query inside PLD to retrieve data from the UDO
    (the UDO is linked to the Invoice) and show it in the Invoice layout?
    Thanks all,
    Manuel Dias

    Hi Manuel,
    One workaround you can try is to use UDF and formatted search to retrive the info on the invoice screen and then directly display it on the invoice PLD.
    Hope it helps.
    Regards,
    Hamsa

  • How to set a BEx Query Condition in Design Studio (e.g. Net value GT 0)

    Hi experts,
    I have set a simple condition in my BEx Query...
    e.g. key figure "Net value" GT 0 to become only positive values in the query result.
    In the Query runtime the condition works successful, but in the Design Sudio view the defined Query condition doesn´t work.
    In my Design Studio crosstab I have tried to switch between the display setting "Conditional formating Visible" true/false, but without success.
    By the way, before I have posted this thread, I had a look at this two blogs...
    Design Studio 1.0: Create a Scorecard Using SAP BW BEx Query Exceptions
    Design Studio 1.2  - a Second Look
    Any ideas or experiences?
    Thanks and regards,
    Michael

    Hi Michael,
    I think you are mixing up two different BEx terms. Conditions are filters on key figures (show me only the results with a value bigger than 50). Exceptions do not filter the result set, but provide a formatting based on the values in the result set (if value is bigger than 50, make its cell red).
    The Conditional formatting setting in Design Studio refers to the BEx exceptions. For the BEx conditions there isn't such a setting available. You just have to activate the condition in your BEx Query and use that for your data source in Design Studio.
    If you want a workaround to enable/disable conditions from Design Studio, check this blog I wrote: HackingSAP.com - SAP Design Studio and Conditions It shows how you can use variables to adjust the conditions (and also activate) from within Design Studio.
    Cheers,
    Xavier

  • Change query dynamically in DB Adapter

    Hi,
    Please answer these questions.
    1. How to change query dynamically in DB Adapter?
    2. I have 2 db adapters, if i got error in 1 db adapter then how to rollback?
    Regards,
    kpr

    Hi,
    <div class="jive-quote">How to change query dynamically in DB Adapter?</div>
    Unfortunately there is no way to pass the query dynamically in DB Adapter. The reasoning behind that is that the DB adapter configuration wizard creates multiple assist files for each operation including the xsd which can not be created for any query dynamically.
    <div class="jive-quote">I have 2 db adapters, if i got error in 1 db adapter then how to rollback?</div>
    Either use XA datasources or throw a rollback fault in the catch block.
    Regards,
    Neeraj Sehgal

Maybe you are looking for

  • How can I retrieve my old back ups?

    I was having a probelm with my Iphone today and it wouldn't back up via icload, so i backed up to labtop and it gave me an error and couldn't send backup. it asked me to reset, so i did and it reset to a 4 month ago version. how can i see my last bac

  • Events show pictures in Events view but have no contents when opened

    Hi. Using iPhoto 9.5.1 with Mavericks 10.9.1 with library storage on Mavericks Server. When I go to Events view (under Library on the upper left navigation panel) I see events and on each I can hover over and scroll through and see the pictures. When

  • Default Queue Change during Import

    Hi All, We tried different option in IMPORT Rule Set to change Default Queue value of Job chain or job definition during import. eg: SAPTEST_Queue to SAPPRD_Queue But it is not working with any of the option. Please help us in setting Import Rule Set

  • Displaying content in JSP page, want BR but not other Html tags

    I have a page and am reading files and displaying the contents of the files onto the page in a <div> Oneissue is that in the file the end of line are \n or \r\n whichever operation system. I replaced those with <BR> no problem. Now my issue is that I

  • TS4147 how can I get rid of my contacts in icloud

    I have 540 old contacts that I wish to get rid of permently, but they keep getting synced from icloud everytime. How can I delete contacts etc.. from icloud?