How to querie with bind variable in findMode?

Hallo,
is it possible to use a querie with bind variable in findMode? And when how is it possible to initialize the bind variable?
Any help is appreciated.

Hi,
bind variables can be linked from teh ADF binding to e.g. a managed bean, the sessionScope or other binding attributes via EL. So when you go into findMode and execute the query, the EL will grab the bindVariable values automatically.
Frank

Similar Messages

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

  • How to declare a bind variable with 'date' data type in command prompt?

    how to declare a bind variable with 'date' data type in command prompt?
    sql>variable q date;
    when i execute it show list of datatypes

    Hi,
    As Lokanath said, there are no DATE bind variables.
    You can use a VARCHAR2 bind variable, and convert it to a DATE in your SQL statment.
    If you're using SQL*Plus, consider a substitution variable. It won't be as efficient as a bind variable, but it will be as convenient.
    For example:
    DEFINE  first_entrry_date = "DATE '2010-06-20''
    SELECT   ...
    WHERE   entry_date >= &first_entry_date
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to use ApplicationModuleImpl.createViewObject for VO with bind variable

    I need to implement a AM method to create VO instance from a generic VODef with bind variables.
    The createViewObject() will trigger the executeQuery of the VO before I can set up the bind variables for the query.
    What is the proper way to create view object instance with bind variables?

    I am using JDeveloper 11.1.1.2.
    I have a ViewObjectA declared with some bind variables which determine what business data to be retrieved at runtime via a service method of the ApplicationModule.
    As the ViewObjectA is only referenced internally within ApplicationModule and I need more than one instance of the ViewObjectA for different conditions at runtime,
    I use ApplicationModuleImpl.createViewObject() to create an instance of ViewObjectA instead of adding ViewObjectA to the data model of the ApplicationModule.
    Currently, when the ViewObjectA is instantiated, it also trigger an executeQuery() which will not retrieve correct data until I set up the bind variables.
    However, the createViewObject() method doesn't let me pass in the values of the binding variables.
    Currenlty, I just call the createViewObject() and then set the binding variables values and call executeQuery() again.
    Just checking if there is a better way to do so...

  • 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')))

  • OBIEE Integration with ADF - Reports with bind variables

    Hi,
    I've managed to integrate obiee with ADF by following the steps described in:
    http://www.oracle.com/technetwork/middleware/bi-publisher/adf-bip-ucm-integration-179699.pdf
    This is all fine and all but what about reports with complex queries where bind variables are needed?
    In short I need to send specific values from ADF application as parameters to the query of the report before building it, then create it and download the file as pdf.
    I don't have problems with building the file and downloading it when the query in the report has no bind variables, but when it does I do not know how to send them to the report.
    I can't seem to find such an implementation or example anywhere and I am stuck.
    Could anyone please point me in the right direction, eighter by providing a solution, or a link to such an example?
    Thank you!
    P.S.
    I'm using OBIEE 11.1.1.6.0 and JDeveloper 11.1.2.1.0
    Mihai Cornean
    Edited by: 885382 on Apr 11, 2013 11:10 PM

    Hi,
    try the BI Publisher forum for question towards this product BI Publisher
    Frank

  • Report Performance with Bind Variable

    Getting some very odd behaviour with a report in APEX v 3.2.1.00.10
    I have a complex query that takes 5 seconds to return via TOAD, but takes from 5 to 10 minutes in an APEX report.
    I've narrowed it down to one particular bind. If I hard code the date in it returns in 6 seconds, but if I let the date be passed in from a parameter it takes 5+ minutes again.
    Relevant part of the query (an inline view) is:
    ,(select rglr_lect lect
    ,sum(tpm) mtr_tpm
    ,sum(enrols) mtr_enrols
    from ops_dash_meetings_report
    where meet_ev_date between to_date(:P35_END_DATE,'DD/MM/YYYY') - 363 and to_date(:P35_END_DATE,'DD/MM/YYYY')
    group by rglr_lect) RPV
    I've tried replacing the "to_date(:P35_END_DATE,'DD/MM/YYYY') - 363" with another item which is populated with the date required (and verified by checking session state). If I replace the :P35_END_DATE with an actual date the performance is fine again.
    The weird thing is that a trace file shows me exactly the same Explain Plan as the TOAD Explain where it runs in 5 seconds.
    Another odd thing is that another page in my application has the same inline view and doesn't hit the performance problem.
    The trace file did show some control characters (circumflex M) after each line of this report's query where these weren't anywhere else on the trace queries. I wondered if there was some sort of corruption in the source?
    No problems due to pagination as the result set is only 31 records and all being displayed.
    Really stumped here. Any advice or pointers would be most welcome.
    Jon.

    Don't worry about the Time column, the cost and cardinality are more important to see whther the CBO is making different decisions for whatever reason.
    Remember that the explain plan shows the expected execution plan and a trace shows the actual execution plan. So what you want to do is compare the query with bind variables from an APEX page trace to a trace from TOAD (or sqlplus or whatever). You can do this outside APEX like this...
    ALTER SESSION SET EVENTS '10046 trace name context forever, level 1';Enter and run your SQL statement...;
    ALTER SESSION SET sql_trace=FALSE;This will create a a trace file in the directory returned by...
    SELECT value FROM v$parameter WHERE name = 'user_dump_dest' Which you can use tkprof to format.
    I am assuming that your not going over DB links or anything else slightly unusual?
    Cheers
    Ben

  • Problem with Bind Variable in 11.2

    Hi
    I have a slow statement with bind Variables. With literals it works fine. Is there a way to replace the bind by literal in advanced ? I use Release 11.2.0.2.3
    Thank you

    904062 wrote:
    I have a slow statement with bind Variables. With literals it works fine. Is there a way to replace the bind by literal in advanced ? I use Release 11.2.0.2.3This specific scenario is very much an exception to the rule - and you need to back your statement up with execution plans of the SQL with bind variables and with literals, and run stats that show the difference between these two execution plans.
    See the {message:id=9360003} from the {forum:id=75} forum's FAQ for details on how to post a SQL performance tuning question.

  • LOV(af:selectOneChoice) with bind variable in af:table

    Hi All,
    I have a table where a column is defined as dropdown(af:selectOneChoice). The query for selectOneChoice has a bind variable which needs to be set as a value from the base view Object corresponding row.
    Suppose a table Employee
    EmpId EmpName EmpType Authorization
    101 John Temp No
    The above table is created as af:table and 'Authorization' is implemented as dropdown(af:selectOneChoice) . The selectOneChoice has a query(AuthorizationLovVVO) with bind variable . For each row of af:table(EmployeeVO) , af:selectOneChoice query(AuthorizationLovVVO) requires
    the corresponding row(EmployeeVO) 'EmpType' to be set as value of bind variable.
    Can you please suggest how can we achieve this functionality.
    Edited by: 907302 on Oct 17, 2012 7:22 AM
    Edited by: 907302 on Oct 17, 2012 7:22 AM

    I have checked the following post where it has been suggested to access the the current row value as groovy expression.
    groovy for bind variable
    Suppose my AM name is 'TestAM' , i have tried the below expressions for value of bind variable but it does not work :
    1) adf.object.TestAM.findViewObject('EmployeeVO1').currentRow.EmpType
    2) adf.object.TestAMDataControl.findViewObject('EmployeeVO1').currentRow.EmpType
    None of the above expressions work and i get the error while running the page as 'Variable NotesAM is not recognized.' / 'Variable NotesAMDataControl is not recognized.' .
    Can you please suggest if we can achieve the functionality using this approach . Also let me know if i am missing something in the above expression.

  • 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

  • How to catch possible bind variable performance impact during development?

    Since producing load is a problem on development environment and the technics provided with Oracle can capture a parsing problem caused by a bind variable problem only after execution we are looking for pro-active solution like 10g compile time warnings stuff.
    Using binds can have impact on indexed skewed data columns and paritioned tables, so lets just think about a typical oltp environment with always same access path results for similar queries using bind variables.
    Using v$ views or even better dba_hist after 10g or 10046 trace are considered as re-active approaches since they can only be examined on a pre-production loaded environment.
    Is there any tool or approach you are using or may suggest?
    Thank you, best regards.
    Tonguc

    Are you using PL/SQL only?
    If so, I'd look at all the EXECUTE IMMEDIATE's and DBMS_SQL calls throughout the code and determine one by one if they pose a threat. They should be rare, so a simple search against the USER_SOURCE could be sufficient.
    Other programming languages will have different statements to watch out for.
    I am not aware of any tool that does this for you.
    Hope this helps.
    Regards,
    Rob.

  • ADF View Accessor Validation with Bind Variable

    Hi
    I need to solve the following requirement using a view accessors and bind variables;
    1. User can select a value for a attribute from LOV which is unfiltered.
    2. User can manually edit code into the same attribute as in 1 above, which needs to be validated.
    As the data set for the attribute is large, I need to be able to validate 2 using a query with a where clause.
    My approach has been;
    1. I have a view object for the source lookup table, ProductVO.
    2. I have created a view criteria on ProductVO that accepts a bind variable, pProductCode.
    3. On my OrderEO I have a attribute, productCode.
    4. I create a new view accesor on the OrderEO using the view criteria created in point 2.
    5. I have lft the bind variable parameter blank, as I need to be able to dynamically pass a product code at run time.
    6. On my OrderVO for the productCode attribute, I have create a LOV, based on the ProductVO. This will ensure that the user can view and search all products if needed.
    What I am not getting working;
    1. How can I pass the attribute value to the view accessor at runtime when the value is manually captured.
    2. Ensure that if a value is selected from the LOV, that the view accessor validation does not get invoked.
    What I have tried to solve point 1;
    1. I created a validator on the productCode attribute on the OrderEO as a list validator using the view accessor as my list. I am not sure how to get the bind variable populated. Leaving out the bind variable, I assume, would cause the value to be validated against all my products.
    2. I then tried using a method validator and passing in the productCode value and querying the view accessor.
    3. I have not yet tried using Key Exists, is this maybe the missing link/trick?
    All help will be considered a early christmas gift!!

    Hi
    I have found that when using validation type Key Exists and the VO is in the local application, then the bind variable is available in the Create Validation wizard. When I try and create a validator on a VO that is core to all my applications, then I put that VO into an ADF library, the bind variable parameter is not available for mapping to my entity object attribute, even though I can select the VO to create a view accessor from the ADF library.
    Possible bug?

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

  • A little bit of help with Bind variables please

    Hi,
    I am having a bit of trouble with bind variables I have been looking at the Dev guide and the forum to try and achieve this and it is still not happening for me, could anybody please help or point me in the right direction:
    I have created a simple PersonVO with the basic query:
    Select distinct full_name from xxml_people where person_id = :1
    In the PersonVOImpl.java I have added the method:
    public void initQuery(String personId)
    Number person = null;
    try
    person = new Number(personId);
    catch
    (Exception e){}
    setWhereClauseParam(1,person);
    executeQuery();
    Then in the PersonAM I have added the method:
    public void initPersonQuery(String personId)
    getPersonVO1().initQuery(personId);
    I then call this method in my processRequest section of my page controller:
    PersonAMImpl am = (PersonAMImpl) pageContext.getRootApplicationModule();
    String personId = "581";
    am.initPersonQuery(personId);
    When I try and run this I get the error:
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT distinct full_name from xxml_absence_calendar where person_id = :1
    java.sql.SQLException: ORA-01006: bind variable does not exist
    Am I binding the variables correctly? Or am I making some stupid mistake?
    I am ultimately looking to create a messageChoice where the logged in user will see a list of all organisations underneath him and the one level above. I plan to do this by passing the User’s Organisation name into a VO query using the organisation as a Bind Variable. I think once I have worked out how to bind variables this should be straight forward.
    Many Thanks

    Even though the parameter binding values may be same, you should never use the positional param more than once. So always go for the format
    select distinct full_name from xxml_people where supervisor_id = :1
    UNION
    select distinct full_name from xxml_people where person_id = :2
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to identify the bind variable peeking problem?

    How to identify the bind variable peeking problem whether my db hitting or not and how to resolve it?
    currently we are doing the dbms_stat of application schema's with gather auto option and i hope this option we take the histogram stats also. Is there any option to improve it and its highly transactions oltp env of 11g.

    What is your exact 4 digits Oracle version ?
    Bind peeking issues are supposed to be solved with adaptative cursor sharing in 11.1 and 11.2:
    11.1 http://download.oracle.com/docs/cd/B28359_01/server.111/b28274/optimops.htm#sthref919.
    11.2 http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/optimops.htm#PFGRF94588
    which says also:
    >
    Adaptive cursor sharing is enabled for the database by default and cannot be disabled. Note that adaptive cursor sharing does not apply to SQL statements containing more than 14 bind variables.
    >
    Edited by: P. Forstmann on 10 nov. 2011 13:50

Maybe you are looking for

  • Can't use iCloud on MacBook

    I am having lots of trouble with my Macbook, specifically surrounding iCloud. Every time that I log into my macbook it sends me through the prompts as if I am setting up the computer for the first time.  It asks for my apple ID and password and all t

  • How to call servlet in action of the Form in jsr 286 portlet

    HI, We are using Portlet producer application to create JSR 286 Portle. In the View.jsp of a portlet we need to call a servlet by mention it in the action of the form. WHen I run the only view.jsp page , on form submission the servlet gets called. Bu

  • Error: Object variable or with variable not set while accessing

    Hi Friends, I am facing 'object variable or with variable not set' Error while opening BPC Excel. I have done, In Excel 2007, go to Excel Option -> Add-Ins -> Manage: COM Add-ins and Go... You look "BPC COM" disable and need enable again. But I am ge

  • Error in application log for transaction FPSA

    Dear Colleagues, The application log for this transaction returns the following message, 'Run SELA 15.01.2008 V00001 is not ready Message no. >REP 014 Diagnosis The run was probably terminated as a result of an error System Response The interval was

  • Commit after every three UPDATEs in CURSOR FOR loop

    DB Version: 11g I know that experts in here despise the concept of COMMITing inside loop. But most of the UPDATEs being fired by the code below are updating around 1 million records and it is breaking our UNDO tablespace. begin for rec in       (sele