Query at run time

I want to create a searh form with two bind variables.I have created them as select one choise.1st bind variable returns data from a view object and the 2nd bind variable returns data from another view object.This 2nd view object also contains the column of 1st view object that is returnd as to 1st bind variable.Now how can I filter the query of the 2nd view object that returns to the 2nd bind variable such that it will use the current value of the 1st bind variable in the query parameter of the 2nd view object.
How can I accomplish this?
Please help

Try this link, it may be what you need ;)
http://thepeninsulasedge.com/frank_nimphius/2007/07/23/adf-swing-dependent-listboxes/

Similar Messages

  • How to set vo query at run time

    Hi,
    Is it possible to bind the where clause of query at run time.
    N :)

    Hi,
    Yes its possible.
    To add new where clause to your query.
    vo.setWhereClause(null);//If you want to remove any existing programmatically added where clause.
    vo.setWhereClause("Your new query");
    To bind varibales (Say there are 2 bind variables),
    First way to achieve this.
    setWhereClauseParam(null); //Always reset it to remove existing bindings)
    setWhereClauseParam(0, "Your first paramter value"); // Second parameter "Your first paramter value" is of type object.
    setWhereClauseParam(1, "Your first paramter value");
    In case you use "?" styly type binding, this count in above method starts with 1 instead of 0.
    Second way is to put all bind variables in an object array and pass to above method.
    Vector params=new Vector(2);
    params.addElement("FirstParameter");
    params.addElement("SecondParameter");
    Now call vo.executeQuery() to fetch the results as per new query.
    Abdul Wahid

  • How to get report (SQL Query) generating Run Time

    There is a Standard report of Payroll which show employee transfer information on the bases of location, grade job or organization, now to get actual query which is generated by run time in report builder including whether single column parameter or lexical parameter " because currently the query in not complicate but the parameter and lexical parameter is much more due to this not quite easy to under stand just copy past it into toad or pl/sql developer,
    Kindly share your experience to get such kind of query in you working time.
    thanks

    Here i try to explain contain of query.
    Parameter
    P_DEPTNO = 10
    P_WHERE_CLAUSE := ' AND EMPNO IS NOT NULL AND SALARY > 100'
    SELECT * FROM EMP
    WHERE DEPTNO = P_DEPTNO
    &P_WHERE_CLAUSE
    REPROT WILL GENERATE QUERY AT RUN TIME IS LIKE THAT
    SELECT * FROM EMP
    WHERE DEPTNO = 10
    AND EMPNO IS NOT NULL AND SALARY > 100
    Now i want to get this query out(Run time) by doing any oracle database feature or sth similar.
    thanks

  • Checking dynamic query at run time

    i need to check whether the query is valid or not at run time. The query will be formed based on the column name, table name, and where clause. this query is purely a select statement. if column name and table names are diff then system should display an error msg. i have more than 10 tables and the table name will be selected from LOV. i should be allowed to enter the condition for where clause also ar run time and this condition column should also be validated.

    Hi,
    I think you only want to see if your select statement has compilation error or not because when you use dynamic statement it doesnt show the compilation erro if the statement has it or not. What you can do is add an item say "stmt" in your control block. change the property to multi record so that you can see multiple lines in that item and make the lenght say 2000. Now assign your statement into "stmt" for example
    :control_block.stmt := 'select ' || col1
                        || ','
                        || col2
                        || ','
                        || col3
                        || ' FROM '
                        || table
                        || ' where ' || conditionput this statement on any button on when-button-pressed trigger. When you will press the button on run time you will see the statement. Run that statement on sql*plus or toad and check if there is any problem in the statement.
    Hope this helps
    Ghulam

  • BEx Query designer : Run-time error '457'

    Hey,
    We installed the standard query's for HR.  When we try to change the query 'Average age of employees', and we try to restrict on 'Calender year/month' then we receive this error. 
    Run-time error '457' : This key is already associated with an element of this collection.
    We're using version 3.50.
    I already saw oss note 517232 but that was for version 2.0 and not intresting for my case...  Anybody any idea? 
    Kind regards,
    Tom
    PS : I also saw : https://forums.sdn.sap.com/click.jspa?searchID=1049118&messageID=1649858 & https://forums.sdn.sap.com/click.jspa?searchID=1049118&messageID=2243413

    Hi,
    Check this conditions as I haven't checked the queries ......make sure that these two conditions are not getting into picture after you make the changes to the query.
    1) When we are making restricted key figures we can’t use same variable to restrict to two different Characteristics in the same RKF.
    2)Once a Variable used to restrict a characteristic in one RKF you cannot use it to restrict it other characteristic in other key figures i.e.  You can use it to restrict that particular characteristic only in other key figures.
    Hope it helps
    Thanks

  • How to find Query with Running time

    dear frnds,
    I need to find the query details and query execution time from a DB USER. am using oracle 11g. how to generate this report
    please give me any idea.,
    thanks.
    Edited by: Velsjeya on May 14, 2012 1:07 AM
    Edited by: Velsjeya on May 14, 2012 1:07 AM

    Velsjeya wrote:
    thanks a lot,
    here i need to show query running time also...( how many mins that particular query ran) ... please help mePlease do search for the question's answer. V$SQL should be able to show you what you are looking for. Asktom's thread given below discusses the same,
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:912859800346801944
    Aman....

  • Dashboard to BEx query call run time very slow (7-8 mins)

    Hi Guys,
    I am currently working on a project where BEx query is being consumed using BICS. The functional team has built a BEx which is being cached in Webi by the BO developer and then that cashed Webi is being used in Dashboard. We have many hierarchies (Fund Center, Profit Center, GL Account etc.) used in the dashboard.
    BEx query > WEBi (Cached) > Dashboard
    Clicking the main level in hierarchy in dashboard the data comes back in 2-3 secs as the data is cached in Webi
    ISSUE: In Dashboard based on where user is on the Fund Center hierarchy there is a button called “Summary Report” on the dashboard which calls the BEx query and that second call takes roughly about 7-8 minutes. How could we reduce the run time of the second query?
    The secondary query uses the same data set as the first one but as the data is cached in Webi and it uses Web services to pass data to dashboard, so any call back from dashboard to the cached webi the hierarchy information is lost  and thus the secondary query call to BEx query.
    Would it be possible to recommend any solution where we could bring the run time of the secondary call to less than a minute?
    Thanks,
    Keys

    First update to current frontend patch. many correction are included.
    Further check these notes: (relavant only if Analyzer is culprit)
    1160093: REPAIR MODE - Prog error/performance problems when using large workbooks
    1289127: REPAIR MODE - BExAnalyzer: performance issue applying styles in Excel 2007
    1293255: REPAIR MODE - BExAnalyzer: crash when repairing workbook with Excel 2007
    1150242+1094799: ANA_USE_SIDGRID - Improving performance/memory in the BEx Analyzer
    1179647: ANA_USE_TABLE - Performance: Network load in BEx Analyzer
    1260213: ANA_USE_OPTIMIZE_STG - Performance problems during workbook opening in Excel 2007
    1287179: ANA_SINGLEDPREFRESH - Single Data Provider Refresh
    1286653: Performance issues while displaying hierarchy (especially in Excel 2007)
    1352375: ANA_USE_SIDGRIDWBUF / ANA_USE_SIDGRIDMASS Performance improvements in a WAN (roundtrip reductions)
    1373214: Workbook compression
    1392745: ANA_CACHE_WORKBOOK - Workbook caching

  • How to get the name of an executing ABAP query in run time

    Hi ABAP Gurus,
    I need to get the ABAP query name when it's running. For example we can get the current executing ABAP program name from SY-REPID.
    My tried logic - every query generates an ABAP program like AQZZUGQUERY. 'UG' stands for user-group name and the length specified for it is 12, if the length of the user-group name is less than 12, then the rest will be filled by '='. Next 'QUERY' stands for ABAP query name and the length specified for it is 14, if less, then the rest will be filled in with '=' in the right. I've tried to extract the query name by using cut and trip (offset) operations.
    But somehow this logic is not working - always it's picking up the function name as checked in debug mode.
    Guys - Can you please provide me the solution on this.
    Thanks & regards,
    Jayanta Bej.

    Guys,
    I've cracked the issue. Instead of retrieving the query name from sy-repid, I've retrieved it from sy-cprog and the problem is resolved.
    Thanks guys for your quick responses.
    Thanks and regards,
    Jayanta Bej.

  • Query giving run time error.

    Hi BW Experts,
    Here goes my question :
    There is a query which is giving runtime error as time limit exceeded. This query is based on an infoset which is based on 4 ODS's.
    Is there any way we can do performance tuning for this query?
    Many Thanks in advance,
    Sudip.

    Hi Ganesh,
    Thanks for your help.
    Can you please tell me which option to select for the infoset query as i'm seeing a lot of options on the left hand side of the screen like master Data, Transaction data, ODS objects,PSA tables etc for the RSRV transaction?
    Also to add-on from my first post...this particular query is executing for an hour after which the error message comes an "System Failue, Time limit exceeded".
    Regards,
    Sudip.

  • Infoset Query - Long run times

    Hi All,
    I was running a Bex query on top of an infoset query a few days ago with no problems and very good performance.  Now, returning any number of records it runs and timesout.  I know that there will be recommendations related to statistics and possibly those related to the active table of the ODS.  I have checked these and they have been recently updated.  In fact, when I manually update the statistics the behaviour is the same.  The structure of the infoset has not changed.
    We are running 3.0B on DB2. 
    Any ideas?
    Robert Zovic
    Arinso International

    Hi Giridharan,
    you check whether the hierarchy SIDs are updated properly, structure, to date are all fine.
    check the difference between X and Y hierarchy.
    Regards,
    Prakasha A

  • Changing a Programmatic View Object's query at run-time

    Hi,
    I've created a programmatic View Object using the information in '35.9.3 Key Framework Methods to Override for Programmatic View Objects' in the Oracle Middleware Fusion Guide and bound it to a BarChart. This has worked fine using the following:
    String myColumn = "Quant1";
    protected void create() {
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    String myQuery = "SELECT Service as MyService, " + myColumn + " as MyValue FROM ColumnTestTable WHERE 1 = 1";
    getViewDef().setQuery(myQuery);
    setQuery(myQuery);
    I also have my data updating automatically. I have public properties in my viewObjImpl class which I can set and update the value of myColumn. I then thought it would just be a case of re-calling the create() method and the SQL would be updated and my chart would auto-update using the new column to select it's values, the value of the property updates and the create method is called but the chart doesn't display any different data and stops auto-updating. Does anybody know if this is possible and if so what I may have missed?
    Cheers, Tom

    Hi Timo,
    I moved everything to a different public method and solved the problem by firing the execute() method which I hadn't been doing previously and the chart updates with the correct data.
    However, once I execute the SQL my chart stops auto-updating with changes to the data in the database - do you know how I update the SQL query but keep my chart auto-updating? Perhaps I have to re-register for the registerDatabaseChangeListener for the query collection?
    Thanks in advance, Tom

  • Dynamic Query at Run time

    Hi,
    Happy New Year!!
    I am having some problem
    Split table details
    startid, endid
    1,1
    2,2
    3,4
    expected output is 1,2,34
    Begin
    P_blob v_local varchar2(1800) ='1234';
    select listagg(COLUMN_NAME, ',') within group (order by column_id) INTO Column_name
    from user_tab_columns where table_name= upper('mytable' );
    select listagg(column_id, ',') within group (order by column_id) INTO Column_id
    from user_tab_columns where table_name= upper('mytable' );
    insert into myewtable ('|| Column_name || ')
    with t1 as( select '''|| P_blob || ''' str from dual),
    t2 as( Select startid, endid from Split),
    t3 as
    ( select str,startid s,endid e, row_number() over(order by startid) rn from t1,t2)
    select * from t3 pivot
    max(substr(str,s,e)) str for rn in ('|| Column_id || ')
    end;
    how so i represent the Column_name as column values here.
    Query should be
    insert into myewtable ('col1,col2,col3 ')
    with t1 as( select '''|| P_blob || ''' str from dual),
    t2 as( Select startid, endid from Split),
    t3 as
    ( select str,startid s,endid e, row_number() over(order by startid) rn from t1,t2)
    select * from t3 pivot
    max(substr(str,s,e)) str for rn in ('1,2,3')
    end;
    i am getting as Column_name ,Column_id.
    how to represent the column values inside the query.
    Thanks

    Can you please check if this suffices your requirement. (I extended few testcases)
    WITH t AS
            (SELECT 1 startid, 1 endid FROM DUAL
             UNION ALL
             SELECT 2, 2 FROM DUAL
             UNION ALL
             SELECT 3, 4 FROM DUAL
             union all
             select 9,9 from dual
             union all
             select 1,5 from dual)
    SELECT listagg (DECODE (startid, endid, endid, startid || endid), ',')
              WITHIN GROUP (ORDER BY 1) finstr
      FROM t;output
    FINSTR
    1,15,2,34,9Cheers,
    Manik.

  • How to change the view criteria at run time for af:query

    Hi,
    I've a usecase where I need to change the view criteria of the af:query at run time.
    Use case:
    =======
    1) Consider a check box (Show Emps Under Dept 10) in the query panel when user selects and clicks 'Search' button should show the employees under dept 10. If user searches without selecting the check box, the results should show all the employees in all the departments.
    2) I need to have a check box always in the query panel. Its mandatory.
    The way I implemented:
    ==============
    1) Created a transient variable 'Show Emps Under Dept 10' in the EmployeeVO and also created a bind variable bind_DeptNo.
    2) Create a view criteria 'AllEmployees' which has only the transient attribute as the view criteria item and whose value set to 'false' by default.
    3) Created another view criteria 'EmpUnderDept' which has 'DepartmentId' as the view criteria item and whose value set to the bind variable 'bind_DeptNo'.
    4) Dropped the view criteria 'EmpUnderDept' as the 'af:query' panel in the jspx page.
    5) Overridden the queryListener as '#{EmpBean.empSearch}'
    6) Has the below code in the empSearch method as below. When user selects the check box, applying the other criteria 'EmpUnderDept' and setting the bind variable to '10'.
    public void empSearch(QueryEvent queryEvent) {
    // Add event code here...
    QueryDescriptor queryDesc = (QueryDescriptor) queryEvent.getDescriptor();
    ConjunctionCriterion conCrit = queryDesc.getConjunctionCriterion();
    List<Criterion> criterionList = conCrit.getCriterionList();
    List criterionValues = new ArrayList();
    Object criteriaValue = null;
    int criteriaNo = 0;
    DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    FacesContext facesContext = FacesContext.getCurrentInstance();
    for (Criterion criterion : criterionList) {
    AttributeDescriptor attrDescriptor = ((AttributeCriterion)criterion).getAttribute();
    System.out.println("============== attrDescriptor.getName() =================== " + attrDescriptor.getName());
    criteriaValue = ((AttributeCriterion)criterion).getValues().get(0);
    if(criteriaNo==0) {
    Boolean val = (Boolean) ((AttributeCriterion)criterion).getValues().get(0);
    if (val.equals(true)) {
    OperationBinding method = (OperationBinding) ADFUtil.findOperation("ExecuteWithParams");
    if(method!=null) {
    Map params = method.getParamsMap();
    //params.put(key, value)
    method.getParamsMap().put("bind_DeptId", 10L);
    method.execute();
    ADFUtil.invokeMethodExpression( "#{bindings.EmpUnderDeptCriteiaQuery.processQuery}", queryEvent);
    } else {
    //ADFUtil.invokeEL("#{bindings.ExecuteWithParams.execute}");
    ADFUtil.invokeMethodExpression( "#{bindings.AllEmployeesCriteriaQuery.processQuery}", queryEvent);
    But this approach is not working and its always showing all the employees in all the departments.
    Please let me know if there is a way to change the view criteria at run time depending on the values set at run time for one of the view criteria items.
    JDev version am using is '11.1.1.5'
    Thanks,
    Lakshman

    Hi Shay,
    It worked for me without overriding the executeQuery() method in the ViewImpl.java.
    Instead of creating 2 view criteria, I created only one which has both transient variable and the DepartmentId = <bind_DeptId>. With the above code, it worked properly. Now I am using only one view criteria.
    Thank you.

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

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

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

  • Run time Error 457

    Hi,
    We upgraded to BI 7.0, after upgrade the query is executing fine but while restricting a time characteristic the query throws an error "Run Time Error 457, this key is already associated with an element of this collection". This happens only in the production server, the query is working fine on development and test servers. When i try to access the variable associated with the time characteristic thru query designer the query designer window gets blocked displaying the same above message. I guess the error is related to Visual Basic of MS Office.
    Please let me know  the procedure for resolving the issue.
    Thank you

    Hi,
    Check SAP Note - 517232.
    Also check the below thread:
    BEx Query designer : Run-time error '457'
    Hope these helps u...
    Regards,
    KK.

Maybe you are looking for

  • How to call a bean method in the faces-config file?

    Hi, I would like in my menu to call the method of a bean (it initialize some properties before opening the page) instead of opening directly the page, by I can't find how to do that. I tried : <managed-property> <property-name>viewId</property-name>

  • HOW TO GET TOP N RECORDS IN SQL , URGENT

    Hi, I want to get the TOP 2 and BOTTOM 2 records (TOP 2 SAL , BOTTOM 2 SAL) from the following query result for each department . How do I get it using a SQL statement ? Thanks SQL> SELECT A.DNAME, B.ENAME, B.SAL FROM DEPT A, EMP B WHERE A.DEPTNO = B

  • How to separate layer in layer palette using colour?

    How can I separate the layer in layer palette using colour to increase the visualbility like the image below?

  • Passing values from JTextField to another class

    Hi, I have 2 classes...one is main and the other is a RequestForm class which is instantiated by main class using RequestForm application =new RequestForm(); the constructor for the RequestForm displays the form in which the users enters his/her pers

  • Software Update issue

    For some reason I cannot complete a software update. I get the message that new software, such as iTunes, is available. When I clink on install or check for new software, I get the checking for new software update bar/page. The bar is filled about a