REP 300 error when using dynamic where clause

Hi,
I am developing a report and I need a dynamic where clause.The code I have written in the where clause is as below
function where_clauseFormula return VARCHAR2 is
begin
if :P_PO_REQD = 'No' then
return ('and pha.segment1 is null');
elsif :P_PO_REQD = 'Yes' then
     return('and pha.segment1 between NVL(:p_po_num_from,1) and NVL(:p_po_num_to,99999999999999999)');
else return NULL;
end if;
end;
Now if i directly use either of the conditions in my report query it works fine.But if the parameter is No then the where clause does not work.I have also tried different statements in the if clause of the 'No' part and they work.For example the following code works when :P_PO_REQD is 'No' :
function where_clauseFormula return VARCHAR2 is
begin
if :P_PO_REQD = 'No' then
return ('and pha.segment1 between NVL(:p_po_num_from,1) and NVL(:p_po_num_to,99999999999999999)');
elsif :P_PO_REQD = 'Yes' then
     return('and pha.segment1 between NVL(:p_po_num_from,1) and NVL(:p_po_num_to,99999999999999999)');
else return NULL;
end if;
end;
I don't know why this is happening.I really need a solution or a workaround urgently
Thanks
Mukund

You may use Lexical Reference for the dynamic where. In After Parameter Form Trigger, code....
if :P_PO_REQD = 'No' then
:P_where := :P_where || 'and pha.segment1 is null';
elsif :P_PO_REQD = 'Yes' then
:P_where := :P_where || 'and pha.segment1 between NVL(:p_po_num_from,1) and NVL(:p_po_num_to,99999999999999999)';
end if;
..........

Similar Messages

  • REP-0069 error when using static includes.

    I am trying to use static include files in my report JSP file. Such as...
    <%@ include file="ServerName.jsp" %>
    Although they seem to work when I run the report, Report Builder doesn't like them. When I open the report in Report Builder I get an REP-0069 error. When I then try to display the data model it is blank. If I remove the static include the report opens fine. Beans also have this same problem.
    Dynamic includes don't generate an message. However, scriptlette variables set in the included file are not visiable to the including file.
    Jim

    Hi Jim
    I tried this with Reports 9.0.2 latest patch. When a open a .jsp report where I have put a statis include tag, I get a builder crash. I am filing a bug on this. Please let me know your mail address, I would update you once the issue is resolved.
    Thanks
    Rohit
    Oracle Reports Team

  • Warp Stabilizer error when using dynamic link

    Hey guys,
    So I'm very new to video editing, and not surprisingly, I'm running into problems.  I'm trying to use dynamic link to allow me to Warp Stabilize and color correct video clips in a Premiere Pro project.  When I try to apply the Warp Stabilizer (through dynamic link) in After Effects, I get this error message:
    After Effects error: Stabilization analysis doesn't work with Collapse Transformations (514)
    (25 :: 101)
    I read the only other thread on this which linked to the following page:
    http://help.adobe.com/en_US/AfterEffects/9.0/WS064964FC-424C-4e5a-A5C3-2160B3DFBCA4a.html
    Unfortunately, that didn't help me much.  Maybe the answer is in there somewhere, but if so, its way over my head.  Can anyone give me a simple explanation of why this doesn't work?  I feel like it should be a simple solution so I don't have to go through the process of importing into AE, render, export, import to Premeire Pro, and replace the clip there, blah blah.  This is what dynamic link is for, right??  Thanks for any advice you guys have!

    Not sure I properly understand you...
    As for me, the solution is in AE warning message - just disable Collapse Transformations switch in your AE precomp...

  • "HttpParam is undefined" JS error when using dynamic container in portal

    I am using dynamic container tag "*dc:container*" within an iterator in a pageflow portlet & I'm sending different parameter in each iteration, it worked well in IE7, but in FireFox, some of the rows were rendered & for the rest I received the following exception:
    DynamicContentXmlHttpServlet: Error dispatching request to requested action: '/src/com/loadFriendRatePlan'.
    java.lang.NullPointerException
         at com.bea.apps.groupspace.servlets.DynamicContentXmlHttpServlet.service(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
         at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:359)
         at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
         at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
         at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
         at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67)
         at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
         at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
         at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
         at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
         at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
         at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
         at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
         at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
         at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
         at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
         at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
         at selfcare.portal.shared.web.security.sso.ClearTrustPreAuthenticatedProcessingFilter.doFilterHttp(ClearTrustPreAuthenticatedProcessingFilter.java:132)
         at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
         at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
         at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
         at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
         at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
    Note: every time i refresh the page different rows are rendered, which means that the non rendered rows have nothing to do with the parameter sent in each iteration.
    I've added the portlet to portal, & now nothing is rendered in both IE7 & FireFox, & "HttpParam is undefined" JavaScript error is displayed in both browsers.
    Note : my portlet "Async Content rendering" property is set to ajax, & the portal "Asynchronous Model" property to enabled.
    <h3>Here's sample of my tag code:</h3>
    <dc:executeContainerAction action="loadFriendRatePlan" dcContainerId="${container.index}"
         var="ratePlan"/>           
    <dc:container dcContainerId="${container.index}">     
         <dc:containerActionScript action="loadFriendRatePlan" initial="true"
              onErrorCallback="displayMessageNotAvailable">
              <dc:containerActionParam name="friendAccount" value="${container.item.accountNumber}"/>
              <dc:containerActionParam name="friendContractType" value="${container.item.contractType}"/>                         
         </dc:containerActionScript>
    </dc:container>
    <script type="text/javascript">
         ${ratePlan}
    </script>
    Any clue how can I solve both errors?

    Just so there is a record of this on the Adobe site...
    IF you are running Apache and have virtual hosts, be sure to add the line
    Alias /CFIDE "c:/inetpub/wwwroot/CFIDE"
    to the virtual host list. Of course change the path c:/inetpub/wwwroot/CFIDE" to whatever is set up in the CF Administrator.
    Otherwise, none of your cfform stuff will work properly, AJAX will croak,  and you will get a 'Coldfusion' is undefined error.

  • Compiler errors when using dynamic text in a class

    I have created a MovieClip with a custom class that has a dynamic text field (called "textArea"), which I want to modify by the Component Inspector, as well as via a custom method using:
    textArea.text = newText;
    It works fine in all cases and there are no problems, but the compiler still wants to give me the error:
    1120: Access of undefined property textArea.
    The error doesn't appear when I remove the component parameters (so that it's just a normal MovieClip). It still works, even with the error, so I'm not sure why it wants to complain. Am I doing something wrong or is it just being bitchy?

    By defining them in the class and using the class name under component definition:
    [Inspectable(name="Text", type=String, defaultValue="")]
    public function set text(setText:String)
         textArea.text = setText;
    public function get text():String
         return textArea.text;
    A problem I run into is that the compiler errors prevent the parameters from being defined so I comment out every line that has to do with textArea, define the component, then uncomment them so that it'll work when it runs.

  • JSP Compile Error when using dynamic ID in logic:iterate and bean:size

    Hello,
    I try to create a dynamic table with logic:iterate and bean:size tag. Dynamic means the attributes are written by scriptlet. Eg.:
    <logic:iterate id="customerBean" name="<%= formName %>"  property="<%= propertyName%>" length="<%= sRowSize%>">When I replace the id Attribute with propertyName I get compile errors, such as
    the compiler doesn't know the value at runtime:
    Unable to compile class for JSP An error occurred at line: 179 in the jsp file: /pages/formContent.jsp Generated servlet error: _newCustomer.java:1046: Missing term. java.lang.Object <%= propertyName %> = null; ^
    Whats wrong ?
    Thanks for your help

    Solution: don't use a runtime expression for the id attribute.
    The id attribute is used to declare
    - an attribute in scope
    - a scriptlet variable on the page
    These are only available for the duration of the <logic:iterate> tag
    The "id" is only used in your programming. You don't need to make it dynamic.

  • REP-0713 error when using r25run32 and command line

    Help,
    I have what seems to be a very strange problem. I have the following
    command line saved as a batch file called Test.bat. If I double-click on it
    or run it from the command prompt, it works fine - it runs a report and
    prints it.
    d:\orant\bin\r25run32.exe report=test1.rep userid=user1/user1@testdb
    paramform=no destype=printer desname="HP" desformat=dflt printjob=no
    However, if I use a program scheduler, it crashes with the error:
    "REP-0713: Invalid printer name 'HP' specified by parameter name DESNAME"
    I have tried Norton Scheduler, NT AT command, as well as a couple other
    shareware programs. All crash with this error. If I use background=yes,
    again it works if I run it, but when a scheduler starts it, the Report
    Server crashes. Instead, if I use batch=yes, it just crashes after a few
    seconds.
    If I use printjob=yes, the printer dialog pops up, I press OK, and it works
    fine. I have tried outputting to a PDF file, but again, it works if I run
    the batch file, but not when a scheduler does.
    I am using Reports 2.5, Oracle 7.1, NT4 SP6. I have also tried the Reports
    3.0 runtime (r30run32) with the same results. I just need to run/print a
    report automatically every day.
    Any ideas are greatly appreciated, Thanks.
    Jason
    null

    I just concatenate them , for example if my key fields of the table are document number and item number , i concatenate them and put it in the key_column.
    How do i read them in my oninputprocessing.
    data: tv type ref to cl_htmlb_tableview.
      tv ?= cl_htmlb_manager=>get_data(
                              request      = runtime->server->request
                              name         = 'tableView'
                              id           = 'test' ).
      if tv is not initial.
        data: tv_data type ref to cl_htmlb_event_tableview.
        tv_data = tv->data.
    <document no.> = tv_data->selectedrowkey+0(10) .
    <item no.>   = tv_data->selectedrowkey+10(5) .
    if i need more info then i read the itab with key document number = <document no.> and
    item number     = <item no.>
    Hope this is clear.
    Regards
    Raja

  • Bind variable error while adding dynamic where clause to VO query

    hi
    i have extended a VO and in the VOImpl i have written the following code
    public class HzPuiClassificationListVOExImpl extends HzPuiClassificationListVOImpl
    public void initQuery(String partyId, String s1, String classCode)
    /* Logging Code*/
    if(this.isLoggingEnabled(OAFwkConstants.PROCEDURE))
    {this.writeDiagnostics(this," > initQuery() , partyId ="+partyId+" , s1 ="+s1+", classCode="+classCode,OAFwkConstants.PROCEDURE);}
    setWhereClauseParams(null);
    setWhereClauseParam(0, classCode);
    setWhereClauseParam(1, classCode);
    setWhereClauseParam(2, partyId);
    String query = super.getQuery();
    * Check if the whereClause is already present
    if(query!=null && query.toUpperCase().indexOf("AAAAA") == -1)
    OAApplicationModule am = (OAApplicationModule)this.getApplicationModule();
    OADBTransaction oadbTxn = am.getOADBTransaction();
    String whereClause = "   class_category IN ("+
    *" SELECT flv.lookup_code"+*
    *" FROM fnd_lookup_values flv, fnd_lookup_values_dfv dfv"+*
    *" WHERE flv.rowid = dfv.row_id"+*
    *" AND flv.lookup_type = 'XXXXX'"+*
    *" AND dfv.context_value = flv.lookup_type"+*
    *" AND dfv.oco_enabled = 'Y' "+*
    this.addWhereClause(whereClause);
    this.executeQuery();
    * This is the default constructor (do not remove)
    public HzPuiClassificationListVOExImpl()
    when i run the page i get this error
    java.sql.SQLException: Missing IN or OUT parameter at index:: 2
    the original vo query below has 3 bind variables
    SELECT *
    FROM (SELECT *
    FROM (SELECT cc.class_category
    ,l.meaning
    FROM hz_class_categories cc
    ,fnd_lookup_types_vl l
    WHERE cc.class_category = l.lookup_type
    AND l.view_application_id = 222
    AND EXISTS (
    SELECT NULL
    FROM hz_code_assignments ca
    WHERE ca.owner_table_name = 'HZ_CLASS_CATEGORIES'
    AND ca.owner_table_id IS NULL
    AND ca.owner_table_key_1 = cc.class_category
    AND ca.class_category = 'CLASS_CATEGORY_GROUP'
    AND ca.class_code = :1
    AND NVL (ca.status, 'A') = 'A'
    AND SYSDATE BETWEEN ca.start_date_active AND NVL (ca.end_date_active, SYSDATE + 1))
    UNION ALL
    SELECT cc.class_category
    ,l.meaning
    FROM hz_class_categories cc
    ,fnd_lookup_types_vl l
    WHERE cc.class_category = l.lookup_type
    AND l.view_application_id = 222
    AND 'INDUSTRIAL_GROUP' <> :2
    AND NOT EXISTS (
    SELECT NULL
    FROM hz_code_assignments ca
    WHERE ca.owner_table_name = 'HZ_CLASS_CATEGORIES'
    AND ca.owner_table_id IS NULL
    AND ca.owner_table_key_1 = cc.class_category
    AND ca.class_category = 'CLASS_CATEGORY_GROUP'
    AND NVL (ca.status, 'A') = 'A'
    AND SYSDATE BETWEEN ca.start_date_active AND NVL (ca.end_date_active, SYSDATE + 1))
    AND hz_classification_v2pub.is_valid_category ('HZ_PARTIES'
    ,cc.class_category
    ,:3) = 'T') a
    WHERE EXISTS (
    SELECT NULL
    FROM hz_class_code_denorm
    WHERE class_category = a.class_category
    AND TRUNC (SYSDATE) BETWEEN NVL (start_date_active, TRUNC (SYSDATE)) AND NVL (end_date_active, TRUNC (SYSDATE))
    AND enabled_flag = 'Y'
    AND LANGUAGE = USERENV ('LANG'))) qrslt
    A similar error was discussed at this link but it did not give final solution
    [http://kr.forums.oracle.com/forums/thread.jspa?threadID=618451]
    help me to solve this issue..
    Thanks,
    Varun
    Edited by: user10707840 on May 19, 2009 7:18 AM

    its not the AM code .. its the code in VOImpl...
    the same code is working in 11i but when its migrated to R12 its giving this error..
    The original seeded VO query in 11i contains the same bind variable :1 at three places
    SELECT * FROM (select class_category, meaning from hz_class_categories, fnd_lookup_types_vl l where hz_class_categories.class_category = l.lookup_type and l.view_application_id = 222 and class_category in (select owner_table_key_1 from hz_code_assignments ca where ca.owner_table_name = 'HZ_CLASS_CATEGORIES' and ca.owner_table_id is null and ca.class_category = 'CLASS_CATEGORY_GROUP' and ca.class_code = :1 and nvl(ca.status, 'A') = 'A' and sysdate between ca.start_date_active and nvl(ca.end_date_active, sysdate+1)) union all select cc.class_category , meaning from hz_class_categories cc, fnd_lookup_types_vl l, hz_class_category_uses cu where cc.CLASS_CATEGORY = cu.class_category AND ( UPPER(CU.ADDITIONAL_WHERE_CLAUSE) LIKE decode(:1, 'ORG_GROUP','%PARTY_TYPE%ORGANIZATION%', 'PERSON_GROUP', '%PARTY_TYPE%PERSON%', '%') or CU.ADDITIONAL_WHERE_CLAUSE IS NULL or UPPER(CU.ADDITIONAL_WHERE_CLAUSE) LIKE '%WHERE 1=1%' ) and cu.owner_table = 'HZ_PARTIES' and cc.class_category = l.lookup_type and l.view_application_id = 222 and cc.class_category not in (select owner_table_key_1 from hz_code_assignments hca where hca.owner_table_name = 'HZ_CLASS_CATEGORIES' and hca.owner_table_id is null and hca.class_category = 'CLASS_CATEGORY_GROUP' and nvl(hca.status, 'A') = 'A' and sysdate between hca.start_date_active and nvl(hca.end_date_active, sysdate+1)) and cc.class_category not in ( 'RELATIONSHIP_TYPE_GROUP', 'CLASS_CATEGORY_GROUP') and 'INDUSTRIAL_GROUP' <> :1) QRSLT ORDER BY meaning
    the code working in 11i had only one setWhereClauseParam line i.e. setWhereClauseParam(0, classCode);
    when i ran the same code in R12 it errd out..
    I checked the original R12 query... it has 3 bind variables :1 , :2 and :3 ... so i added 2 more setWhereClauseParam statements
    setWhereClauseParam(1, classCode);
    setWhereClauseParam(2, partyId);
    but still its giving the same error
    ORIGINAL R12 query already posted above...

  • REPORT with dynamic WHERE CLAUSE (run RDF or REP) ?

    Hi:
    When running a REPORT (myreport.rep) with dynamic where clause using a lexical parameter, I got this error:
    REP-1439: Cannot compile .REP or .PLX file as it does not have source
    If i run the report specifiying RDF extension (myreport.rdf) the report run successfully! Is this normal ?
    If I specify RDF extension will Report Server COMPILE the report everytime I execute it ?
    When using dynamic WHERE CLAUSE I will have to run RDF files instead of REP ?
    I'm running Reports 9i under Linux, with IDS under Windows.
    Waiting Help
    Joao Oliveira

    It sounds like you are building the .rep files on one platform (windows) and running them on another (linux). The reason that the .rdf file continues to work is that Reports recompiles the PL/SQL within the report when you move from one platform to another or change schemas. .rep files can't be re-compiled in this way so you need to ensure they are compiled successfully when converting them.
    You need to convert from .rdf to .rep on the platform that you are intending to run on. Try running rwconverter on the linux platform with "compile_all=yes" to produce the .rep file and running that .rep file.

  • Loop with dynamic where clause

    hi,
        In a program we need to use a loop into an internal table with a where condition is decided on run time.
    "Select" from database table is using dynamic where clause and it is working fine.
    For the loop part does any one have any idea on this? if we can have dynamic where clause in a loop into internal tab?
    Thanks

    Hi,
    You can't use 'loop where' dynamically  .
    Have you already tried to use Ranges and CHECK statement?
    Like:
    First mount range options;
    Loop at <table>.
    Check using the range.
    endloop.
    Maybe it's works for you !!
    Marcelo Ramos

  • ADF dynamic where clause for VO query using BC

    I'm hoping someone can help me out. I have a read only view object that I want to filter results based on some user choices. For example the user may want to see all results or they may only want to see a much smaller subset. This is for an error dashboard, the smaller subset maybe by application or maybe by application and by error severity. I think I can use a dynamic where clause but I'm not sure, Can someone get me started down the right path, or post an example that I can see.

    Hi user,
    You can use a dynamic where clause for this, but maybe there is a more practical option. Maybe you can have a fixed where clause, but using a bind parameter, like:
    vo.application like :applicationParam. This makes an executeWithParams method available that you can call from your page, and use in the bindings. This parameter you can populate with the results of for example a poplist, with a default value of '%'.
    When you do want to use a dynamic where clause, you will need to add a method to the java code of your application module, and make this method available for the client. In this method, you can use findViewObject to retrieve your VO, use VO.setWhereClause to set the whereclause to what you want, and then call VO.executeQuery. This method can then again be called from the page.
    Success,
    Jeroen van Veldhuizen

  • ORA-306500 error when using EXEC_SQL? [SOLVED]

    I used Francois Degrelle's example of doing a dynamic where clause to create a procedure using the EXEC_SQL package to get various counts from a table with different where clauses. Everything works for all the where clauses except when I try a date comparison I get the ORA-306500 error. The where clause I'm using takes 2 screen date fields:
    'WHERE date_column BETWEEN ' || :date_field1 || ' AND ' || :date_field2
    Anybody know what is causing this error?

    you forgot the to_date in the dynamic part.
    what you pass to sql engine now is
    where date_column between 10-FEB-2008 and 11-FEB-2008
    don't think this would work...
    what you need is:
    where date_column between to_date('10-FEB-2008', 'DD-MON-RRRR') and .....
    so you have to do some type conversions:
    first of all convert in your form your date variable to a string with known format:
    => to_char(:date_field, 'DD-MON-RRRR')
    now you have a string which looks like this:
    '10-FEB-2008'
    then let's go over to the dynamic part:
    you want to restrict your where clause on date values, so when restricting with specific strings (the string from above), you have to convert it to a date datatype with to date.
    so, this would look like this (as mentioned in my last post):
    '.....between to_date(''''||to_char(:date_field1, 'dd-mon-rrrr')||''', ''dd-mon-rrrr'') and ..... '
    best thing would be to display your query, and pass it in sqlplus as long it won't work ;-).
    regards

  • How to add a dynamic where clause for a sql based VO with group by query?

    Hi,
    Here is my case, I have a sql query based VO with the query like "select status, count(*) StatusCount from my_table group by status". Now I used the following java code trying to dynamically add the where clause to my VO to filter the rows based the type attribute in my DB table.
    vo.setWhereClause("type='MyType1' ");
    vo.executeQuery();
    Then I got the sql syntax error. Looks like the ADF has added the where clause to the end of my sql so my sql becomes "select status, count(*) StatusCount from my_table group by status where type='MyType1' ". But what I expected was the correct syntax "select status, count(*) StatusCount from my_table where type='MyType1' group by status".
    Does anyone know if this is an ADF bug? Or is there any other way to achieve my goal?
    Thanks,
    Chunyang
    Edited by: Chunyang on Dec 13, 2012 9:09 PM

    Hi,
    When you use setWhereClause on the VO, it is applied on top of the VO query. I.e, assume your VO has the following query.
    select empno, ename from empNow, if you apply the where clause programatically, only the two attributes that you are using in the select statement could be used. I.e
    select * from (select empno, ename from emp) where ename='KING' - VALID
    select * from (select empno, ename from emp) where deptno=10  - INVALID (because the inner query - the one you've defined as query for your vo does not have deptno attribute selected)If you would need to set a dynamic where clause, you need to make them available in your select statement / use bind variables.
    -Arun

  • Dynamic Where Clause - How To?

    I need help building a dynamic where clause in 1.6
    I have three fields:
    p1_col_where which is a static list of 8 columns
    p1_condition which is a static list of the 9 possible conditions(=,<,>...)
    p1_condition_value is a text field that the user enters the literal they want to use
    The lov select I thought would be:
    SELECT Description, positem
    FROM v_item
    WHERE :P1_COL_WHERE :P1_CONDITION :P1_CONDITION_VALUE
    I was hoping that this would be resolved to: WHERE item = 123
    but of course I get a big NASTY error.
    Can someone help me out?
    Thanks,
    Joe

    Mike,
    Thanks for the help.
    There's a problem in the docs for creating this popup on step 5. The docs say:
    Step 5 - Add the LOV report to the popup page
    select ename, job, sal , 'placeholder' the_link
    from emp
    where ename like '%'||:P2_ENAME||'%'
    and (job = :P2_JOB or :P2_JOB is null)
    and (sal = :P2_SAL or :P2_SAL is null)
    Note that the last column in this query is just a placeholder. once the region is created, turn that placeholder into a link by doing the following:
    1.     Navigate to the Page Definition for page 2
    2.     Next to the name of the report region created in step 5, Click Q
    3.     Next to the column THE_LINK, click the edit icon
    4.     In the "Link Text" field enter the string "select"
    5.     In the URL field enter: javascript:passBack('#ENAME#','#JOB#','#SAL#');
    6.     Click the "Apply Changes" button
    The problem is in number 5. There is NO URL field to enter that code. Where does it go?
    Also, your alternative method:
    IF :P1_COL_WHERE is null then
    RETURN 'SELECT Description, positem FROM v_item';
    ELSE
    RETURN 'SELECT Description, positem FROM v_item '||
    ' WHERE '||:P1_COL_WHERE||' '||:P1_CONDITION||' '||:P1_CONDITION_VALUE;
    END IF;
    With a 'GO' button is the method that I was trying. That's what gave me the error when the page loaded.
    Any assistance is greatly appreciated.
    Thanks,
    Joe

  • About dynamic  where clause

    hi
    on Jdev 11.1.2.3.0
    Imade dynamic search (where clause)
    It woks fine with me
    but I want to be sure from the best way to do that
    the ideia is to run search according to what is the user chose
    on (Hr) schema employees table
    the end user could search according to departmentID only
    or job id only or both of them or display all employees taable data if there are no seletion
    I used
    this.setWhereClause( );
    this.defineNamedWhereClauseParam();
    this.setNamedWhereClauseParam();
    methods in employeesImpl and I revale it to the client interface to display two text boxes and a button
    my full code is
    ================
    public void setwhereClause(String jobid ,String departmentId ) {
    if (jobid==null & departmentId ==null) {
    this.skipNamedWhereClauseParam ("P_DEPARTMENT_ID");
    this.skipNamedWhereClauseParam("P_jobid");
    this.setWhereClause("1=1");
    this.executeQuery();
    if (jobid==null & departmentId !=null) {
    this.setWhereClause("EmployeesEo.DEPARTMENT_ID =:P_DEPARTMENT_ID");
    this.defineNamedWhereClauseParam("P_DEPARTMENT_ID", null, null);
    this.setNamedWhereClauseParam("P_DEPARTMENT_ID",departmentId );
    this.skipNamedWhereClauseParam("P_jobid");
    this.executeQuery();
    if (jobid!=null & departmentId ==null) {
    this.setWhereClause("EmployeesEo.JOB_ID=:P_jobid ");
    this.defineNamedWhereClauseParam("P_jobid", null, null);
    this.setNamedWhereClauseParam("P_jobid",jobid );
    this.skipNamedWhereClauseParam ("P_DEPARTMENT_ID");
    this.executeQuery();
    if (jobid!=null & departmentId !=null)
    this.setWhereClause( "EmployeesEo.JOB_ID=:P_jobid and EmployeesEo.DEPARTMENT_ID =:P_DEPARTMENT_ID " );
    this.defineNamedWhereClauseParam("P_DEPARTMENT_ID", null, null);
    this.setNamedWhereClauseParam("P_DEPARTMENT_ID",departmentId );
    this.defineNamedWhereClauseParam("P_jobid", null, null);
    this.setNamedWhereClauseParam("P_jobid",jobid );
    this.executeQuery();
    ==========================================
    but Iwas geting error when I run the search For the First Time only without selecting any thing
    the error wase about ( attempt to define parameter which is not in the where clause)
    one time for both variable if there are no selection
    anothe for the P_DEPARTMENT_ID when I search for job
    and the oposet for P_jobid when I search for department
    so why this eror came despite of IF Statment existance
    and why when I run search for both parameter job and departemnt
    next time i search for all data or department only or job only
    the error dosnot come again
    Isuccesd to avoide this error by adding P_DEPARTMENT_ID and P_jobid
    as bind varable in the same names for the employeesVo
    note
    (Idont want to use view Criteria for a segnificant reason)
    and becasue Ineed to pass varaible to open a report_
    in the same way user search_
    and Ican't catch bindings for the view criteria_
    my qusetions
    1-Is what i Did is the correct way I mean adding the binde varable visicaly to SQL tab In the EmployeesVO
    2- why is the error of ( attempt to define paramter not iexist in the where clause mainwhile the If Statment condition dosnot succesd)
    3- how to add bindig variable programaticly without adding it phisicaly in the EmployeesVo SQL

    Duplicate to about dynamic  where clause
    User, please don't post the same question multiple times in this forum.
    Timo

Maybe you are looking for

  • Text disappearing and reappearing InDesign CC

    Hi there, this being my 1st post please excuse any errors in eticate... I have an issue within InDesign CC when editing text in text boxes. Intermitently it seems that when highlighting text it seems to dissapear before oyu can edit it, BUT it is in

  • Bought an iphone 5 that has a icloud activation lock

    I bought an iphone from a friend from school and he said his brother gave him the phone so i bought it and when i turned it on and put my sim in the phone it went to an icloud password and id screen .. so i call him and i get no answer so i wait it o

  • Exporting iPhoto Slideshow Colour problems

    When using the slideshow function in iPhoto 09 using the snapshot theme, it is causing issues with the colours on the Photos when exported. On the exported slideshow, when a new photo appears on a snapshot it looks fine, then just before the next sna

  • Customer deposit interest

    HI SAP GURUS, How to calculate Customer security deposit interest calculation in the year end for closing of yaer end plz let me know urgent Thanks , jyotsna

  • Blue tooth

    After installing the Yosemite update on my MacBook Pro with retina display, the blue tooth mouse doesn't work anymore. Sometimes it connects but is has a delay and after a short time less than a minut the mouse is disconnected. I see more people have