Dynamic Query Data issue...Apex Charts

Database version and APEX version are in the tags...11g  and4.1.2
  I have data in this format
NODE_NAME
REPORT_DATE
STORAGE_AMOUNT_ALLOC
Anole
01/01/2013
3175
Fiji
01/01/2013
0
Anole
02/01/2013
3175
Fiji
02/01/2013
0
Anole
04/01/2013
3276
Fiji
04/01/2013
0
Anole
05/01/2013
3276
Fiji
05/01/2013
0
Anole
06/01/2013
3276
Fiji
06/01/2013
0
I've build a Dynamic query which returns:
SELECT NULL LINK,report_date DATIME,decode(NODE_NAME,'Anole',STORAGE_AMOUNT_ALLOC)"Anole",decode(NODE_NAME,'Fiji',STORAGE_AMOUNT_ALLOC)"Fiji" FROM STORAGE_REPORTS WHERE report_date between to_date('01-JAN-2013','DD-MON-YYYY') and to_date('01-JUN-2013','DD-MON-YYYY') and (INSTR(':Anole:Fiji:', ':'||NODE_NAME||':') > 0) ORDER BY report_date ASC
The resultant data is
LINK
DATIME
Anole
Fiji
01/01/2013
3175
01/01/2013
0
02/01/2013
3175
02/01/2013
0
04/01/2013
3276
04/01/2013
0
05/01/2013
0
05/01/2013
3276
06/01/2013
3276
06/01/2013
0
When I put the above query to the chart it give me accurate series with one..however when I add a second NODE to the query it completly hacks the chart. I have a feeling this is because I have repeating dates and it doesn' know how to handle this. So I'm wondering how I get rid of the repeating dates. and make them all one row with columns for each series.
Thanks
Rob

apex version?  database version?
if you're on 11g, it sounds like you want the PIVOT command.
you should also post a simple CREATE TABLE and a few INSERT statements so others can test.
select null link
  ,report_date as datime
  ,"Anole", "Fiji"
from ( select REPORT_DATE, NODE_NAME, STORAGE_AMOUNT_ALLOC
  from STORAGE_REPORTS
PIVOT (
  sum( storage_amount_alloc )
  for (node_name)
  in ( 'Anole' "Anole", 'Fiji' "Fiji" ) -- rename columns here
where report_date between to_date('01-JAN-2013','DD-MON-YYYY') and to_date('01-JUN-2013','DD-MON-YYYY')
order by report_date asc

Similar Messages

  • Question on Dynamic Query Data Source and Form Folders in Oracle Forms 6i

    Hi there -
    I have one interesting requirement in Oracle Forms.
    This is what I wanted to do.
    1. Have a LOV and Go button on Form.
    2. From LOV, I will select a pre-defined custom table and click Go.
    3. Based on the selected custom table, I have to populate the Block (Tabular Format).
    4. User should be able to do update, delete, insert on this block.
    5. User should be able to use the Oracle Form folders functionality (select only necessary column and save views etc. Std folder functionality).
    6. If user selects a different custom table name in the LOV on top, I need to refresh the data from the block based on this new table. Remaining functionality should be as it is (steps 3 to 5).
    You can see here, I am going to have dynamic query data source (Table Name as well as column mapping) on the block. I do not know before hand how many columns the user selected table has!
    This is what I have planned for this so far but I have some major questions before I can move on with this design:
    1. I am going to create a table structure with fixed number of column in form (40 cols assuming that the custom table will not have more that 40 cols). (Kind of limitation but it's okay as of now).
    2. Dynamically populate the block based on the table name selected by the user from LOV. Dynamically change the table column names based on the table selected etc.
    3. Perform insert, update, delete using PL/SQL package.
    So far it looks okay.
    Now my real question is,
    Can user still be able to user "Folders" functionality here? I have never done this kind of development before and I doubt the dynamic column naming, dynamic column data source will really work for "folders"!
    Also, I am not really sure whether user will be able to save these "folder" queries?
    Okay so form experts, can you ppl suggest me if this is really going to work? Are there any better ways to do this?
    Initially I tried to do this in OA Framework but I got stuck at because as per OAF developer guide "I cannot user OAF personalization for dynamic items, regions etc".
    For more info on that thread see this link...
    Re: setUserCustomizable issue!
    Thanks in advance for the help.

    Any suggestion anyone?

  • Ad Hoc Query Data Issue for Position Based Infoset

    Experts,
    I've created an infoset that is based on the S object using the PCH database.  For this infoset, I've included several infotypes with focus on 1000, 1001, and 1028.  I've included the Address infotype (1028) as this is where we store our work location information.  For some reason though when I attempt to pull information from 1028, specifically the House Number and Street field, the Postal Code field, and the City field.
    For some reason though, no data is being returned in those fields.  I've verified for the position (in PP01) that I'm querying on that the data is maintained in 1028, and I've verified that I'm attempting to report on the correct fields by verifying the field technical names I'm pulling in the Ad Hoc Query with those I know have data stored in them on the infotype for the specific position.
    Would anyone have any guidance on what could be happening here or what I might need to adjust to be able to pull this data?
    Thanks in advance for your time and help.
    Best Regards,
    Joe

    To add some further clarity to this item, the Address infotype on the Position (S) object is pulling from a dropdown of selectable Buildings.  If unfamiliar, the Building drop is populated by configuration data from the IMG.  The fields that are populated then in the Address infotype actually come then from the Building entries and are simply populated onto IT1028 (address) depending on which Building is selected.
    I think this is what it occuring then when I select the fields from the Address infotype and I see nothing populated in the Ad Hoc query since the field information is not actually stored in IT1028 but on in the Building entry.
    Has anyone else experiencing this particular problem?  If so, have you found a solution?
    Regards,
    Joe

  • Using htp.p for print dynamic data in apex region make my page slow?

    Hi, everyone!!! My name is Rafael, and...
    I search in the web and in this forum but i can´t find a answer for my doubt.
    Using the procedure htp.p for print dynamic data in apex region through on demand process , this will leave my webpage slow to load when the user access?
    Example:
    For build a menu in my webpage, it´s read a function in the database that returns variable string, so by a demand process this string is obtain and print in a web page using htp.p.
    I notice that this practice causes slow to load the data on the page.
    This is it...
    If someone help me, thanks...
    bye and Happy new Year!!!
    Edited by: user9518141 on 26/12/2009 17:19

    Hi,
    Try commenting out the function call and print some sample text in the htp.p like htp.p('Hello world..');
    I think the function call is probably taking a lot of time .. not htp.p.
    I have used htp.p to print out values dynamically in a lot of situations and have not ever come across any performance issues.It could be a problem with the function you are calling.
    Thanks,
    Rajesh.

  • Using jquery FullCalendar in APEX with dynamic query

    Hi,
    I am trying to implement jquery FullCalendar in APEX and came across thie following post but I am unable to get the events to work. I would really like to see it working with an Application_Process:
    How we can highlight events in Calendar
    Currently I created an Application Process that simply calls a DB table and convert it into json format.
    DECLARE
    v_sql varchar2(400);
    BEGIN
    v_sql := 'SELECT * FROM CAL_FEED';
    apex_util.json_from_sql(v_sql);
    END;
    But I am unsure how to add the events via an Application_Process.
    I have tried the following in numerious ways (events:function, url feed, etc). It does work if I just do an array but would like it as a dynamic query.
    $('#calendar').fullCalendar({
    events: "http://server:8080/apex/f?p=101:53:4352610578859707:APPLICATION_PROCESS=IAT_TEST_CAL_FEED"
    Thank you in advance,
    Jimmy

    Hi,
    I was able to get the events into Fullcalendar with an Application Process but not sure if this would scale well with alot of events.
    Would someone be able to tell me if there is a better way?
    I am currently using an On Demand Application Process called IAT_TEST_FEED:_
    DECLARE
    lv_cal_list VARCHAR2(16000);
    lv_return_str VARCHAR2(32000);
    BEGIN
    FOR i IN (SELECT "CAL_FEED"."ID" as ID,
    "CAL_FEED"."title" as caltitle,
    "CAL_FEED"."start" as calstart,
    "CAL_FEED"."end" as calend
    FROM "CAL_FEED")
    LOOP
    lv_cal_list := lv_cal_list || '{"id":' || CHR(39) || i.ID || CHR(39) || ',' ||
    ' "title":' || CHR(39) || i.caltitle || CHR(39) || ',' ||
    ' "start":' || CHR(39) || i.calstart || CHR(39) || ',' ||
    ' "end":' || CHR(39) || i.calend || CHR(39) || '},';
    END LOOP;
    lv_return_str := '[' || RTRIM(lv_cal_list,',') || ']';
    htp.prn(lv_return_str);
    EXCEPTION WHEN OTHERS THEN
    htp.prn('error');
    END;
    In a HTML Region on a page within the Region Header:_
    <link rel="stylesheet" type="text/css" href="#WORKSPACE_IMAGES#fullcalendar.css" />
    <script type="text/javascript" src="#WORKSPACE_IMAGES#ui.core.js"></script>
    <script type="text/javascript" src="#WORKSPACE_IMAGES#ui.draggable.js"></script>
    <script type="text/javascript" src="#WORKSPACE_IMAGES#ui.resizable.js"></script>
    <script type="text/javascript" src="#WORKSPACE_IMAGES#jquery.js"></script>
    <script type="text/javascript" src="#WORKSPACE_IMAGES#fullcalendar.js"></script>
    <script type="text/javascript" src="#WORKSPACE_IMAGES#fullcalendar.min.js"></script>
    <script type='text/javascript'>
    $(document).ready(function() {
    $('#calendar').fullCalendar({
    events: function(start, end, callback) {
    $.ajax({
    type: "POST",
    url: "wwv_flow.show",
    dataType: "json",
    data: {
    p_flow_id:$('#pFlowId').val(),
    p_flow_step_id:$('#pFlowStepId').val(),
    p_instance:$('#pInstance').val(),
    p_request:"APPLICATION_PROCESS=IAT_TEST_FEED"
    success:function(calevents){
    $.each(calevents, function(i, calevent){
    $('#calendar').fullCalendar('renderEvent', calevent, true);
    </script>
    The line within the ajax call is basically where my concern would be
    $('#calendar').fullCalendar('renderEvent', calevent, true);
    Thank you,
    Jimmy

  • Querying EBS data from APEX through PL/SQL process

    Hi all,
    I have read through http://www.oracle.com/technetwork/developer-tools/apex/apex-ebs-wp-cabot-consulting-169064.pdf
    and    http://www.oracle.com/technetwork/developer-tools/apex/learnmore/apex-ebs-extension-white-paper-345780.pdf
    But I still do not have much idea on how do I query for data from ebs. What I am trying to achieve is to query for a table in EBS and put the data as a httpresponse
    then parse the data using javascript by creating a html region in APEX.
    Previously, I was creating an application process in the following manner
    declare
    element_List varchar2(4000) := '';
    begin
    begin
    for i in (select END_MEASURE from SCS_ELEMENT_DATA where ATTRIBUTE10 = :P9_ASSET_ID) loop
    element_List := element_List || i.END_MEASURE || ' ';
    end loop;
    exception when no_data_found then null;
    end;
    htp.prn(element_List);
    end;
    My table structure in EBS is something like this:
    XXEAM_LAM_ELEMENTS (lam_element_id, csi_instance_id, element_name, element_desc, label, type, continuous, reference, shared, start_measure, end_measure, lat_long)
    Would appreciate any advice as I'm new to both APEX and EBS.

    Hi Scott and Tom,
    Sorry about this.
    My Apex is installed in the same instance as my EBS. I assume this means they are in the same DB? So if this is the case, can I just query with the EBS table name and the APEX application will know its EBS table and not APEX table?
    Because previously my query was based on APEX tables and now I have query based on my EBS table using an APEX application process. I couldn't really understand what's needed even after looking through the whitepaper. I do not need to create a view/report based on the queried data because my APEX page only has a HTML region where I put all my javascript code in.
    Hope this is clearer. Sorry for not being clear on my issue.
    Regards,
    CS

  • SAP MII 14.0 SP5 Patch 11 - Error has occurred while processing data stream Dynamic Query role is not assigned to the Data Server

    Hello All,
    We are using a two tier architecture.
    Our Corp server calls the refinery server.
    Our CORP MII server uses user id abc_user to connect to the refinery data server.
    The user id abc_user has the SAP_xMII_Dynamic_Query role.
    The data server also has the checkbox for allow dynamic query enabled.
    But we are still getting the following error
    Error has occurred while processing data stream
    Dynamic Query role is not assigned to the Data Server; Use query template
    Once we add the SAP_xMII_Dynamic_Query role to the data server everything works fine. Is this feature by design ?
    Thanks,
    Kiran

    Thanks Anushree !!
    I thought that just adding the role to the user and enabling the dynamic query checkbox on the data server should work.
    But we even needed to add the role to the data server.
    Thanks,
    Kiran

  • Data web bean (chart) using a dynamic view object

    Please I want a quick help. I read all forums concerning this subject but I still couldn't do it.
    - I create a view object which takes a proameter using the ? style parameter.
    - I passed the parameter from an html page and execute the query
    of the view as follows:
    <%
    String deptno = request.getParameter("deptno");
    if(deptno != null) {
    oracle.jbo.html.jsp.JSPApplicationRegistry.registerApplicationFromPropertyFile(session , "MyProject21_package3_Package3Module");
    oracle.jbo.ViewObject v = oracle.jbo.html.jsp.JSPApplicationRegistry.getInstance()
    .getAppModuleInstance("MyProject21_package3_Package3Module",request,session)
    .findViewObject("View1");
    v.setWhereClauseParam(0,deptno);
    v.executeQuery();
    %>
    - And then I used the data web bean chart as follows:
    <jsp:useBean class="oracle.jbo.html.databeans.ChartRenderer" id="ch" scope="request" >
    <%
    ch.setReleaseApplicationResources(false);
    ch.initialize(application,session, request,response,out,"MyProject21_package3_Package3Module.View1");
    ch.setCommonScriptName("/webapp/jsp/chart_common.jsp");
    ch.getChart().setGraphType(ch.PIE);
    ch.setSeriesLabelColumnName("DeptNo");
    ch.setDisplayAttributes("CountEmplNo");
    ch.getChart().setPieFeelerTextDisplay(0);
    ch.getChart().setPieTilt(10);
    ch.getChart().setPieRotate(0);
    ch.getChart().setLegendDisplay(true);
    ch.getChart().setLegendMarkerPosition(0);
    ch.getChart().setTitleString("Title");
    ch.getChart().setSubtitleString("Subtitle");
    ch.getChart().setFootnoteString("Footnote");
    ch.setImageWidth(400);
    ch.setImageHeight(400);
    ch.render();
    %>
    - I tried to use the View1 as a view name, and the v as a view name
    but both of them get the same result
    SQL Statement error and the sql statement is displayed with the ? in it which means that he didn't replace it by the parameter.
    Please I need quick help.
    Thanks.
    </jsp:useBean>
    Remark : please send me the reply at "[email protected]"

    Hi Rishab,
    I'm running into the exact same problem, in the same situation. Did you solve this problem and can you tell me how?
    Thanks in advance,
    Paskal

  • Query Data Block issues

    We have a legacy Forms and Reports application(~750 items combined). I suspect the applications were developed initially under 6i, but they work quite well under 10GR2, and is testing well under 11GR2 (which we plan on migrating to soon). We ran into an issue the other day for Data Query Blocks, and wanted your expert opinion on it.
    Due to a change in business requirements, we recently had to increase the length of a database field (from 20 to 30). We went into Forms Developer, made the appropriate changes, and recompiled them all successfully. Everything *seems* to work fine, but we noticed we get failures on any item that tries to utilize that extra 10 characters. Apparently this is because the Query Data Block seems to use a cached/stale copy of the database field sizes, and still expects a size of 20! What we realized now is that we have to go into each of those forms, and REFRESH the Data Block (through the Data Block Wizard) for every one of them.
    My question is this: is there anyway to force the Form to refresh those Query Data Blocks absent going into each one and REFRESHING it? We've tried compiling through Forms Developer, and through Batch Compiles, and nothing seems to get those cached copies to update. I'd really prefer to tackle this issue once and for all since we are prepping for migration testing.  Frankly I suspect the table space was tweaked a good bit over the years since development (before I ever got here), and if they didn't REFRESH those Data Blocks properly, a great many of the Forms will be suffering this same cached/stale view problem.
    Appreciate your thoughts,
    Dave

    Q_Stephenson,
    That's an excellent suggestion.  I have seen vague hints and allegations of Forms manipulation using that method, but never felt comfortable with my overall knowledge(*) of Forms to look at it that deep.  I think it's time to clear some space and dig into the topic for a better look.
    Thank you,
    Dave
    (*) The majority of my programming background is in Java; it's only been recently that I've had to really dig deep into Forms.

  • Issue in attaching dynamic Query to the View Object

    Hi,
    We are having a View Object attached to the JRAD page.
    The View object is build thru as Expert mode. There is no any CDATA
    SQLQUERY stored in the VO.xml file.
    We are building the query dynamically and attaching it to the VO in
    RUNTIME.
    The code is as below
    // getFcstQuery() is method used to return the dynamic query
    String query = getFcstQuery();
    // Setting the Query to View Object
    getViewDef().setQuery(query);
    setQuery(query);
    The JRAD page has sorting option on 5 columns. so when a sorting is
    done the data are interchanged between the clients.
    For example how the query will be build id
    Say for the first user the query will be as
    "select ename,eno,dno from emp where eno=1 "
    for the second user the query may be
    "select ename,eno,dno from emp where eno=2 "
    Now if both the user hit the sorting on any of the column the data is
    interchagned between this both users.
    Please provide solution if possible.
    Thanks in advance
    Balamohan

    Hi Steve,
    We are using 5 tables in building the query.
    Say,
    1) summary
    2) transactions
    3) transactions_history
    4) rules
    5) rules_temp
    but only 2 tables are used at a time
    for read only we are using
    summary table
    for edit only mode we are using
    1) transactions and
    2) rules
    tables
    for edit and recalculate mode we are using
    1) transactions and
    2) rules_temp
    tables
    for one more condition we are using
    1) transactions_history and
    2) rules
    tables
    From all the above combination we are getting 5 columns. All the columns are defined the above combination tables. So using the same region. based on the conditions the combination of tables will change.
    Becoz of this we are building the query dynamically.
    Thanks
    Balamohan

  • Dynamic data inside a chart's dataProvider

    Dear Members,
    I am adding some extra touches to my application, it's basically a tool to give online presentations so I would like to add some charts for a more visual experience.
    I am using the Flex Pie Chart that I create dynamically with actionscript:
    private function createChart():void
         series = new PieSeries();
         series.nameField = "label";
         series.field = "data";
         series.filters = [];
         chart = new PieChart();
         chart.percentWidth =100;
         chart.percentHeight = 100;
         chart.showDataTips = true;
         chart.dataProvider = medalsAC;
         chart.series = [series];
         charts.addElement(chart);
    The above code works fine, the problem is with providing the data for my chart. Below you can see that I created some variables in which I store data. Now the problem is that when I assign these variables like you see below, the chart won't show them. It only shows the static data (200) from the first product.
    So I wonder what I am possibly doing wrong? I guess it's something very simple, but without those dynamic vars I can't use the charts.
    private function setChartData():void
         var data2:uint = 200;   
         var data3:uint = 300;
         var data4:uint = 200;
         var arr:Array = [];
         arr.push({label:"Product 1", data: 200});
         arr.push({label:"Product 2", data:data2)});
         arr.push({label:"Product 3", data:data3});
         arr.push({label:"Product 4", data:data4});
         medalsAC = new ArrayCollection(arr);
         createChart();

    I don't think Wayne is kidding at all.
    You stated earlier: "But it is clear that Numbers resembles Excel."
    In the very general sense (both are spreadsheet applications), that's true. But it is also clear that a Smart car resembles a Peterbilt tractor unit. Both have two axles, limited passenger seating and engines that require Diesel fuel. I wouldn't use either to do what the other is intended to do, nor would I expect each to behave exactly like the other.
    You describe what you want to do as "something simple." It may well be "simple" (it certainly looks simple, and requires simple actions on the part of the user—in either application), but unless you have programmed that function, you have nothing on which to base the assumption that it is "simple."
    Your original question was: "What is the equivalent in numbers?"
    In the "simplest" terms possible: There is no equivalent in Numbers.
    Wayne has described for you how to accomplish a similar result. You have explored and found  way to make the result closer to the result in Excel.
    He has also given you the information on steps to take to suggest to Apple (rather that to the users in this community) that the method of achieving this result be improved.
    That's about as far as it can go in this forum.
    Regards,
    Barry

  • Customize Apex charts

    Hello,
    I'm an Oracle DBA thats slowly learning Apex. our company wants to use Apex for forms and various reports. I have absolutely no XML, Java, HTML or any such knowledge that would be usefule for webdesigners. i rely mostly on the settings Apex provides, but i'm learning a few tricks here and there.
    my question is, how to customize/edit charts? here are open issues:
    - i have a 3D stacked bar chart (flash chart). i want to be able to
    - add a line to this chart for the same data. the line can be a "trendline" or some fixed value. i saw a website (AnyChart) that offers this soultion, but have no idea how to incorporate this. in any case, i did some tests, and it didn't work.
    - changing the Legend: we want to be able to change the order of the legend, so that it fits the chart! seems like a simple thing, but Apex does not offer this. it shows the legend in reverse order to the chart.
    Also, the Legend seems to fix a capital letter to the first character of a word, the rest is small.
    ex: we want a legend definition "AA KCOO" and we get "Aa Kcoo". we define this in the SQL Query, but it doesn't accept this.
    i suppose all this can be changed in XML coding, but how, and more important, why? shouldn't a tool like this have that option of changing these things? the GUI tool seems so limited here. its nice that you can customize in XML, but i think these are missing options..
    can anyone help, or guide me to the right documentation?
    thanks,
    mike

    Hi Dimitri,
    thanks for the tip.
    first of all, getting the item in like you mentioned did not work. i tried with and without the single quotes
    without quotes (<line value=&P8_LINIE etc) gives me an "XML Error was malformed" message, and with the quotes (<line value='&P8_LINIE' etc) gives me a completely differnt number! it draws a line at the very top of the scale, fixed at 160 in my case.
    i did another tes, redoing the flash chart in a different region. exact same error, only this time, since i set my y- axis max value at 180, then the line was drawn at the top again - so it seems like the line is automatically drawn at the place where the chart value was defined for maximum...
    oh well, no idea where this comes from...
    as far as Anychart goes - i took a look at the website - it costs a fair bit for this newer version! for one developer license 500 USD, for 4 developers 1000 USD!
    my question is: will a future Apex have the newer version? would it make sense to buy this or should we wait until Apex 4.0 comes out?
    i have since discovered another thorny issue with Apex charts, but i will open a new thread for that. see my "remove marker from 2D Line flash chart" thread
    so far, i'm quite frustrated at the lack of modification options available to this GUI tool. perhaps in future versions, Apex graphs will be better...
    mike

  • How to use the d3.js library with Apex Charting

    Hello.
    I am using Apex 4.1.0 with Oracle 11gR2 and Oracle App Server (mod_plsql).
    I'm trying to incorporate the d3.js library (a visulaization framework) in my Apex charts but am not having much success.
    I found this article in which David Mann uses the library within an Apex 4.x application:
    http://ba6.us/d3js_application_express_basic_dynamic_action
    I replicated his exact steps in my own application but without success. I do not see how he was able to get his application to work. Indeed, the tutorial does not even use a dynamic action despite what the article title says.
    Has any one used the d3.js library with their Apex application. If so, would you be willing to share how you went about it?
    Thank you very much.
    Elie

    EEG wrote:
    Hello fac586.
    Thank you very much for responding/helping.
    In the article I referenced I did note David's statement about using a "modern" browser with d3.js (one that recognizes css3 syntax); otherwise, the framework will not respond. And so, I was careful to run my Apex application in IE9.x as well in Firefox 16.x. But all I see is an empty region with a title. No chart. Nothing.
    I suspect my one of my problems here is in getting the chart to refresh every "n" seconds. For this, I think the dynamic action would be used, though I'm not sure how to go about doing so.That's included in the sample code (line 99). Strangely Dynamic Actions don't seem to include a native timer event...however there is a plug-in.
    More problematic, though, is that I am not seeing any chart whatsoever in the region. I would have expected to see some chart data, even if it is not automagically refreshing.
    I've created my example in my EEG workspace on apex.oracle.com:
    Workspace: EEG
    Username: [email protected]
    Password: galaxy (note: all lowercase)
    Please see application 27083 called Elie_Goodies, page 25. This page has an associated tab called, appropriately enough, "d3.js Library". The Safari console showed a couple of JavaScript errors.
    1. The URL used to include the d3 code in the blog article:
    <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>is returning HTML, not JavaScript. Changing it to that given on the d3js.org site:
    <script src="http://d3js.org/d3.v2.js"></script>includes the correct script.
    2. There was a syntax error in a script in the Run Code region. I think there was some kind of issue arising from copying from the blog article: it looked like line endings hadn't been respected as the code wasn't formatted properly. Pasting it from the blog into Coda's editor and then into the APEX Region Source text area fixed the format, and it then ran first time.
    Thanks for the heads-up. I'll also be looking further into d3.

  • Help on performance with dynamic query

    Hi All,
      We are using SQL Server 2008R2. In our one of report we are using Dynamic query and it is taking more time to retrieve the data. to retrieve 32 records it is taking 13-15 secs. In my observation in a table variable, created more than 60 columns. In
    the SP called one more sp with insert statement.
    Please let me know how i can improve performance of the SP.
    I know that i have to provide the SP  for observation but unfortunately I cannot provide the SP. Please guide me how i can achieve this .
    I tried with temp tables by creating indexes on temp tables but i couldn't find improvement in performance. 
    Waiting for valuable replies.

    First of all a "dynamic query" is not "a query" - it is a multitude of them. Some of them may be fast, others may be slow.
    There is of course no way we can give specific suggestions without seeing the code, the table and index definitions etc.
    We can only give the generic suggestions. As for the code, make sure that you are using parameterised SQL and you are not building a complete SQL string with parameters and all. If nothing else, this helps to make the code more readable and maintainable.
    It also protects you against SQL injection. And it also helps to prevent performance issue due to implicit conversion.
    You will need to look at the query plan to see where the bottlenecks may be. You should look at the actual query plan. Note that the thickness of the arrows are more relevant than the percentages you see; the percentages are only estimates, and estimates
    are often off. Next step is to see if you can add indexes to alleviate the situation. You should also analyse if there are problems in the query, for instance indexed columns that are entangled in expression. If you are using views, make sure that you don't
    have views built on top of views etc. This can often result a table appearing multiple times in a query, when one would be enough.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Dynamic Query Doubt

    Hi,
    I need to write a Dynamic Query to get the data from the table by using the Input date parameters.
    LIke,
    SELECT* from table where date_start between to_date('12-14-2004','mm-dd-yyyy') AND
    to_date('12-15-2005','mm-dd-yyyy');
    How can i write the above query in dynamic sql as i will get the two dates as input in my procedure
    Help me in this

    Or more preferably use bind variables with the
    EXECUTE IMMEDIATE as, if the query will be called
    many times, the bind variables will prevent hard
    parsing of the statement each time (i.e. it will be
    quicker to execute).blushadow,
    Yes, the execute immediate using bind variables is better/faster than not using bind variables, but your first example outperforms your second one. This is due to the fact that execute immediate really closes all cursors, and in your first example the cursors are kept open (yes, even though you issue a CLOSE cur_test) in the PL/SQL cursor cache.
    SQL> create table i_links
      2  as
      3  select sysdate - l linkdate from (select level l from dual connect by level <= 10000)
      4  /
    Tabel is aangemaakt.
    SQL> exec dbms_stats.gather_table_stats(user,'I_LINKS')
    PL/SQL-procedure is geslaagd.
    SQL> create or replace procedure test1 (start_date in date, end_date in date) as
      2    CURSOR cur_test IS
      3      SELECT count(*)
      4      FROM   i_links
      5      WHERE  linkdate BETWEEN start_date AND end_date;
      6    v_count NUMBER;
      7  begin
      8    OPEN cur_test;
      9    FETCH cur_test INTO v_count;
    10    CLOSE cur_test;
    11    --DBMS_OUTPUT.PUT_LINE('Count: '||v_count);
    12  end;
    13  /
    Procedure is aangemaakt.
    SQL> create or replace procedure test2 (start_date in date, end_date in date) as
      2    v_count NUMBER;
      3  begin
      4    EXECUTE IMMEDIATE 'SELECT count(*) FROM i_links WHERE linkdate BETWEEN :x1 AND :x2' INTO v_count USING start_date, end_date;
      5    --DBMS_OUTPUT.PUT_LINE('Count: '||v_count);
      6  end;
      7  /
    Procedure is aangemaakt.
    SQL> begin
      2    -- warm up
      3    test1(sysdate-365,sysdate);
      4    test2(sysdate-365,sysdate);
      5    -- begin test
      6    runstats_pkg.rs_start;
      7    for i in 1..1000
      8    loop
      9      test1(sysdate-365,sysdate);
    10    end loop;
    11    runstats_pkg.rs_middle;
    12    for i in 1..1000
    13    loop
    14      test2(sysdate-365,sysdate);
    15    end loop;
    16    runstats_pkg.rs_stop(100);
    17  end;
    18  /
    Run1 draaide in 341 hsecs
    Run2 draaide in 348 hsecs
    Run1 draaide in 97,99% van de tijd
    Naam                                                    Run1      Run2  Verschil
    STAT.session cursor cache hits                             0       998       998
    STAT.opened cursors cumulative                             0     1,000     1,000
    STAT.parse count (total)                                   0     1,000     1,000
    LATCH.shared pool                                      1,047     3,043     1,996
    STAT.recursive calls                                   3,001     1,001    -2,000
    LATCH.library cache pin allocation                         8     2,011     2,003
    LATCH.library cache pin 2,048 6,044 3,996
    LATCH.library cache 2,056 6,060 4,004
    Run1 latches totaal versus run2 -- verschil en percentage
          Run1      Run2  Verschil     Pct
        48,522    60,548    12,026  80.14%
    PL/SQL-procedure is geslaagd.Regards,
    Rob.

Maybe you are looking for

  • Ipod to Itunes reload after hard drive crash

    My hard drive crashed and now my ipod is correct and the backup I reloaded onto itunes does not match.  How do I get itunes to match my ipod?  I do not really want to recreate all the playlists as that would take a great deal of time.Thanks

  • No messages created from split mapping

    Hello, My Scenario is JDBC to Proxy and there is  1:n Mapping I had done the multi mapping and done the all the necessary configuration in the MM, IM and ID I tested the payload in the MM and IM and it is working fine. But while iam doing the end to

  • Displaying rendered HTML text in spry detail region

    Hi, I have just started to play around with DW CS3 & spry and love them! I have a Master/Detail spry going from my database, but am having a problem displaying the detail the way I need it. The mySQL field is a BLOB for some HTML formatted text (I ge

  • Reporting Services URL Problem?

    Hi, I have just installed SQL Server 2012 on my Windows 8 Pro OS. When I tried to browse to the Reporting Service URL it gave this error message : User 'Abhi\Abhilash DK' does not have required permissions. Verify that sufficient permissions have bee

  • C100 footage looks horrible in PPro CC on Windows

    Hi folks! I did my best to find the answer but I didn't find a good one. The same C100 (.mts) footage is imported perfectly on PPro CC on the Mac but when I bring it into PPro CC on Windows, it simply looks horrible. It's got a green cast in the shad