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

Similar Messages

  • How to change JNDI dynamically in DB adapter and FTP adapter

    Hi every one,
    Please any one explain "How to change JNDI dynamically in DB adapter and FTP adapter" with screen shots
    Thanks in advance

    YES, very much possible. Only with CRUD operation on a table is possible.
    Please refer the below URL, where you can see the multiple check box selected under "Perform an operation on a table" under Operation Type.
    http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_db.htm#BDCGADFJ
    *7) Give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question.*
    Going forward, please raise this as a separate thread. So that people will get benefited.
    Thanks,
    Vijay

  • Changing query dynamically

    Hi,
    I have a requirement based on the parameter passed by the user i need to execute diffent queries.
    For suppose
    I have defined one query Group1,
    SELECT ALL TMP_AUFSTELLUNGPOSITIONEN.TAP_SACH_KTO, TMP_AUFSTELLUNGPOSITIONEN.TAP_KOSTENST,
    TMP_AUFSTELLUNGPOSITIONEN.TAP_PROJEKT, TMP_AUFSTELLUNGPOSITIONEN.TAP_ASG_NR,
    TMP_AUFSTELLUNGPOSITIONEN.TAP_ABR_VON, TMP_AUFSTELLUNGPOSITIONEN.TAP_ABR_BIS,
    TMP_AUFSTELLUNGPOSITIONEN.TAP_SEGMENTTEXT, TMP_AUFSTELLUNGPOSITIONEN.TAP_WAEHRUNG,
    TMP_AUFSTELLUNGPOSITIONEN.TAP_ANZAHL, TMP_AUFSTELLUNGPOSITIONEN.TAP_NETTO_GESAMT,
    TMP_AUFSTELLUNGPOSITIONEN.TAP_POS_TEXT1
    FROM TMP_AUFSTELLUNGPOSITIONEN
    WHERE TMP_AUFSTELLUNGPOSITIONEN.TAP_ASG_NR = :DOCUMENTNUMBER
    If user passes Type as 1 the above query should execute else the below query should execute
    select TAP_ABR_VON,TAP_ABR_BIS, TAP_PROJEKTBEZ, SUM(TAP_NETTO_GESAMT) as SUMTAP from TMP_AUFSTELLUNGPOSITIONEN
    where TAP_ASG_NR = :DOCUMENTNUMBER group by TAP_ABR_VON,TAP_ABR_BIS,TAP_PROJEKTBEZ,TAP_STEUSCHL
    The layout should be same for both the reports only diffence is some fields will be displayed and some other won't.
    I should i do it for this?
    Can u help me sloving above problem.
    Thanks
    Kalyan

    Kalyan,
    Good question!
    You are correct. Each query would be in a separate group, so the number of possible values for the parameter would = the number of queries/groups.
    So if you have 3 queries, in the layout view, you need 3 repeating frames. I would draw a regular frame, and put your repeating frame inside. Then, below it, draw another frame, and your 2nd repeating frame. Below that, draw your 3rd frame and repeating frame. So now you have 3 repeating frames.
    On the first frame (goes with group 1) right click on the outermost regular frame, and click F-11 for a format trigger. Add this part to the code:
    IF :P_PARAM = 1 then
      return (true);
    else
      return(false);
    end if;To Frame 2 Add this:
    IF :P_PARAM = 2 then
      return(true);
    else
      return(false);
    end if;And to frame 3 add this:
    IF :P_PARAM = 3 then
      return(true);
    else
      return(false);
    end if;If you are having trouble read up on format triggers. When the user select a value as a parameter, only one of the queries (groups) will execute, and only one of the frames will print.
    I am going to attemp to draw a layout of what you need.
    Frame 1
      Repeating Frame 1
    White Space
    Frame 2
      Repeating Frame 2
    White Space
    Frame 3
      Repeating Frame 3
    --------------------------------------------------------

  • How to change VO query dynamically

    Hi,
    Iam trying to change the VO query dynamically. My req. is I have 6 columns in a header page 3 columns(default single column) for sorting purpose and another 3 columns(default single column) for data querying purpose.
    al these are in one view so I have created one VO.
    Sorting Searching
    A A
    B B
    C C
    When I give any values in Sorting and hit submit button VO query should change dynamically.
    I have searched older post regarding this.
    My query is some thing like this
    SELECT * from cust_table where a = NVL(:1 ,a)
    UNION
    SELECT * from cust_table where a<> NVL(:1 ,a)
    order by a
    Iam trying to pas the below part dynamicaly in my AM method
    vo.setWherecaluse("where a = NVL(:1 ,a)
    UNION
    SELECT * from cust_table where a<> NVL(:1 ,a)
    order by a ")
    and trying to pass the params to that query. But it is not working.Giving error "Bind variable could not find"
    Can any one suggest how to solve the issue.
    Thanks,
    Mahesh

    Hello Ajay,
    THanks for your response.
    My vo query is select col1,col2,col3,col4,col5,col6 from cust_table;
    and and changing vo.setwhereclause dynamically based on different scenerios.
    in one scenerio i need my query to be some thing like
    SELECT col1,col2,col3,col4,col5,col6 from cust_table where a = NVL(:1 ,a)
    UNION
    SELECT col1,col2,col3,col4,col5,col6 from cust_table where a <> NVL(:1 ,a)
    order by a
    so can i concatenate my vo.setwhereclause like *"where a = NVL(:1 ,a) UNION SELECT col1,col2,col3,col4,col5,col6 from cust_table where a NVL(:2 ,a) order by a"*
    in the setwhereclause iam setting bind variables is this method correct? Hope it is clear pleaselet me know if it is not clear I will explain in detail.
    Thanks,

  • Dynamic destinations for adaptive web service in webdynpro for java

    Hi,
    Please advice me on how to create dynamic destination for adaptive web service model in webdynpro for java.
    Regards,
    Patana

    Hi,
    If this is the case, then use the HTTP destination for this.
    What you need to do is:
    1. Create one HTTP destination in visual administrator at services-> Destinations. Provide HTTP url of the your web service and the security options.
    2. Specify this HTTP destination in the code before executing web service model.
    Write following code for that:
    wdContext.current<node name>Element().modelobject()._setHTTPDestination(<Specify HTTP destination name>);
    Then execute your web service model.
    Now, whenever you want to change the server on which your web service is running, make change in the HTTP Destination in visual administrator.
    Refer this link,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b2bc0932-0d01-0010-6d8e-cff1b2f22bc7
    Regards,
    Sunaina Reddy T

  • 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

  • Dynamic conifguration for adapter module

    com.sap.aii.mapping.api.DynamicConfigurationKey
    Class used to create a key object for an adapter-specific attribute. The key object comprises the adapter namespace and the property name.
    &#9679;     com.sap.aii.mapping.api.DynamicConfiguration
    Class used to read, change, or delete the value of an adapter-specific attribute. In a method, you use objects of type DynamicConfigurationKey to access the attributes

    For Module Processors, check Adapter-Specific Message Attributes of the following link:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/17/50d440e14f8431e10000000a1550b0/frameset.htm
    The methods to set/get Attributes in Adapter Module are:
    Message.setMessageProperty()
    Message.getMessageProperty()
    The following info can be obtained in javadoc:
    getMessageProperty
    public java.lang.String getMessageProperty(java.lang.String namespace,
                                               java.lang.String name)
        Returns the value of an additional message property, in case that such an value exists.
        Parameters:
            namespace - The namespace of the property to get.
            name - The name of the property to get.
        Returns:
            The value for the given namespace/name combination, or null, when no such value exists.
    setMessageProperty
    public void setMessageProperty(java.lang.String namespace,
                                   java.lang.String name,
                                   java.lang.String value)
                            throws InvalidParamException
        Sets an additional message field, if supported by the Message profile implementation. Such additional fields will not be visible as an own table column in the MS message monitoring, since it is to be stored as part of the message header. This mechanism allows different protocol implementations to support more message fiels, as per default available in the MS Message interface. Such fields can be accessed through this API method, without casting to the specific Message implementation.
        Parameters:
            namespace - The namespace of the property to set.
            name - The name of the property to set.
            value - The value of the property to set. When null is given as the value param, an already set value will be deleted.
        Throws:
            InvalidParamException - If either the length of one of the parameters is too long, or in case of an unknown/not allowed namespace/name combination (but only if the Message implementation has the necessary knowledge about the valid namespace/name pairs).
    Also, for an example, check the following blog:
    /people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules
    Regards,
    Henrique.

  • Changing LOV Dynamically

    Dear Members,
    I have an OAF Page which has 6 records.
    When user is in first record, I want to attach XXLOV1 to FIELD1 by changing the where clause. Similarly when user is in 2 nd record I want to attach XXLOV1 to FIELD1 by changing the where clause dynamically and so on..
    Kindly please let me know how to acheive this requirement.
    Many thanks in advance.
    Best Regards,
    Arun Reddy D.

    Hello Anil,
    Thank you very much for your reply. Iam a beginner to OAF.
    Can you please elaborate your answer.
    Actually I have page where I am displaying FIELD1 6 times i.e., 6 records.
    When the cursor is in first record I want to attach the lov with certain query criteria by changing the where clause. Similarly when the cursor is in second record, I want to change the same lov's where clause and attach it to the same field i.e., FIELD1 and son on.
    Here if we have an event to the field how we will know that whether it is first record or second record .... to change the lov query dynamically.
    Here my main problem is Iam not able to find out user is in which record to change the lov dynamically. Can you please give me some hint to find out the record number in which the cursor is so that i can change the lov dynamically.
    Many thanks in advance.
    Best Regards,
    Arun Reddy D.

  • Assigning a query dynamically to a cursor based on IF ELSE condotion

    hello guys,
    we are facing a problem while creating a procedure.
    The procedure has been recreated in ORACLE from SQL SERVER 2005.
    the problem is that in SQL server we can assign a query dynamically to a cursor so that it will be called at execution time.But this is not the case in oracle, i.e in Oracle its not allowed to assign a query to a cursor dynamically(OR IS IT...!!!)
    the code is
    vr_SQL varchar2(400);
    declare
       cursor ord_cur  ;  <-----cursor declaration
      begin
       If v_pIsScrutiny = 0 then   +<--------------second condition+
          vr_SQL:='Select NVL(ServiceID,0)  ServiceID,OrdQty,+<-------query assignment to a variable+
              NVL(DrugID,0) DrugID,NVL(ServiceAmount,0) Rate,OrdDtlID 
              from Orderdtl inner join ordermst on Orderdtl.OrdID = ordermst.OrdID 
              Where Orderdtl.OrdID in (Select OrdID From Ordermst Where OrdVisitID = vr_visitid  
              and TO_CHAR(ordermst.OrdDate,''DD-MON-YYYY'') 
              Between TO_CHAR(vr_pActivationDate,''DD-MON-YYYY'') 
              and TO_CHAR(vr_pExpiryDate,''DD-MON-YYYY'') 
              ) And NVL(Orderdtl.Cancelled,0) = 0 And NVL(Orderdtl.PackageID,0) = 0 
              and NVL(Orderdtl.DrugID,0) = 0;';
        Else  +<--------------first condition+
            Update OrderDtl Set PackageID = 0 , AllocationID = 0 , ConsumptionID = 0 
            Where OrdID in (Select OrdID From Ordermst Where OrdVisitID = vr_visitid)  
            And AllocationID = v_pHCPAllocationID; 
           vr_SQL:= 'Select NVL(ServiceID,0)  ServiceID, +<-------query assignment to a variable+
           OrdQty,NVL(DrugID,0)  DrugID,NVL(ServiceAmount,0)
            Rate,OrdDtlID 
           from Orderdtl inner join ordermst on Orderdtl.OrdID = ordermst.OrdID 
           Where Orderdtl.OrdID in (Select OrdID From Ordermst Where OrdVisitID = vr_visitid  
           and TO_CHAR(ordermst.OrdDate,''DD-MON-YYYY'') 
           Between TO_CHAR(vr_pActivationDate,''DD-MON-YYYY'') 
           and TO_CHAR(vr_pExpiryDate,''DD-MON-YYYY'') 
           ) And NVL(Orderdtl.Cancelled,0) = 0 And NVL(Orderdtl.PackageID,0) = 0;'; 
        end if;
           ord_cur is vr_SQL; +<----------query assigned to a cursor variable+
        ord_rec ord_cur%ROWTYPE;
       if not ord_cur%ISOPEN then
            open ord_cur;
       end if;
        loop
        fetch ord_cur into ord_rec;
        exit when ord_cur%NOTFOUND;So currently we are stuck with this problem.
    Any solution would be of great help..
    thank you

    841363 wrote:
    hello guys,
    we are facing a problem while creating a procedure.
    The procedure has been recreated in ORACLE from SQL SERVER 2005.
    the problem is that in SQL server we can assign a query dynamically to a cursor so that it will be called at execution time.But this is not the case in oracle, i.e in Oracle its not allowed to assign a query to a cursor dynamically(OR IS IT...!!!)The problem is that you are thinking in SQL Server terms and Oracle just isn't SQL Server.
    You need to consider using ref cursors for such things (sys_refcursor) e.g.
    SQL> CREATE OR REPLACE PACKAGE reftest IS
      2    PROCEDURE test(P_no in number, cur_o OUT sys_refcursor);
      3  end;
      4  /
    Package created.
    SQL>
    SQL> CREATE OR REPLACE PACKAGE body reftest as
      2    PROCEDURE test(P_no in number, cur_o OUT sys_refcursor) as
      3      myexc exception;
      4    BEGIN
      5      if P_no = 1 then
      6        open cur_o for select empno, ename from emp;
      7      elsif p_no =2 then
      8        open cur_o for select deptno, dname from dept;
      9      else
    10        RAISE myexc;
    11      END IF;
    12    exception
    13      when myexc then
    14        raise_application_error(20991,'input must be 1 or 2');
    15    end ;
    16  end reftest;
    17  /
    Package body created.
    SQL> var x refcursor;
    SQL> exec reftest.test(1,:x);
    PL/SQL procedure successfully completed.
    SQL> print x;
         EMPNO ENAME
          7369 SMITH
          7499 ALLEN
          7521 WARD
          7566 JONES
          7654 MARTIN
          7698 BLAKE
          7782 CLARK
          7788 SCOTT
          7839 KING
          7844 TURNER
          7876 ADAMS
          7900 JAMES
          7902 FORD
          7934 MILLER
    14 rows selected.
    SQL> exec reftest.test(2,:x);
    PL/SQL procedure successfully completed.
    SQL> print x;
        DEPTNO DNAME
            10 ACCOUNTING
            20 RESEARCH
            30 SALES
            40 OPERATIONS
    SQL>

  • Problems in creation of workbook using Change query local view.

    Hi Experts,
    I have created a Multiprovider by using union of two infocubes and created a Query based on Multiprovider.  I want to restrict one infocube in Change Query local view for creating new workbooks.  In Query global view we drag and drop the Infocube under Filters, but in the Query local view Filter panel is in disable mode. (My requirement is to create the workbooks using change query local view only)
    How can I restrict the one Infocube values in the workbooks by using Change query local view? 
    Thanks in advance.
    Venkat.

    Hi Venkat Prasad
    As you told that the query is on multi provider and the view is not allowing to declare/define filter value
    Just drag the infoprovider info object avilable under packet dimension to rows and right click on it restrict by selecting the name of the info provider when u right click it will show you the option of restrict once u click on it,it will takes to u a pop up where you can able to see the name of info providers and you specify according to it and finally in the display of results if you dont want to to display the info provider name then just right click on the 0infoprovider object under rows go to properties then choose hide option under display.
    Hope its clear a little..!
    Thanks
    K M R
    **Assigning points is the only way of saying thanks in SDN***
    >
    venkata prasad wrote:
    > Hi K M R,
    >
    > Thanks for ur quick response.  Most of the Infoobjects are common for both infocubes. I didn't understand this sentense "retrict the value with the infoprovider which values you are trying to view".
    > Please explian elaborately how to restrict the values speicfic to infoprovider under rows.

  • How to pass the feild names of a select query dynamically?

    Hi
    How can we pass the feilds names in select query dynamically?
    For example in my selection screen i wil be giving the table name, and feilds in that table.....
    those feilds should be taken in my select query...
    instead of
    PARAMETERS : tab_name TYPE ddobjname .
      SELECT *
        FROM (tab_name)
        INTO TABLE <newtab>
       UP TO 25 ROWS.
    parametrs : feild1 like-------
                     feild2----
    i need select feild1 feild2 feild3    FROM (tab_name)
        INTO TABLE <newtab>
       UP TO 25 ROWS.

    by the way, contrary to popular belief there is no performance problem when using
    SELECT * FROM dbtab INTO CORRESPONDING FIELDS OF TABLE itab WHERE ...
    as long as the structure of itab contains only the required fields.
    I ran some benchmarks against this and above construct is maybe 0.1% slower (Oracle 10g) than a
    SELECT f1 f2 f3 f4 ... FROM dbtab INTO TABLE itab WHERE ...
    but is saves you from maintaining a potentially very long field list in your code. So when you need additional fields later on, you just add them to the DDIC structure or type definition and that's it.
    Maybe something you want to factor in here.
    Cheers
    Thomas

  • Dynamic configuration in adapter module

    Hi friends
    I need some information on how to carry out dynamic configuration in adapter module.
    To be precise I want to assign file name dynamically to message header in adapter module, not in runtime mapping.
    Regards
    Akhil

    HI Akhil,
    file adapter dynamic file name
    Problem in dynamic file name in File reciever adapater
    Dynamic  File Name for Receiver File Adapter
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Thax
    Chirag

  • I've got a power cable from my 2011 macbook air which I would like to use as a spare cable for my new 2013 macbook pro, but the design has changed.  Is there an adapter available so that I can use it?

    I've got a power cable from my 2011 macbook air which I would like to use as a spare cable for my new 2013 macbook pro, but the design has changed.  Is there an adapter available so that I can use it?

    Welcome to the Apple Support Communities
    Use the MagSafe to MagSafe 2 Converter > http://store.apple.com/us/product/MD504ZM/A/magsafe-to-magsafe-2-converter?fnode =51 However, note that the MacBook Air doesn't provide enough energy to charge the MacBook Pro with Retina display, so it could not work

  • How to build a query dynamically....

    hi...i want to build a query dynamically. i don't want to build query by using string buffer. i want to create it directly by using sql query itself.
    my situation is like this....i have four drop down list in a page. The user can search the things based on one or two or three or four selected values.
    how to build a query for this kind of situation....pls let me know.
    Edited by: success_shiva6mca on Mar 3, 2008 12:39 PM

    there are two problems with building sql directly.
    1. it allows sql injection
    2.it allows XSS
    google them and you will understand if you dont already.
    I will recoment catching the values and using preparedStatements

  • How to change the dynamic IP address to Static IP Address in Solaris 10X86

    Hi,
    I have installed Solaris 10X86 in a VM.While installing Solaris I have enabled DHCP.So its created with dynamic IP Address.Now I want to change the dynamic IP address to static IP address.Please anyone can help me to sort out this problem.

    Hi,
    I have installed Solaris 10X86 in a VM.While installing Solaris I have enabled DHCP.So its created with dynamic IP Address.Now I want to change the dynamic IP address to static IP address.Please anyone can help me to sort out this problem.

Maybe you are looking for