Query with bind var created under apex to generate xml data

Hi all;
BiP: 10.1.3.4
Apex: 4
DB 10G
Goal: want to generate a report by running a query with bind variables under apex.
problem: when attempted to create a query under shared components in apex, at the downloading xml data stage, I always get "no data found" eror. Thus I can't save xml data for further report work. This only occurs when bind var involved. I have tticked "incl. session variables" and added the item but to no avail.
Does anyone know how to do this and get the xml data to recive the bind variable ?
Thanks.
lulu

To get the xml data, sql query has to return something. Why the sql is not returning anything can be better investigated outside the BI Publisher with special tool like SQL Developer or TOAD. There you have to run your query and make it working. One of the steps would be to try the sql without the parameter, see what data it brings back and go from there. One of possibilities why the parameter kills the output may be the NULL values involved, but you need to try the sql outside the BIP first.

Similar Messages

  • Oracle 10g Diff in execution plan query with binding var Vs without

    We recently did 10g upgrade. In 10g, execution plan differs for query with binding var(thru jdbc etc) Vs without it as given below. For query with binding var,
    it chooses poor execution plan(no index is used, full scan is done etc). everything worked fine in 9i. To rectify the problem, we have to hint query with right index,join etc. but i dont like this solution.
    I would rather prefer to correct database to choose right execution path instead of eacy query level. but not sure what causes the issue.
    Does anybody came across this issue? if so, Please share your experiences. Thanks for the help. Do let me know if you need more info.
    1. Query without binding bar:
    select * from test where col1 = :1 and col2 = :2
    1. Query without binding bar:
    select * from test where col1 = 'foo' and col2= 'bar'

    I am not an expert but in my humble opinion it is the developer's responsability to ensure the correct explain plan is used before deploying code to production, if the explain plan returned by the DB is bad, then the use of a hint is perfectly acceptable.
    Check this out: http://lcgapp.cern.ch/project/CondDB/snapshot/performance.html
    Excerpt:
    Bind variable peeking. If an SQL query contains bind variables, the optimal execution plan may depend on the values of those variables. When the Oracle query optimizer chooses the execution plan for such a query, it may indeed look at the values of all bind variables involved: this is known as "bind variable peeking".
    In summary, the execution plan used for a given SQL query cannot be predicted a priori because it depends on the presence and quality of statistics and on the values of bind variables used at the time the query was first executed (hard-parsed). As a consequence of this instability of execution plans, very different performances may be observed for the same SQL query. In COOL, this issue is addressed by adding Oracle hints to the queries, to make sure that the same (good) plan is used in all cases, even with unreliable statistics or unfavourable bind variables.
    Edited by: Rodolfo Ferrari on Jun 3, 2009 9:40 PM

  • Report query with bind variable

    Trying to create a report query for xsl-fo print. For output format I pick "derive from item" then pick the item name from the list, on the next screen, I paste the query with the bind variable. on the next step test query, I always get "data not found" regardless what value I type in. This is the same query that I ran under sql commands without any issues.
    Does anyone run into the same issue as I have when attempted to create a query with bind var ? There is no problem creating a query without bind varibles. . thanks.
    Munshar

    Hi, please did you get any solution to this issue? I am having similar challenge right now.
    select     EMP.DEPTNO as DEPTNO,
         DEPT.DNAME as DNAME,
         EMP.EMPNO as EMPNO,
         EMP.ENAME as ENAME,
         EMP.JOB as JOB,
         EMP.MGR as MGR,
         EMP.HIREDATE as HIREDATE,
         EMP.SAL as SAL
    from     SCOTT.DEPT DEPT,
         SCOTT.EMP EMP
    where EMP.DEPTNO=DEPT.DEPTNO
    and      DEPT.DNAME =upper(:dname)
    This run perfectly in sql developer, toad, and even inside publisher if I login directly to publisher to create report.
    Generating this same query in shared component query builder and testing it returns no data found. If I remove the last line, it works. but with the last line, it return no data found. It seems no one has been able to provide solution to this issue

  • Query with bind variable, how can use it in managed bean ?

    Hi
    I create query with bind variable (BindControlTextValue), this query return description of value that i set in BindControlTextValue variable, how can i use this query in managed bean? I need to set this value in String parameter in managed bean.
    Thanks

    Put the query in a VO and execute it the usual way.
    If you need to, you can write a parameterized method in VOImpl that executes the VO query with the parameter and then call that method from the UI (as a methodAction binding) either through the managed bean or via a direct button click on the page.

  • SQL query with Bind variable with slower execution plan

    I have a 'normal' sql select-insert statement (not using bind variable) and it yields the following execution plan:-
    Execution Plan
    0 INSERT STATEMENT Optimizer=CHOOSE (Cost=7 Card=1 Bytes=148)
    1 0 HASH JOIN (Cost=7 Card=1 Bytes=148)
    2 1 TABLE ACCESS (BY INDEX ROWID) OF 'TABLEA' (Cost=4 Card=1 Bytes=100)
    3 2 INDEX (RANGE SCAN) OF 'TABLEA_IDX_2' (NON-UNIQUE) (Cost=3 Card=1)
    4 1 INDEX (FAST FULL SCAN) OF 'TABLEB_IDX_003' (NON-UNIQUE)
    (Cost=2 Card=135 Bytes=6480)
    Statistics
    0 recursive calls
    18 db block gets
    15558 consistent gets
    47 physical reads
    9896 redo size
    423 bytes sent via SQL*Net to client
    1095 bytes received via SQL*Net from client
    3 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    55 rows processed
    I have the same query but instead running using bind variable (I test it with both oracle form and SQL*plus), it takes considerably longer with a different execution plan:-
    Execution Plan
    0 INSERT STATEMENT Optimizer=CHOOSE (Cost=407 Card=1 Bytes=148)
    1 0 TABLE ACCESS (BY INDEX ROWID) OF 'TABLEA' (Cost=3 Card=1 Bytes=100)
    2 1 NESTED LOOPS (Cost=407 Card=1 Bytes=148)
    3 2 INDEX (FAST FULL SCAN) OF TABLEB_IDX_003' (NON-UNIQUE) (Cost=2 Card=135 Bytes=6480)
    4 2 INDEX (RANGE SCAN) OF 'TABLEA_IDX_2' (NON-UNIQUE) (Cost=2 Card=1)
    Statistics
    0 recursive calls
    12 db block gets
    3003199 consistent gets
    54 physical reads
    9448 redo size
    423 bytes sent via SQL*Net to client
    1258 bytes received via SQL*Net from client
    3 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    55 rows processed
    TABLEA has around 3million record while TABLEB has 300 records. Is there anyway I can improve the speed of the sql query with bind variable? I have DBA Access to the database
    Regards
    Ivan

    Many thanks for your reply.
    I have run the statistic already for the both tableA and tableB as well all the indexes associated with both table (using dbms_stats, I am on 9i db ) but not the indexed columns.
    for table I use:-
    begin
    dbms_stats.gather_table_stats(ownname=> 'IVAN', tabname=> 'TABLEA', partname=> NULL);
    end;
    for index I use:-
    begin
    dbms_stats.gather_index_stats(ownname=> 'IVAN', indname=> 'TABLEB_IDX_003', partname=> NULL);
    end;
    Is it possible to show me a sample of how to collect statisc for INDEX columns stats?
    regards
    Ivan

  • Create collection from query with bind variable

    Apex 4.0.2
    Per Joel Re: Collection with bind variable the apex_collection.create_collection_from_query_b supports queries containing bind variable references (:P1_X) but I am not sure how to use this feature, the documentation doesn't have an example, just the API signature for the overloaded version has changed.
    If the query contains 2 bind variable references to session state (:P1_X and :P1_Y), can someone please show an example of what to pass in for the p_names and p_values parameters to the API?
    Thanks
    procedure create_collection_from_query_b(
        -- Create a named collection from the supplied query using bulk operations.  The query will
        -- be parsed as the application owner.  If a collection exists with the same name for the current
        -- user in the same session for the current Flow ID, an application error will be raised.
        -- This procedure uses bulk dynamic SQL to perform the fetch and insert operations into the named
        -- collection.  Two limitations are imposed by this procedure:
        --   1) The MD5 checksum for the member data will not be computed
        --   2) No column value in query p_query can exceed 2,000 bytes
        -- Arguments:
        --     p_collection_name   =  Name of collection.  Maximum length can be
        --                            255 bytes.  Note that collection_names are case-insensitive,
        --                            as the collection name will be converted to upper case
        --     p_query             =  Query to be executed which will populate the members of the
        --                            collection.  If p_query is numeric, it is assumed to be
        --                            a DBMS_SQL cursor.
        -- example(s):
        --     l_query := 'select make, model, caliber from firearms';
        --     apex_collection.create_collection_from_query_b( p_collection_name => 'Firearm', p_query => l_query );
        p_collection_name in varchar2,
        p_query           in varchar2,
        p_names           in wwv_flow_global.vc_arr2,
        p_values          in wwv_flow_global.vc_arr2,
        p_max_row_count   in number default null)
        ;

    VANJ wrote:
    Apex 4.0.2
    Per Joel Re: Collection with bind variable the apex_collection.create_collection_from_query_b supports queries containing bind variable references (:P1_X) but I am not sure how to use this feature, the documentation doesn't have an example, just the API signature for the overloaded version has changed.
    If the query contains 2 bind variable references to session state (:P1_X and :P1_Y), can someone please show an example of what to pass in for the p_names and p_values parameters to the API?Not tried it, but guessing something like
    apex_collection.create_collection_from_query_b(
        p_collection_name => 'foobar'
      , p_query => 'select f.foo_id, b.bar_id, b.baz from foo f, bar b where f.foo_id = b.foo_id and f.x = to_number(:p1_x) and b.y = :p1_y'
      , p_names => apex_util.string_to_table('p1_x:p1_y')
      , p_values => apex_util.string_to_table(v('p1_x') || ':' || v('p1_y')))

  • SQL Report query with condition (multiple parameters) in apex item?

    Hello all,
    I have a little problem and can't find a solution.
    I need to create reports based on a SQL query or I.R. Nothing hard there.
    Then I need to add the WHERE clause dynamically with javascript from an Apex item.
    Again not very hard. I defined an Apex item, set my query like this "SELECT * FROM MYTAB WHERE COL1 = :P1_SEARCH" and then I call the page setting the P1_SEARCH value. For instance COL1 is rowid. It works fine.
    But here is my problem. Let's consider that P1_SEARCH will contain several rowids and that I don't know the number of those values,
    (no I won't create a lot of items and build a query with so many OR!), I would like sotheming like "SELECT * FROM MYTAB WHERE ROWID IN (:P1_SEARCH) with something like : ROWID1,ROWID2 in P1_SEARCH.
    I also tried : 'ROWID1,ROWID2' and 'ROWID1','ROWID2'
    but I can't get anything else than filter error. It works with IN with one value but as soon as there are two values or more, it seems than Apex can't read the string.
    How could I do that, please?
    Thanks for your help.
    Max

    mnoscars wrote:
    But here is my problem. Let's consider that P1_SEARCH will contain several rowids and that I don't know the number of those values,
    (no I won't create a lot of items and build a query with so many OR!), I would like sotheming like "SELECT * FROM MYTAB WHERE ROWID IN (:P1_SEARCH) with something like : ROWID1,ROWID2 in P1_SEARCH.
    I also tried : 'ROWID1,ROWID2' and 'ROWID1','ROWID2'
    but I can't get anything else than filter error. It works with IN with one value but as soon as there are two values or more, it seems than Apex can't read the string.For a standard report, see +{message:id=9609120}+
    For an IR&mdash;and improved security avoiding the risk of SQL Injection&mdash;use a <a href="http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_collection.htm#CACFAICJ">collection</a> containing the values in a column instead of a CSV list:
    {code}
    SELECT * FROM MYTAB WHERE ROWID IN (SELECT c001 FROM apex_collections WHERE collection_name = 'P1_SEARCH')
    {code}
    (Please close duplicate threads spawned by your original question.)

  • How to add '%' to a query with bind variables

    Hi,
    I am using oracle jdeveloper 11g.
    I am trying to create a table to display rows using the below query in a jspx page,
    select * from ade_txns where series='WORKPLACE_PT.11.1.1.8.0_GENERIC' and transaction like 'rkumara%'
    I am using a view with query and binding variables as below,
    select * from ade_txns where series= :p_series and transaction like :p_QAEngineer
    I will be passing p_QAEngineer using binding variable using 'ExecuteWithParams' using a dropdown(eg: 'rkumara'). But I need to add a '%' to this value as I am using a 'LIKE' clause in my query.
    I tried using,
    select * from ade_txns where series= :p_series and transaction like :p_QAEngineer+'%'
    But this is not working for me.
    Can someone please tell me how i can solve this.
    Thanks,
    Ranjeet

    does this help also?
    How to add regular expression in viewobject bind variables
    ~Abhijit

  • Repeated rows resulting from executeWithParams on query with bind variable

    hi
    Please consider this example application created using JDeveloper 11.1.1.3.0
    at http://www.consideringred.com/files/oracle/2010/RepeatedRowsIssueApp-v0.01.zip
    It has a View Object "EmployeesVO" based on a SQL query with a bind variable "EmailBVar".
    The page "findEmployees.jspx" has executeWithParams dropped as an "ADF Parameter Form..." and the "EmployeesVOVI" collection as a table.
    On "EmployeesVOVIIterator" the RangeSize has been modified from the default 25 to 10.
    So, all straightforward stuff.
    A scenario (sc1), running the page "findEmployees.jspx", specifying a value and clicking the "ExecuteWithParams" button results in repeated rows shown in the table, that is the first row (and subsequent rows) are repeated at row 11 (and subsequent rows),
    as can be seen in the screencast at http://screencast.com/t/bn9QvV0qt
    question:
    - (q1) How can the repeated rows in scenario (sc1) be explained/avoided?
    many thanks
    Jan Vervecken

    Thanks for your reply Nick Haralabidis.
    it can be avoided by setting the EmployeesVO Access Mode to Range Paging and setting the Range Size to 10. Indeed, that does seem to avoid the repeating rows.
    Now why you get this behavior when you don't specify Range Paging on the VO I don't know. It could be because: 1) it is a bug - the obvious answer ;) , 2) because setting the RangeSize on the EmployeesVOVIIterator without setting the Access Mode on the EmployeesVO to Range Paging is conflicting - but then again there is no warning or error produced by JDeveloper, 3) ...It does look like unintended behaviour, for a "default approach" like this.
    In documentation section "39.1.5 Efficiently Scrolling Through Large Result Sets Using Range Paging " ...
    at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcadvvo.htm#ADFFD1179
    ... this Range Paging for a View Object seems to be described as an optimization, not as a requirement for functionally correct behaviour.
    - about (q1)
    Another approach that seems to avoid the repeated rows in scenario (sc1) is removing the value for the RangeSize attribute on the iterator, so the RangeSize is not specified.
    Using the modified example application
    at http://www.consideringred.com/files/oracle/2010/RepeatedRowsIssueApp-v0.02.zip
    ... this can be seen in scenario (sc2) in the screencast at http://screencast.com/t/0bpCo33i8J
    Although, the documentation in section "22.4.2.2 Iterator RangeSize Attribute " ...
    at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/web_form.htm#ADFFD706
    ... does not seem to mention anything about not specifying the RangeSize attribute, it does say "... You can set it to -1 to have the full record set returned. ...".
    As can be seen in scenario (sc2) the EL expression #{bindings.EmployeesVOVIIterator.rangeSize} resolves to -1 which suggests that not specifying the RangeSize attribute is the same as configuring the RangeSize attribute to -1.
    questions:
    - (q2) What is the preferred way to avoid having "the full record set returned", without having repeated rows as in scenario (sc1)?
    - (q3) Is the default configuration of RangeSize="25" on the iterator intended behaviour (for an interator supporting an executeWithParams action)?
    regards
    Jan

  • Af:query with bind variables and Saved Search

    I have a VO and view criteria(VC).
    VC has a criteria item ObsoleteDate with range specified as bindVariables "dateFrm" and "dateTo" I dragged & dropped the named criteria as af:Query with table. Table toolbar has 2 buttons in which I set & clear the bind variables. Data is fetched as per as expected based on the VC & bind variables.
    The problem is,
    If I save my search with bind variables set and swap between the saved searches , all works fine. But the moment I clear bind variables & swap between searches.. "dateFrm" is populated and "dateTo" is null and I get an Exception oracle.jbo.AttrValException: JBO-27035: Attribute Obsolete Date: is required.
    Why is this happening?? Saved search is supposed to save the VC with all the bind values set while saving and clearing bind variables shouldn't affect the saved search, right?? Or I have understood it wrong?
    I am using JDeveloper 11.1.2.3.0
    Thanks

    Try
    like ? || '%'

  • ODT Query Window. Query with binding variable?

    I have the ODT 11.1.0.7.20 installed.
    In "Query Window", I execute an SQL with binding variables. But I only get ORA-01008 errors. How do I do that?
    I want to double click an SQL and load it in "Query Window". How do I do that?
    I want to right click an SQL and select "Open with Query Window". How do I do that?
    In Query Window I want to load an SQL either by drag and drop or by select a function "Open SQL". How do I do that?
    Why none of these functionalities work as you could expect?
    Thanks,
    Tobias

    Finally i found the problem..
    The problem was that i had to remove one line from the properties of my table departments, the property: selectedrowkeys, because it only passed the last selected row.
    Still, i apreciate the help and i had to replace some code in the bean.java , because of the exception error and you didn't had to do that. Maybe i did some configuration in the wrong way and it went wrong.
    Thanks for the help.
    Regards,
    Frederico.

  • Trying to pivot based on a dynamically created query which generates XML data

    Hi there,
    Hope someone can help
    I'm trying to pivot row data into a pivot type result set where the records for a given employee are pivoted to a single row.
    To do this, I've declared a dynamic query to retrieve the GUID values of the different training course- the actual course names are full of SQL escape characters e.g. ', (,) which I thought might mess up the dynamically generated query
    I've got as far as writing
    DECLARE
    @employeeidsVARCHAR(10)
    DECLARE
    @coursesVARCHAR(max)
    DECLARE
    @queryVARCHAR(max)
    SELECT
      @courses=STUFF((SELECT 
    DISTINCT[TRAIN_ID]
    FROM  
    [Megapay_IWA].[dbo].[HRS_TRAINING]
    FORXMLPATH('')
    ),2,0,'')+']'
    SET
    @query=
    'SELECT * FROM
    (  SELECT t.TRAIN_TRAINING,
       EMPL_EMPLOYEE_ID
            FROM 
    [Megapay_IWA].[dbo].[HRSTRNDONE] as tc
    left  join  Megapay_IWA.dbo.PAYEMPL  as e on tc.TRND_ONRID = e.EMPL_EMPLOYEE_id
    left join [Megapay_IWA].[dbo].[HRS_TRAINING] as t on tc.TRND_TRAIN_ID =t.TRAIN_ID
    ) t
    PIVOT (COUNT(EMPL_EMPLOYEE_ID) FOR TRAIN_ID in
    +@courses+'))
    AS pvt'
    EXECUTE
    (@query)
    which generates a dynamic query along the following lines but how to I update the query to correctly read the train_id values in the xml
    SELECT * FROM
    (  SELECT t.TRAIN_TRAINING,
       EMPL_EMPLOYEE_ID
            FROM 
    [Megapay_IWA].[dbo].[HRSTRNDONE] as tc
    left  join  Megapay_IWA.dbo.PAYEMPL  as e on tc.TRND_ONRID = e.EMPL_EMPLOYEE_id
    left join [Megapay_IWA].[dbo].[HRS_TRAINING] as t on tc.TRND_TRAIN_ID =t.TRAIN_ID
    ) t
    PIVOT (COUNT(EMPL_EMPLOYEE_ID) FOR TRAIN_ID in
    <TRAIN_ID>F607BA64-BD24-4C6F-810E-001E7487FB4B</TRAIN_ID><TRAIN_ID>784EF318-628F-407E-8844-0049E3DD8F86</TRAIN_ID><TRAIN_ID>C7F3B365-7E6C-4CDF-9F0C-010207D1E493</TRAIN_ID><TRAIN_ID>7A82C4C1-5A9F-4EB0-9988-018405D3347A</TRAIN_ID><TRAIN_ID>E3FC88F5-AF5F-4D75-816A-02085190FC5C</TRAIN_ID><TRAIN_ID>BEB39D10-7887-494C-ADCC-0254A1514D06</TRAIN_ID><TRAIN_ID>6D870918-CFA1-4ADA-8427-049FF01902AC</TRAIN_ID><TRAIN_ID>61D1B40A-A9B6-4835-82C4-04FDCCAF7E6D</TRAIN_ID><TRAIN_ID>CA6D6B7-5ACA-4BE0-8A08-0EE87F77F10E</TRAIN_ID><TRAIN_ID>F86E6E93-544E-43F5-A97A-10E96834C781</TRAIN_ID><TRAIN_ID>EB898326-705F-4E70-B7BB-119B8953DFA9</TRAIN_ID><TRAIN_ID>491BFC77-0FA9-42C5-A255-11C49AA28CDD</TRAIN_ID><TRAIN_ID>C7A972FB-1E73-41FC-A4EF-12F5811C9853</TRAIN_ID><TRAIN_ID>3FD2CEE3-E85F-4624-87D7-13767D2DB391</TRAIN_ID><TRAIN_ID>F8A784C0-6E56-4769-92D2-1480BCAB2BEA</TRAIN_ID><TRAIN_ID>60D36A51-E642-40A2-A2F7-14D158B59781</TRAIN_ID><TRAIN_ID>67ED29A3-E2AD-42EC-8312-156084C0BB26</TRAIN_ID><TRAIN_ID>64B637B9-CC7D-47C8-9220-15D5FA76E65F</TRAIN_ID><TRAIN_ID>59B5D61C-4228-485D-89EE-185B74E42F3C</TRAIN_ID>
    Note I'm also fine with updating the dynamic query to generate a statement that generates a normal where in constraint e.g.
    PIVOT (COUNT(EMPL_EMPLOYEE_ID) FOR TRAIN_ID in
    ('F607BA64-BD24-4C6F-810E-001E7487FB4B','784EF318-628F-407E-8844-0049E3DD8F86')
    Thanks
    John

    Thanks guys, that helped immensely,
    For the record here is the slightly modified version [made generic to show the overall principle] that got it working for me in the end
    DECLARE @ColumnList VARCHAR(MAX) = '';
    DECLARE @query VARCHAR(max);
    WITH Data AS (
            SELECT columnname
             FROM    dbo.table
             SELECT         @ColumnList +='[' +  [columnname] +'],'
             FROM         Data;
    SET @ColumnList = STUFF(@ColumnList, 2, 0, '');
    SET @ColumnList = LEFT(@ColumnList, LEN(@ColumnList) - 1)
    --print @columnlist
    SET @query=
    'SELECT otherfields, ' +@ColumnList +' FROM
    (  SELECT   otherfields,columnname, datefield
             FROM        dbo.table
    ) t
    PIVOT (max(datefield) FOR [columnname] in (' +@ColumnList + ')
    ) AS pvt'
    execute (@query)

  • LOV query with bind variable

    Hi,
    I have a LOV with a query has a bind variable:
    select comp_plan_id,name from cn_comp_plans_all
    where sysdate between start_date and nvl(end_date,sysdate+1)
    and org_id = : 1
    So I create a CO for this LOV , and in processRequest(), I pass the value of this bind varible.
    Now in the base page,
    if comp plan crteria is blank, this LOV works fine.
    if comp plan criteria has value: 2007 PTE COMP PLAN 1001
    I get this error:
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (select comp_plan_id,name from cn_comp_plans_all
    where sysdate between start_date and nvl(end_date,sysdate+1)
    and org_id =:1) QRSLT WHERE (( UPPER(NAME) like :2 AND (NAME like :3 OR NAME like :4 OR NAME like :5 OR NAME like :6)))
    Because '2007 PTE COMP PLAN 1001' has 5 tokens, the generated query automatically add 'Name' 5 times.
    Can anyone help?
    thanks
    Lei

    Complete error is:
    java.sql.SQLException: Invalid column type
    Exception Details.
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (select comp_plan_id,name,org_id from cn_comp_plans_all
    where sysdate between start_date and nvl(end_date,sysdate+1)
    and org_id = :1) QRSLT WHERE (( UPPER(NAME) like :2 AND (NAME like :3 OR NAME like :4 OR NAME like :5 OR NAME like :6)))
         at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:75)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.sql.SQLException: Invalid column type
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7895)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7572)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8183)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectAtName(OraclePreparedStatement.java:8206)
         at oracle.jbo.server.OracleSQLBuilderImpl.bindParamValue(OracleSQLBuilderImpl.java:3916)
         at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3335)
         at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:13746)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:801)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:742)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:891)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:805)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:799)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3575)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.initQuery(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.setCriteriaOnVO(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAListOfValuesHelper.processRequestAfterController(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAListOfValuesHelper.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.layout.OAListOfValuesBean.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:75)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

  • Using a query with bind variable with columns defined as raw

    Hi,
    We are on Oracle 10.2.0.4 on Solaris 8. I have a table that has 2 columns defined as raw(18). I have a query from the front end that queries these two raw columns and it uses bind vairables. The query has a performance issue that I need to reproduce but my difficulty is that how to test the query in sqlplus using bind variables (the syntax for bind vairables fails for columns with raw datatype).
    SQL> DESC TEST
    Name                                      Null?    Type
    ID1                                                RAW(18)
    ID2                                                RAW(18)
    SQL> variable b1  RAW(18);
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
                        VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
                        NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
                        BINARY_FLOAT | BINARY_DOUBLE ] ]
    The above is the error I get - i cant declare a variable as raw.
    SQL> variable b2  RAW(18);
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
                        VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
                        NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
                        BINARY_FLOAT | BINARY_DOUBLE ] ]
    SQL> variable b3  RAW(18);
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
                        VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
                        NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
                        BINARY_FLOAT | BINARY_DOUBLE ] ]
    --now the actual query below
    SQL> SELECT * FROM TEST WHERE ID1=:B1 AND ID2 BETWEEN :B2 AND :B3;
    SP2-0552: Bind variable "B3" not declared.
    (this fails due to the errors earlier)Also this is a third party app schema so that we don't have the option of modifying the data type of the columns.
    Thanks,
    Edited by: orausern on May 10, 2011 11:30 AM

    Try anonymous PL/SQL block:
    declare
    b1 RAW(18);
    b2 RAW(18);
    b3 RAW(18);
    begin
    b1:=..;
    b2:=..;
    b3:=..;
    SELECT col1, col2, ..
    INTO ...
    FROM TEST
    WHERE ID1=:B1
    AND ID2 BETWEEN :B2 AND :B3;
    end;
    /

  • Query With Bind Variables and %

    Hi,
    Quick question. I am using ADF BC on Jdev 11 with a MySQL Database.
    I've used Bind Variables in the past (I have to use a Question Mark [?]) and have had no problem.
    Now I want to do something like this in my where clause:
    SELECT TempTable.ABC FROM TempTable
    WHERE ABC LIKE ?%
    When I try and create the View Object with that query it is complaining about the %.
    Am I required to append the % in my bind variable? Any examples I have seen of this, people are doing something like :p_id = 'Jo%'

    Try
    like ? || '%'

Maybe you are looking for

  • Home button on iPad2 no longer works after iOS 7 upgrade

    I upgraded my iPad2 to iOS 7 today.  The home button no longer works.  I've powered it down and back up as well as restarted it but it's still not working.  Any suggestion greatly appreciated. About to fly to China and was looking forward to watching

  • My viber is not working without wi fi

    viber is not working without wifi

  • Missing main Contribute Window

    My main Contribute window has moved itself off to the bottom right corner of my screen. Expose can bring it to the front but it disappears off the side again when I click on it. My screen is at the highest resolution already so I can't change my reso

  • Disp+work.exe error in BPC NW VM image

    Hi, I have one error coming up in BPC NW VM image which is pertaining to disp+work.exe service in sap management console. This service is currently stopped and when i try to re-start it,intially it's going in yellow color and displaying an error sayi

  • How to install self-signed ROOT CA certs in safari 4 for windows?

    Hello, I do some web development and I use Safari for windows to test all my works for mac users, since v4 I haven't been able to test my apps because safari ask me for a certificate to use for connecting to the test environment (uses self signed cer