Query Builder functionality

Has anyone built a Query Builder Page in the apps that is similar to the standard APEX Query Builder?

I haven't done exactly this, but remember doing a tabular form genarator (similar to the tabular form wizard in the builder) choosing tables, columns and field types. But that was using Apex 3.2, now that we have jQuery and dynamic actions in Apex 4.0, it should be much easier.
If you looking for an approach, here's one
<li>create a left side bar region with tables from schema: report or list based
select table_name from user_tables<li>On click of the list entry, show a modal dialog of a report based on the columns of the selected table
SELECT * FROM USER_TAB_COLS WHERE table_name = :<TABLE_NAME ITEM> Show images based on column type ("data_type" in user_tab_cols)
Checkboxes return the column name for each row
<li> Have a dynamic action that runs for each checkbox calling a PLSQL to update a collection adding the clicked column name to the the list.
Refresh a updateable report region which is based on the collection , showing the column, sort order,group by options
and JS code to move rows up or down (
move_up code (pseudo code)
this_row = $(this.triggeringElement).parents('tr:first);
prev_row = this_row.prev();
next_row = this_row.next();
//move up
prev_row.before(this_row);Then the SQL code generation would concatenate the application arrays containing the column names adding columns one row at a time and adding sort and order options. You would need to some custom PLSQL coding, looping throw each row adding predicates.

Similar Messages

  • Simulate the Query Builder functionality

    Hi all,
    I need to create in my application some functionality, such Query Builder: the drag and drop of tables, and graphically display of tables with the dragging possibility.
    I have take a look into the source code of the query builder page, but does not understood, how to realize it. Has anyone idea?
    Regards

    Login to my workspace on apex.oracle.com (vikasa/guest/guest) and check out the Apex - SQL Workshop application (20777) and see how various features are implemented.
    [You are on your own though as far as support is concerned, none of the features and techniques used are documented]
    As you know, building something like that requires a high degree of proficiency with the DHTML stack (HTML, CSS, Javascript, XHTML, etc)
    Good luck.

  • Automating Query Builder Functionality?

    Hi,
    My project requires up to date information on the currently live File Repository Server.  I know this information can be found by manually entering a SQL statement into the Query Builder Tool.  However, I have been asked to create a script that performs this task automatically and repeatedly.  When the details of the FRS change, the up to date information must be logged to the Windows Event log from which the information will be lifted by our company's internal log monitoring tool.
    If anyone can give me an idea of how I might do this I would certainly appreciate the help.  I would also be thankful for any suggestions for alternative solutions to the one outlined above.  For instance is there a given pattern I can search any of the BOE log files for to gather the required info?
    I'm a total newbie, so apologies if any of the above sounds a bit naiave or just down right stupid...
    Best Regards
    David

    BOE provides SDK to access the CMS. Please look at http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm for more info on the SDK. You have the option from choosing from Java/webservice or .NET SDK.

  • Query Builder access for end users

    Hi,
    I have a group of users who would like to have 'Query Builder' access.
    Is it possible to directly access query builder without actually login-in into application builder.
    Thanks in advance
    Aali

    No, but you could build a form to mimic it... Check out this thread from a few days ago: Query Builder functionality
    Thank you,
    Tony Miller
    Webster, TX
    On the road of life...There are 'windshields', and there are 'bugs'
    (splat!)
    "Squeegees Wanted"
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Query Builder Component added to Raptor?

    Have briefly tried out Raptor and have liked what I've seen so far. I'm sure the features will continue to grow over time too.
    Our developers use Oracle Query Builder on a daily basis to develop queries as well as ad-hoc reporting. As an E-Business Suite Customer we've been running into issues with the 8192 object limitation in QB. I'm wondering if plans are in the works to add some sort of graphical Query Builder functionality to Raptor and to remove the 8192 object limitation.

    I would recommend that you look at the Paradox for Windows query by example as a way of implementing this feature in Raptor. While the interface may appear to be old (less sexy) compared to some of the newer graphical methods of performing this activity (i.e. MS Access or HTMLDB); I find that it is an efficient tool for minimizing the amount of text that I have to write for SQL. Once I've developed the bulk of my query graphically, I then use the SQL converter and customize from there. The QBE metaphor I find much easier to manage then all of the drag and drop found in some of the interfaces today.
    Another recommendation that I have is that you look at using the newer join syntax than the old (e.g. left outer join).

  • Function in report query builder

    Hi,
    It is possible to call a function in the select statement of a report query builder as followed :
    select my_func()
    from my_table
    The function is defined as :
    create or replace my_func() return vachar2 is
    v_temp vachar2(100);
    begin
    v_temp := 'column_1, column_2, column_3';
    return(v_temp);
    end;
    Therefore, the query should be interpreted as:
    select column_1, column_2, column_3
    from my_table
    and the fields "column_1", "column_2" and "column_3" with the same alias name would be created for the report.
    Thank you,
    DS

    Ok. Here is the way!
    Create user parameter p_query. Datatype Character. Width 10000. Set initial value as
    select RPAD('n',10) c1, RPAD('n',10) c2, RPAD('n',10) c3 from dual
    ** Suppose type of column 1, 2 and 3 is character and maximum length can be 10. So using this in above select statement.
    Get value in After Parameter Form trigger
    begin
    :p_query := yourfuntion;
    return(true);
    end;
    data model will have only this:
    &p_query
    Now you will see three columns in data model
    c1
    c2
    c3
    NOW error ORA-24333 can appear, when function/procedure doesn't return back anything for data model, I mean lexical parameter p_query is empty.
    ** You can replace whole select statement with lexical parameter.

  • Functions Not Available in Query Builder

    Application Express 4.1.1.00.23
    When we go into the Query Builder and select a table and then, select a column, this adds a row for that column below the table. In that newly added row, there is a dropdown labeled "Function". However, this drop down is never enabled, i.e. clicking it has no effect.
    Inspecting this element in Chrome, we find that the following error is being thrown at line 502 of qb_core.js
    >
    Uncaught TypeError: Cannot call method 'indexOf' of undefined
    >
    The offending line appears to be:
    var lid = tableDiv.childNodes.id.substring(0,tableDiv.childNodes[i].id.indexOf('_'));
    Has anyone seen this or does anyone have a work around?
    Thanks,
    -Joe                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Mehabub,
    Seems hard to believe that it is working for you. We are on Chrome 21.0.1180.89 m. This is not working for anyone (was originally reported by an End User). BTW, we forced our users to abandon IE in lieu of Chrome. Clearing the cache makes no difference.
    It does not work in Safari. Safari -5.1.7 (7534.57.2) throws errors here:
    >
    qb_core.js:129TypeError: 'undefined' is not an object (evaluating 'e.explicitOriginalTarget.id')
    >
    if (e.explicitOriginalTarget.id == 'QUERYTEXT'){
            if (e.ctrlKey == true && (e.charCode == 97 || e.charCode == 99)) {
              return e.keyCode;
            } else {
              return false;
        }It does not work AT ALL in IE. IE doesn't even add the row for the selected column in the GUI. It throws this error (from F12 Debug):
    >
    SCRIPT5022: DOM Exception: HIERARCHY_REQUEST_ERR (3)
    qb_core.js, line 1389 character 5
    >
    This is the section of the code it dies on:
    if(document.all){
        table.firstChild.appendChild(newTR);
      }else{
        table.appendChild(newTR);
      }It does work in FireFox (15.0). This is the only browser for which this works (for anyone here).
    -Joe

  • Query Builder - Data types & functions

    Hi,
    I have a couple of questions relating to the Query Builder
    a) Why can I not select columns of datatype FLOAT? Are there any others?
    b) Is it possible to add functions to the list of functions in Query Builder.
    I am trying to read thru the User Guide but do not always have time. Are there sections of it that would be considered more pertinent??
    Thanks
    Steve

    Hi,
    I have a couple of questions relating to the Query
    ry Builder
    a) Why can I not select columns of datatype
    atatype FLOAT? Are there any others?Use Number, and specify scale or the places after the decimal point
    >
    b) Is it possible to add functions to the
    to the list of functions in Query Builder.Can't help on this topic.
    >
    I am trying to read thru the User Guide but do not
    ot always have time. Are there sections of it that
    would be considered more pertinent??
    Thanks
    Steve

  • Group by clause using query builder

    Hi,
    I have some event pages (pages created using a template called event) which are tagged with event types and I have 5 event types in total. In the event listing page, i want to show the events grouped by event types.
    Is there a facility in query builder to use "group by" which returns be results in different buckets?
    Is thats not the case, i have to run 1 query per event type which means i have to run 5 queries. (or i get the event type as facets -> get the buckets -> get the predicate for each bucket -> run one query per bucket which again is nothing buket one query per event type). I dont want to do that.  
    Hence using the query builder or any other form of querying, is there a way to group the results?
    Regards,
    yadhu

    Perfect... thats answers the query...
    Basically the summary is I cannot use aggregate functions like group by. Once i get the search results, i can either use facets, get the bucket predicates and drill down the search OR get all the results, do look up on property (using Node.getProperty) of each node in the result and build my UI based on mere coding. Am I right?

  • Using dimension attributes in the Query Builder Bean

    All...
    I am developing an HTML client based tool using the JSP tags. I wish to create a report that selects the appropriate dimension value based upon an attribute.
    But...
    Using the query builder I can not select dimension values based upon dimension attributes. Is this possible? The only use I have found for the attributes is when I am sorting my selected diemsnion values.
    Thanks in advance
    Dylan.

    1. Java Client QueryBuilder has support for selecting dimension members based on an attribute.
    To use this functionality, go to Dimensional Panel -> Conditions tab. Drill on Match group of conditions. The attribute condition appears as the last available condition, but only for dimensions that have attributes.
    To test this, use BIBDEMO schema supplied with BI Beans and look at conditions for Product dimension.
    2. If you wish to display dimension attributes and their values in the HTML client UI,
    here is how you can retrieve attributes and their values for a dimension:
    (e.g. for Product dimension in BIBDEMO)
    String dimensionID = "MDM!D_BIBDEMO.PRODUCT";
    String hierarchyID = null;
    MDDimension dimension = metadataManager.getDimensionByUniqueID(dimensionID);
    MDHierarchy hierarchy = dimension.getDefaultHierarchy();
    if (hierarchy != null)
    hierarchyID = hierarchy.getUniqueID();
    // Retrieve all the attributes for this dimension
    MDAttribute[] attributes = dimension.getAttributes();
    if (attributes != null && attributes.length > 0)
    String attributeID = null;
    AttributeListStep attrStep = null;
    Selection sel = null;
    MetadataMap map = new MetadataMap(new String[] {MetadataMap.METADATA_VALUE});
    for (int i=0; i<attributes.length; i++)
    // Get the unique ID for the attribute
    attributeID = attributes.getUniqueID();
    // Create and evaluate an AttributeListStep
    attrStep = new AttributeListStep(dimensionID, hierarchyID, attributeID);
    sel = new Selection(dimensionID);
    sel.setHierarchy(hierarchyID);
    sel.addStep(attrStep);
    // Evaluate the AttributeListStep and get the DataAccess
    DataAccess da = query.createQueryAccess().getDataAccess(sel, map);
    // Walk the DataAccess and get the attribute values
    if (da != null)
    int extent = da.getEdgeExtent(DataDirector.COLUMN_EDGE);
    for (int i=0; i<extent; i++)
    // Get the attribute value
    strValue = (String)da.getMemberMetadata(DataDirector.COLUMN_EDGE, 0, i, MetadataMap.METDATA_VALUE);
    // Add the value to a drop down or another UI element...

  • SQL developer 3.0 - Few Query Builder issues

    Hi All,
    I have just started using SQL Developer 3.0 so have not fully browsed thru all of the available options in SQL Developer. I have been trying to work on creating and editing sql statements using Worksheet and Query Builder.
    I am working on to test this tool so I can give it to the users for them to try and use it - they used to work on the old Query Builder 6.0.7....since it is already de-supported long back to work against 11g database, I am hoping to tell them to use SQL developer 3.0 instead.
    Hence, if an user doesn't know how to write a sql statement, he/she would try to do the same using Query Builder.
    So, the following questions are more aligned towards a normal user who would try to create a query in the Query Builder window, instead of directly typing a sql statement in the Worksheet window.
    1) How to establish/create a relationship between tables after you have dragged down the tables into the Query Builder window? - i tried but couldn't get any options!.
    2) Sometimes I see 'Connection closed' error when i try to run a query. How to refresh the connection without opening a new Connection tab?
    - I tried this but evertytime it opens up a new connection tab, while the old tab is still present.
    3) Columns in the Expression field in Query Builder window can ONLY be displayed in the result set, if the 'output' box on the extreme left of the 2nd section in Query Builder window is checked.
    Now when i try to check the output box for an expression (with few aggregate functions), the 'Grouping' check box automatically gets checked, which when run throws an ORA-00934 error: group function is not allowed here...but when I de-select the 'Grouping' check box, the 'output' box also gets un-checked!.
    How to solve this out?
    Please let me know the resolutions of the above - much appreciated.
    With Regards,
    Pamir
    Edited by: user651047 on 11-Aug-2011 07:53

    Hi,
    As Raghu noted above, and you also saw in rp0428's following reply,
    Re: Problem with displaying sdo_geometry objects
    drilling down to the cell edit details is your only recourse for now. Apparently there will be further work done in this area, but it is not clear exactly what or when it will be. For those with access to it, here is a bug reference:
    Bug 13680849 - RC1: NOT DISPLAYING THE DATA OF MDSYS.SDO_GEOMETRY
    Regards,
    Gary

  • Apex 4.2 - Query Builder buglet

    Hi,
    when I am trying to create a new report in Apex 4.2 using the Query builder. As the Query builder pops up, the Region that will hold the SQL pops up with an error looking something like this;
    *1 error has occurred Report SQL must be specified. (Go to error)*.
    Obviously whatever validation is creating this error should only happen when you click on the next button as opposed to when the Query builder is popped up.
    I was able to reproduce this on apex.oracle.com
    Kofi

    The query builder in report query as a BIG BUG!!! If have 2 tables and link its and sel some fields in query builder popup the result dont work. If you click in download button you receive this message: "apex/wwv_flow.accept was not found on this server". If your query was a litle query this function work well but if your query have more than 2 tables the report query doesnt work, This is a Oracle Apex BUG!

  • SQL Developer replacing Query Builder 6.0.7

    Dear All,
    We know SQL Developer 3.0 has a link to Query Builder from within it, but does it contain a similar structure as we saw in the old Query Builder 6.0.7 developed by Oracle long back?
    The old Query Builder 6.0.7 could be used for editing and creating parameterised queries and generating formatted output, so just want to know if we can get the similar functionality using SQL Developer 3.0.
    1. Whether SQL Developer 3.0 can create and edit queries by selecting data tables in Oracle?
    2. Can it convert any old Query Builder queries (in .brw extension) to a format that can be run in SQL Developer 3.0?
    I am about to download and install the SQL developer 3.0, but thought of asking here first and get some advice/views.
    So, Please reply back with anything that might help me out.
    With Regards,
    Pamir

    Yes thanks Jim...I realised that when I started to dig more into this.
    Now I have downloaded and installed the software...currently am able to create, edit queries and do other stuff.
    With Regards,
    Pamir
    Edited by: user651047 on 11-Aug-2011 06:56

  • Tables not in Query Builder table list bug?

    In HTML DB version 1.6.0.00.87 we have tables defined in our schema in our workspace. When we create a view and click on the [Query Builder] link, no tables are in the drop down list for our schema. Why? The schema is there. I can go into the SQL Workshop and query the records our of the tables, but they are not listed in the [Query Builder].
    I tried this same function but with my workspace at htmldb.oracle.com. The tables in my schema are listed there.
    Is this a bug that was fixed in version 1.6.1.00.02?

    There is one schema assigned to the workspace. That schema is listed in the pop-up window. Here are the steps I am doing:
    1.) Click on SQL Workshop
    2.) Click on Create Object
    3.) Click on View
    4.) The correct schema is listed in the Schema field. There is only one schema in the drop-down list for the Schema field.
    5.) Click on [Query Builder]. A separate browser window appears with the correct schema. There is only one value in the drop-down list for the schema. "- Select Table -" is in the TABLE field.
    6.) I click on the TABLE field to get a list of tables for the schema. Only "- Select Table -" is listed. No other tables are listed.
    I can cancel the Create View and return to the main page of the SQL Workshop. I can click on Tables to see what table are available. I select the correct SCHEMA and see the list of tables.
    I tried this in the same version of HTML DB (v 1.6.0.00.87) in a different database ie. a different HTML DB repository and received the same results, missing tables in the pop-up page
    I do not know why the tables do not list in the [Query Builder] for the Create View.

  • Query Builder - sort order causing ORA-00979 error

    Hello,
    I'm having an issue with the "sort order" clause in the query builder tool when using a function on the same column.
    I've build a simple query in the gui and the following statement is displayed in the SQL Window
    select     "DEMO_ORDER_ITEMS"."ORDER_ID" as "ORDER_ID",
         sum(DEMO_ORDER_ITEMS.QUANTITY) as "QUANTITY"
    from     "DEMO_ORDER_ITEMS" "DEMO_ORDER_ITEMS"
    group by DEMO_ORDER_ITEMS.ORDER_ID
    and if I add a sort order of "1" on the quantity field, the following query is changed to
    select     "DEMO_ORDER_ITEMS"."ORDER_ID" as "ORDER_ID",
         sum(DEMO_ORDER_ITEMS.QUANTITY) as "QUANTITY"
    from     "DEMO_ORDER_ITEMS" "DEMO_ORDER_ITEMS"
    group by DEMO_ORDER_ITEMS.ORDER_ID
    order by DEMO_ORDER_ITEMS.QUANTITY DESC
    When running this query I get an error
    failed to parse SQL query:
    ORA-00979: not a GROUP BY expression
    It is quite obvious what is wrong with the query but I don't know how to get the query builder tool to generate the correct statement. The order by clause should be order by sum(DEMO_ORDER_ITEMS.QUANTITY) DESC.
    I've tried to do some searching and haven't found much documentation on this issue. Any assistance is appreciated.
    Thanks,
    Tony

    While this statement is generally certainly true and should also be remembered, it is not really helpful for the specific case.
    I think the behaviour described is a bug. However this might be one a little difficult to solve. The user unfortunatly can't influence much of the query builder results directly.
    Either put 1 into the order by clause or use the column alias name without table alias name ("QUANTITY" only).
    My personal solution would be NOT TO use any sort criteia in the query builder. This makes sense in so far as the generated SQL is often basis for some report. If that is an interactive report you won't add a sort order anyway. This is a layout thing and layout will be handled by the end user itself. he can choose whatever sorting he wants.
    Edited by: Sven W. on Jul 22, 2009 11:43 AM

Maybe you are looking for

  • Mini DVI-to-Video Cable

    Hi, I've been looking to get a cable to connect my macbook to a normal widescreen CRT TV. I found the Apple Mini DVI to Video cable on the website, but it doesn't list the Macbook as one of the compatible systems. Can someone let me know - preferably

  • Disc doesn't burn all the way?

    This has happened a couple of times. I'll share an iMovie to iDVD and start burning the disc. iDVD goes through the whole process, ejects the DVD and asks me if I'm done or not. I put the DVD in a player, it starts up and shortly into the film just s

  • Oracle Forms doesn't work !

    Whenever I try to run an Oracle 9i form it just "hangs" on the screen saying "Oracle 9iAS Forms Services" -nothing else happens. Brilliant ! Congratulations Oracle - you plumb new depths with every passing release. Your software is now not only almos

  • Re-installing OS on a new hard drive

    I'm planning on buying a basic Mac Mini (1g mem, 120g HD) and upgrading the memory and hard drive to save myself about 140 bucks. Anyhow, my question is will I be able to use the OS Install/Recovery DVDs that come with new Mac Mini's to install every

  • Best way to deal with time

    Hi ! I have a time 00:12:30.456 which I want to convert to a time 676 milli seconds later. I know I can do this by calculating each part of the time, but is there a java object one can use to do it simpler? Thank You!