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

Similar Messages

  • How to build a query based on(UNION) 3 vendor InfoObject

    Dear Experts:
    I have a requirement to build one query based on 3 vendor InfoObjct: 0VENDOR + 0VEN_COMPC + 0VEN_PURORG.
    I tried to build a multiprovider upon these 3 infoobjects, but when I Identify(Assign) the key for each InfoObject, supposely there should be 3 InfoObject for me to check (0VENDOR, 0VEN_COMPC and 0VEN_PURORG) so that I can UNION these 3 infoobjects together on vendor number. But since the reference infoobject of these 3 vendor master data is different, I can not check the 3 together.
    Can anybody let me know how to build that query? I only need vendor number show once, and the attributes of 0VEN_COMPC and 0VEN_PURORG can be union to 0vENDOR.
    Any post would be appreciated and thank you all in advance!
    Best Regards!
    Tim

    Hi,
    you can create a link between the vendor objects itself, means link 0vendor with 0ven_compc and 0ven_purorg. This should give you a list of all vendors multiplied with the comp codes multiplied with the purch. org. May be here it is possible to create another link between a attribute (eg. comp_code of 0ven_purorg with comp_code of 0ven_compc). In case it is not possible you need to add this link information somehow. Another option might be to create 2 queries. One on a infoset of 0vendor and 0ven_purorg and another one on 0vendor and 0ven_compc.
    regards
    Siggi

  • How to build a query to join on two tables without mapping

    I did Automatic mapping by the workbench Directofield mapping with the table and java object.
    Wanted to build a simple join query by joining on the same field on both the tables.Not the sql query through the toplink using expression builder.
    Please help.............
    Spent one full day for this................

    Thanks Don for the reply,sorry to bug you,but i need help.....
    SELECT A.AGNCY_C,
         A.TYPE_C,
         A.RESN_C,
         A.S_TYPE_C,
         A.SUB_ID_C,
         A.RY_C
    FROM RATING A, REF B
    WHERE A.ID_C = B._ID_C
    AND A.ALPHA_C = B.ALPHA_C
    AND A.EFF_D >= B.MATURITY_D
    This is the real query i was talking about.I did mapping automatically through the workbench,generated java classes also throught the workbench.
    Now they don't want to execute the raw sql.They wanted to get all the RATING objects with the where condition.
    So how to build a query by using toplink.
    tried your example
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression creditRating = builder.getTable("RATING").getField("ID_C");
    Expression issue_ref = builder.getTable("REF").getField("ID_C");
    Expression join = creditRating.equal(issue_ref);
    I am getting java.lang.OutOfMemoryError
    error.
    I selected the option generate classes and descriptors
    from the tables (RATING,REF).,so it created the classes and dscriptors automatically.
    In Database script for the table RATING like this
    ALTER TABLE RATING ADD (
    CONSTRAINT RATING_F1 FOREIGN KEY (ID_C, ALPHA_C)
    REFERENCES REF (ID_C,ALPHA_C));
    I think when i generate descriptor automatically it is keeping this association.
    Please help me.........

  • How to build a full dynamic WHERE expression in ADFBC Faces View Object ?

    Dear Steve
    >
    I need an example about how to build a full dynamic WHERE expression in
    ADFBC View Object
    In UIX I known to do that, but i don't kwown how to do in ADFBC Faces.
    please help me to see an example.
    thanks
    Juan Carlos

    You write an AM level method to set the where clause and you expose it as a client method. (just like you did before)
    Then you can drag this method onto a page as a button and then pressing on this button will execute the method.
    If you want this to be done automatically without pressing a button - you go to the pagedef.xml file for your page and add a methodInvocation binding to that AM method, and then add a method executable to the executables section calling this method.

  • How to build sql query for view object at run time

    Hi,
    I have a LOV on my form that is created from a view object.
    View object is read-only and is created from a SQL query.
    SQL query consists of few input parameters and table joins.
    My scenario is such that if input parameters are passed, i have to join extra tables, otherwise, only one table can fetch the results I need.
    Can anyone please suggest, how I can solve this? I want to build the query for view object at run time based on the values passed to input parameters.
    Thanks
    Srikanth Addanki

    As I understand you want to change the query at run time.
    If this is what you want, you can use setQuery Method then use executeQuery.
    http://download.oracle.com/docs/cd/B14099_19/web.1012/b14022/oracle/jbo/server/ViewObjectImpl.html#setQuery_java_lang_String_

  • 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,

  • How to build a query to get the item properties is tick or not?

    hello everybody. i'm 1 of the sap b1 user. i face a problem in build a query to check one of the item properties is tick or not? pls help...

    Hi Grace,
    your query could look like this:
    Select itemcode from oitm where qrygroup1= "Y"
    qrygroup1 is item property 1, qrygroup2 is item property 2 etc.
    Regards
    Ad

  • How to Build Attribute Dimension Dynamically & Load with LCM?

    Hi, I'm trying to modify the existing outline at cilent's site. For some reason, when I pulled the outline with extractor, it didnt come out in the format that is compatible with Outline Load Utility. I was told to use LCM so I may still load with minimal to no modification to the existing structure of outline.
    So can I build dimensions dynamically in EXCEL then load with LCM and push to Planning?

    The log came back with many unrecognized headers in the outline. I spoke to Oracle Support many times, and they said that the format of our outline is improper for Outline Load Utility to read.
    Since the outline has already been incorporated, we are not allowed to many any significant changes. That is why we were advised to use LCM.
    I tried to use a sample of one of the existing attribute dimensions in XML as the base and build the new attribute but it failed. I would appreciate if you can provide steps by steps resources to show how to add new attributes to the existing outline.

  • How to change report query dynamically in Oracle APEX?

    Hi,
    I want to dynamically change the where condition in APEX report query. Can anyone help me solve my this problem?
    (Just want to change the query which we change in Oracle Reports using lexical parameter to change &Where, &Order by etc. dynamically!!)
    Thanks, Praful

    Hi
    I've been using flexible queries in APEX for a few years now, and your question just added a whole new dimension to the flexible and powerful nature or writing reports in APEX.
    While APEX Interactive reporting has almost completely removed the need the equivalent of Lexicals in Oracle Reports, I thought it might be fun to try and use lexicals in an APEX report.
    Before we start I should summarise the powerful capability of APEX reporting to have oprtional parameters (lots and lots of them if this is needed).
    For each parameter, you simply add a page item which will hold the value of the parameter.
    The item/parameter can be populated by typing in the value, defining an LOV, using a date-picker etc.
    To make the parameter optional simply use an OR in the where clause.
    So for a apge item P200_PARAM1.....include
    WHERE (:P200_PARAM1 IS NULL
    OR COLUMN1 = :P200_PARAM1)
    This way you can either leave the page item null or type in / select a value from a LOV.
    There is a small quirk in APEX LOV's which sometimes returns a value of '%' or '%null%' - depending on the version - when no value is selected.
    See Patrick Wolf's solution for this at Re: Null value handling in LOVs
    I include this Application Process in all my APEX applications ;)
    Now let's look at using the equivalent of Oracle Reports Lexicals......
    First-off - this is based on the APEX SQL report - NOT Interactive Report.
    It relies on the fact that you can let the query be parsed only at runtime.
    1. Define an SQL report entering the 'core' of your query.
    With a query like SELECT ENAME, JOB FROM EMP
    Select 'Generic Columns' option in the 'Column Headings' section
    Finish the report creation
    2. Define a page item - say P200_LEXICAL - type text on the page
    3. Edit the report and update the SQL query to include your lexical page item
    SELECT ENAME, JOB FROM EMP &P200_LEXICAL. (REMEMBER THE '.' AT THE END)
    Ensure that the option "Use Generic Column Names (parse query at runtime only)" is selected at the bottom of the query
    4. Add a button to the page -using 'Create a button displayed among this region's items' the will submit the page.
    5. Run the page - you will see all the employee names and job desdriptions
    6. Enter a where clause into the 'Lexical' textbox - say "WHERE ENAME LIKE 'K%'" and click the 'Go' button
    Voila! your where clause is magically applied.
    Try any variant you like adding an ORDER BY clause etc...... this is FUN!
    7. Clear the value of the LEXICAL and click go.
    Edit the report and move the &P200_LEXICAL. into the selected columns (or add another one)
    SELECT ENAME, JOB &P200_LEXICAL. FROM EMP
    8. Run the page
    Enter ",SAL" in the textbox and "Go"
    We can add as many columns as we like (subject to the "Maximum number of generic report columns:" set below the SQL query in the report edit section)
    Now because we have all the flexibility in APEX of setting page items using SQL or PLSQL you can set the value of the lexical programatically, or just pre-set a few values in an LOV - the options are limitless.
    While I've never had the need to use lexicals - you can see that APEX provides the most Flexible Lexicals in town.
    Eat your heart out "Oracle Reports"!!!
    Have fun
    Mike

  • How to build this query with the minumum number of sub-selects?

    The question I am trying to answer is analogous to this:
    Give me all projects that: (have no employees assigned and are small) or (have only employees with the the last name = "Smith")
    Thanks,
    Roman

    Thank you :
    1- I am in 9.0.4.8 version and can not use allOf expression (availible in beta version)
    2- I not find .notIn(subQuery) operator in 9.0.4.8 version and i replace it by .in(subQuery).not() !
    My new query retrieve Customer who have 0 (zéro) Orders !
    How to retrieve only customer (with orders + with orders without "television") ?
    My new query is :
    <div align="left" class="java">
    <font color="#7f0055"><b>static </b></font><font color="#7f0055"><b>void </b></font><font color="#000000">findCustNoComputer </font><font color="#000000">(){</font>
    <font color="#ffffff">   </font><font color="#000000">ClientSession cs = TopLinkSession.acquireClientSession</font><font color="#000000">()</font><font color="#000000">;</font>
    <font color="#ffffff"></font>
    <font color="#ffffff"></font>
    <font color="#ffffff">  </font><font color="#000000">ReadAllQuery query = </font><font color="#7f0055"><b>new </b></font><font color="#000000">ReadAllQuery</font><font color="#000000">(</font><font color="#000000">Customer.</font><font color="#7f0055"><b>class</b></font><font color="#000000">)</font><font color="#000000">;</font>
    <font color="#ffffff">  </font><font color="#000000">ExpressionBuilder queryBuilder = query.getExpressionBuilder</font><font color="#000000">()</font><font color="#000000">;</font>
    <font color="#ffffff"></font>
    <font color="#ffffff">  </font><font color="#000000">ExpressionBuilder subqueryBuilder = </font><font color="#7f0055"><b>new </b></font><font color="#000000">ExpressionBuilder</font><font color="#000000">(</font><font color="#000000">Customer.</font><font color="#7f0055"><b>class</b></font><font color="#000000">)</font><font color="#000000">;</font>
    <font color="#ffffff">  </font><font color="#000000">ReportQuery subQuery = </font><font color="#7f0055"><b>new </b></font><font color="#000000">ReportQuery</font><font color="#000000">(</font><font color="#000000">Customer.class, subqueryBuilder</font><font color="#000000">)</font><font color="#000000">;</font>
    <font color="#ffffff">  </font><font color="#000000">subQuery.addAttribute</font><font color="#000000">(</font><font color="#2a00ff">&#34;id&#34;</font><font color="#000000">)</font><font color="#000000">;</font>
    <font color="#ffffff">  </font><font color="#000000">subQuery.setSelectionCriteria</font><font color="#000000">(</font><font color="#000000">subqueryBuilder.anyOf</font><font color="#000000">(</font><font color="#2a00ff">&#34;Orders&#34;</font><font color="#000000">)</font><font color="#000000">.anyOf</font><font color="#000000">(</font><font color="#2a00ff">&#34;OrderItems&#34;</font><font color="#000000">)</font><font color="#000000">.get</font><font color="#000000">(</font><font color="#2a00ff">&#34;product&#34;</font><font color="#000000">)</font><font color="#000000">.get</font><font color="#000000">(</font><font color="#2a00ff">&#34;productName&#34;</font><font color="#000000">)</font><font color="#000000">.equal</font><font color="#000000">(</font><font color="#2a00ff">&#34;Computer&#34;</font><font color="#000000">))</font><font color="#000000">;</font>
    <font color="#ffffff">  </font><font color="#000000">query.setSelectionCriteria</font><font color="#000000">(</font><font color="#000000">queryBuilder.get</font><font color="#000000">(</font><font color="#2a00ff">&#34;id&#34;</font><font color="#000000">)</font><font color="#000000">.in</font><font color="#000000">(</font><font color="#000000">subQuery</font><font color="#000000">)</font><font color="#000000">.not</font><font color="#000000">())</font><font color="#000000">;</font>
    <font color="#ffffff"></font>
    <font color="#ffffff">   </font><font color="#000000">Vector allCustomers = </font><font color="#000000">(</font><font color="#000000">Vector</font><font color="#000000">)</font><font color="#000000">cs.executeQuery</font><font color="#000000">(</font><font color="#000000">query</font><font color="#000000">)</font><font color="#000000">;</font>
    <font color="#ffffff">   </font><font color="#000000">Iterator allCustomersIterator = allCustomers.iterator</font><font color="#000000">()</font><font color="#000000">;</font>
    <font color="#ffffff">   </font><font color="#7f0055"><b>while </b></font><font color="#000000">(</font><font color="#000000">allCustomersIterator.hasNext</font><font color="#000000">()) </font>
    <font color="#ffffff">   </font><font color="#000000">{</font>
    <font color="#ffffff">     </font><font color="#000000">Customer tempCustomer = </font><font color="#000000">(</font><font color="#000000">Customer</font><font color="#000000">)</font><font color="#000000">allCustomersIterator.next</font><font color="#000000">()</font><font color="#000000">;</font>
    <font color="#ffffff">        </font><font color="#000000">System.out.println</font><font color="#000000">(</font><font color="#000000">tempCustomer</font><font color="#000000">)</font><font color="#000000">;</font>
    <font color="#ffffff">   </font><font color="#000000">}</font>
    <font color="#ffffff">   </font><font color="#000000">cs.release</font><font color="#000000">()</font><font color="#000000">;</font>
    <font color="#000000">}</font>
    <font color="#ffffff"></font>
    <font color="#ffffff"></font>
    Sql of query :
    SELECT
         t0.CUST_LAST_NAME, t0.CUST_FIRST_NAME, t0.CREDIT_LIMIT, t0.CUST_EMAIL, t0.CUSTOMER_ID, t0.PHONE_NUMBER2, t0.PHONE_NUMBER1, t0.CUST_STREET_ADDRESS1, t0.CUST_CITY, t0.CUST_STREET_ADDRESS2, t0.CUST_STATE, t0.CUST_POSTAL_CODE
    FROM TL_CUSTOMER t0
    WHERE NOT (
         (t0.CUSTOMER_ID IN
              (SELECT DISTINCT t1.CUSTOMER_ID
              FROM TL_CUSTOMER_ORDER t4, TL_ORDER_ITEM t3, TL_PRODUCT t2, TL_CUSTOMER t1
              WHERE (
                   (t2.PRODUCT_NAME = ?) AND
                   ((t2.PRODUCT_ID = t3.PRODUCT_ID) AND
                        ((t3.ORDER_ID = t4.ORDER_ID) AND (t4.CUSTOMER_ID = t1.CUSTOMER_ID)))))))
    Regards

  • How to build MDX query for two periods of time?

    I have the following MDX:
    SELECT NON EMPTY
    [Measures].[Returns],
    [Measures].[Returns]
    ON COLUMNS,
    NON EMPTY
    ([Employees].[Company].[Company].ALLMEMBERS )
    DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
    FROM
    SELECT
    STRTOSET("[Exec Date].[Hierarchy].[Month Num].&[2014]&[1]", CONSTRAINED)
    ) ON COLUMNS FROM [cbSales]
    WHERE
    IIF(
    STRTOSET("[Exec Date].[Hierarchy].[Month Num].&[2014]&[1]", CONSTRAINED).Count = 1,
    STRTOSET("[Exec Date].[Hierarchy].[Month Num].&[2014]&[1]", CONSTRAINED),
    [Exec Date].[Hierarchy].currentmember
    Both columns shows returned data for month 2014/01
    I want to have data for the next month (2014/02) in the second column.
    How can I change the query to achieve my goal.

    Hi,
    To achieve this you need to create another measure with the help of ParallelPeriod function. Check the following example;
    WITH MEMBER [Measures].[Sales Amount Current] AS [Measures].[Sales Amount]
    MEMBER [Measures].[Sales Amount Next] AS ([Measures].[Sales Amount], PARALLELPERIOD([Date].[Calendar].[Month],-1, [Date].[Calendar].CURRENTMEMBER)), format_string = "Currency"
    MEMBER [Measures].[Current Month] AS [Date].[Calendar].CURRENTMEMBER.Member_Caption
    MEMBER [Measures].[Next Month] AS PARALLELPERIOD([Date].[Calendar].[Month],-1, [Date].[Calendar].CURRENTMEMBER).Member_Caption
    SELECT {[Measures].[Current Month], [Measures].[Sales Amount Current], [Measures].[Next Month], [Measures].[Sales Amount Next]} ON COLUMNS,
    {[Product].[Category].[Category].MEMBERS} ON ROWS
    FROM [Adventure Works]
    WHERE [Date].[Calendar].[Month].&[2007]&[10]
    For ParallelPeriod specify -1 for "Numeric Expression" to navigate forward of the date hierarchy.
    Best regards,
    Chandima
    Thanks, nice answer

  • How to build a query across parent and child object fields?

    As a part of an Integration Requirement, I need to query Opportunity records that have been Modified after a specific date and time?
    Now, Opportunity has a child object called ProductRevenue with a one to many relationship. Is there anyway I can construct a querypage that will fetch records whose Opportunity fields 'OR' its child ProductRevenue's fields have been modified after a specific date and time?
    I have tried using the SearchSpec argument, but it does not let me query across child object fields.
    For eg:-
    ObjOpptyQueryPageInput.ListOfOpportunity.Opportunity.searchspec = "([ModifiedDate] > '01/01/2013 00:00:00') OR ([ProductRevenueData.ModifiedDate] >= '01/01/2013 00:00:00')";
    [This above code written in C# thew me an error saying - The object Opportunity does not have an integration component called - ProductRevenueData.ModifiedDate.]
    Any help will be greatly appreciated. Thank you.

    Hi,
    As far as I know this can't be done at once because you have to consider :
    - Every Opportunity and their time-limited ProductRevenues
    AND
    - Time-limited Opportunities
    If you want to achieve this, you have to consider the 2 datasets separately and make your first query :
    ObjOpptyQueryPageInput.ListOfOpportunity.Opportunity.searchspec = "([ModifiedDate] >= '01/01/2013 00:00:00')";
    but also another query with the restriction on the ProductRevenue Searchspec.
    This shouldn't be too hard because the searchspec functionality is present at each level :
    - ListOfOpportunity -> Opportunity (the top-level that you used for your query)
    - ListOfOpportunity -> Opportunity -> ListOfProductRevenue -> ProductRevenue (the sub-level that you should use for the second query)
    Then in your C# code, you merge the 2 datasets and you end up with your expected result.
    Hope this helps,
    Charles.
    http://www.dubant.com

  • Building recordset query dynamically based on form parameter availability

    Hi,
    I have a real estate property table that I'd like to query.
    The form itself let's the user search by state, county, zip code
    etc. The user need not enter all the information. For eg: If the
    user just selects a state and searches, I should list all
    properties that belong to that state. But if the user also selects
    a county along with state then I should filter the results by state
    AND county. This situation applies for a lot of the form
    parameters.
    Now, in Dreamweaver when I try to create a recordset, I want
    to append
    AND county = $_REQUEST['county']
    to the end of my record set query if and only if the user
    selected a county. If the user didn't select the county, I do not
    want to have that as part of my query.
    Is there an easy way to do this in DW? I understand that
    variables let you define a default var. I donot even want to
    specify a default value.
    Any help is greatly appreciated.
    Thanks!!

    You'll have to write the code yourself but something like
    this...
    sqlString = "SELECT .... "
    if user selects county (probably a drop down list) then
    sqlString = sqlString + " AND county = " + $_REQUEST
    then just send the sqlString to the server.
    "flash0777" <[email protected]> wrote in
    message
    news:e40b1o$bok$[email protected]..
    > Hi,
    >
    > I have a real estate property table that I'd like to
    query. The form
    > itself
    > let's the user search by state, county, zip code etc.
    The user need not
    > enter
    > all the information. For eg: If the user just selects a
    state and
    > searches, I
    > should list all properties that belong to that state.
    But if the user also
    > selects a county along with state then I should filter
    the results by
    > state AND
    > county. This situation applies for a lot of the form
    parameters.
    >
    > Now, in Dreamweaver when I try to create a recordset, I
    want to append
    > AND county = $_REQUEST
    > to the end of my record set query if and only if the
    user selected a
    > county.
    > If the user didn't select the county, I do not want to
    have that as part
    > of my
    > query.
    >
    > Is there an easy way to do this in DW? I understand that
    variables let you
    > define a default var. I donot even want to specify a
    default value.
    >
    > Any help is greatly appreciated.
    >
    > Thanks!!
    >

  • How to Build Aging Query

    select ct_no,sum(due_amt)ovd_30,to_number(null)ovd_60 from le_dues
    where ct_no=3000
    and due_date between TO_DATE('1-NOV-2007' )and  TO_DATE('1-NOV-2007')+30
    group by ct_no
    union
    select ct_no,to_number(null)ovd_30 ,sum(due_amt)ovd_60 from le_dues
    where ct_no=3000
    and due_date between TO_DATE('1-NOV-2007' )+31 and  TO_DATE('1-NOV-2007')+60
    group by ct_noout put
        CT_NO    OVD_30    OVD_60
         3000     20260
         3000               20260I want out put like that
        CT_NO    OVD_30    OVD_60
         3000     20260    20260How can this possible plz help me
    Regards
    Danish Hayder

    In this case your group condition is only the number ct_no. Then you must derive the correct sum for each column. One possibility is to use a case expression to restrict the sum to the appropriate rows.
    The following code snipplet might give you an idea.
    select ct_no,
           sum(case when due_date between TO_DATE('1-NOV-2007')    and  TO_DATE('1-NOV-2007')+30 then due_amt else 0 end) ovd_30,
           sum(case when due_date between TO_DATE('1-NOV-2007')+31 and  TO_DATE('1-NOV-2007')+60 then due_amt else 0 end) ovd_60
    from le_dues
    where ct_no=3000
    and due_date between TO_DATE('1-NOV-2007' ) and  TO_DATE('1-NOV-2007')+30
    group by ct_noI would also change a few other things in this code.
    1) Use a date format mask
    2) A date value has a time component. You would miss rows that are due on (01-Nov-2007 14:37) + 30
    Message was edited by:
    Sven W.
    Message was edited by:
    Sven W.

  • How to build dynamic query strings in the query using DB adapter 'Pure SQL'

    Dear Forum,
    I am building an application which will access DB to fetch some result set. The query involves retrieving data from multiple tables(nearly 10 tables). So I have created a DB adapter using 'execute pure sql' option. With this query works fine, but my inputs parameters will vary. So I need to make my query dynamic to append the query strings at runtime depending on the inputs.
    For example I have 3 input variables - input1,input2 and input3 (in my request xsd) which are used in the pure sql query. Now if I get a 4th input parameter input4 in the request, I need to append this to query string as 'AND input4=[some value]' at runtime. Otherwise my query should have only 3 parameters. Please suggest how this can be achieved.
    Regards,
    Satya.

    This is a strange requirement, depending on the columns you have and what are optional in them, one way is to have separate operations and each opeartion will have different inputs and for each operation , a different DB Adapter is called. But this way, it results in more number of operations for the service as well as more number of references in the composite. Even if you pass the column inputs to the SQL procedure, it will result in a large number of if-else cases..
    Thanks,
    N

Maybe you are looking for

  • Old External drive into a 2nd internal slave?

    I have a G-Tech 250GB external drive that I can not get to spin up. It gets power, as indicated by the light working, but won't spin up. I've been told this could be an issue with the power adapter not giving it ENOUGH power. So my question is, can I

  • 10.6.7 Combo

    Installed 10.6.7 Combo on my early 2009 MBP 13" (Base model). No install problems, ran Repair Permissions. Definitely seems "snappier", and Safari seems a bit quicker to open web pages and a bit smoother scrolling after opening pages (but still not i

  • Do I have to have a credit card tied to the account even if I have itunes money

    do I have to have a credit card tied to the account even if I have itunes money

  • Amx:inputdate changing month after its selected

    I've tried this in a few different adf mobile apps now, including the sample HR app. On iOS, if the current date is for example 31 October 2013 which is what comes up in the select wheel of the inputdate when I go to enter something, if I select a da

  • Newbie:  Help with Interactive Movie Clips

    I'm just starting off with Indesign and am already running into an issue on a seemingly simple issue.  I'm trying to create an interactive document that I will play movie clips when exported to pdf.  Ok so far so good.  I've inserted one movie and st