SVG line chart raises ORA-20001 witha valid SQL query

Hi,
I am on version 1.6 & 10g database. I developed an SVG line chart which was working fine, but I wanted to fill in some sparse data by using data densification. So I enhanced my query with a partitioned outer join as follows:
select null l, month_start, issue_count
from
(with dates as
(select add_months
( to_date( '01-jul-2004' ),
column_value-1) dt
from table( vtable(12) )),
iss as
(select trunc(start_date, 'MON') mon , count(*) cnt
from issues
group by trunc(start_date, 'MON'))
select dates.dt month_start, NVL(iss.cnt, 0) issue_count
from dates left outer join iss on (dt=mon)
Now the chart throws an ORA-20001 get_data error. The query is valid as it runs in SQL*plus no problems. What is it choking on?
Thanks,
Steve

Steve,
I didn't mean for you to put in on the Studio, just install the app in your workspace on htmldb.oracle.com, use SQL Workshop there to compile your procedures, tell us the app ID, and that's it.
The error message presentation needs some improvement, give us time. We're spending most of our energy on improving the capability of the product.
Scott

Similar Messages

  • SVG CHart error ORA-20001 with Stacked Bar Chart HTML DB 1.6.0.00.87

    Hi,
    during I put a How-To into execution (How To Create a Stacked Bar Chart) I'll get the following error code:
    SVG Chart error:ORA-20001:line_Chart error:ORA-20001:
    get_data error:ORA-20001:Parse error:ORA009
    (see http://www.oracle.com/technology/products/database/htmldb/howtos/index.html)
    This Situation occurs when i add a second series to the
    chart. The first series works fine. I've used the following SQL-Statement:
    select null l, sales_month, revenue from (select to_char(o.order_timestamp,'Mon YYYY') sales_month, sum(oi.quantity * oi.unit_price) revenue, to_date(to_char(o.order_timestamp,'Mon YYYY'),'Mon YYYY') sales_month_order from DEMO_PRODUCT_INFO p, DEMO_ORDER_ITEMS oi, DEMO_ORDERS o where o.order_timestamp <= (trunc(sysdate,'MON')-1)and o.order_timestamp > (trunc(sysdate-365,'MON'))and o.order_id = oi.order_id and oi.product_id = p.product_id and p.category = 'Audio' group by to_char(o.order_timestamp,'Mon YYYY') order by sales_month_order);
    Please help.
    Regards
    Detlev

    Well,
    I've just been struggling for a couple of hours with a cluster bar chart giving the same problem.
    The problem is definitely with "ORDER BY".
    I guess the graphing chart is taking the sql query as a string and then does some other manipulation on it which ends abnormally when you include the order by clause.
    I presume that if you embed the query in a
    SELECT * FROM (<actual query with order by>)
    it might mitigate the problem.
    Bye,
    Flavio

  • Help - SVG Line Chart - ORA-20001 line_chart error Parse error ORA-00911

    Gurus,
    Need help.
    I am trying to plat multiple series in a SVG line chart but am repeatedly getting line_chart error eventhough SQL queries work perfectly in sql workshop/sqlplus etc. How do I get past this error.
    Sample queries I am using to plot line chart are
    select link, col1, value from (select null link, col1, col2 value from xy);
    select link, col1, value from (select null link, col1, col3 value from xy);
    xy is a table with three number columns col1, col2 & col3.
    Thanks in advance

    Try taking the semicolon ";" off the end of the SELECT statements.
    Mike

  • SVG: Chart error: ORA-20001:

    Hi,
    We are using 1.6.1.00.02 . I got a problem with SVG chart. The query returns following error:
    SVG: Chart error: ORA-20001: bar_char_error ORA-20001: get_data_error: ORA-20001 Fetch error: ORA-01782
    The column names are correct. The same query works perfectly in HTMLDB reports.
    Following is the query:
    SELECT
    TRANSACTION_dATE,
    SUM(SALES) SALES,
    SUM(COST_OF_SALE) COST_OF_SALE
    fROM HTML_SALES_REPORT_View
    WHERE transaction_date between
    '01-DEC-2004' and '31-DEC-2004'
    GROUP BY TRANSACTION_DATE
    Help will be appreciated.
    Regards,
    Hamayun

    Hi,
    you have to use the following syntax:
    SELECT link, label, value
    Example
    SELECT
    null link, TRANSACTION_dATE label,
    SUM(SALES) value ,
    fROM HTML_SALES_REPORT_View
    WHERE transaction_date between
    '01-DEC-2004' and '31-DEC-2004'
    GROUP BY TRANSACTION_DATE
    And to display your cost_of_sale data you have to add a second series like this:
    SELECT
    null link, TRANSACTION_dATE label,
    SUM(COST_OF_SALE) value
    fROM HTML_SALES_REPORT_View
    WHERE transaction_date between
    '01-DEC-2004' and '31-DEC-2004'
    GROUP BY TRANSACTION_DATE
    because you can't display two lines with just one query.
    I hope this will help.
    Regards, Jörg

  • Problems with SVG line charts based on PL/SQL returning SQL

    Dear all - I wonder if anyone can tell me whether this problem is likely to be fixed at some point?
    It relates to the fact that you can't get more than one series on a chart where the SQL is returned from PL/SQL.
    It is a huge issue for us when trying to create complex, dynamic charts, which are simple enough in PL/SQL, but end up quite nightmarish in pure SQL.
    Although we have implemented Maani SWF (Flash) charts as a workaround, users don't like them as there's no 'save as...' or copy+paste and they seem to print very badly indeed.
    Here's part of a post from last May with more detail:
    "If I take a really simple table like this:
    CREATE TABLE "CHART_TEST"
    ( "X" DATE NOT NULL ENABLE,
    "Y" NUMBER(5,0) NOT NULL ENABLE,
    CONSTRAINT "CHART_TEST_PK" PRIMARY KEY ("X") ENABLE
    and populate it with:
    X Y
    2006-01-01T00:00:00 1
    2006-02-01T00:00:00 2
    2006-03-01T00:00:00 3
    2006-04-01T00:00:00 4
    2006-05-01T00:00:00 5
    2006-06-01T00:00:00 6
    2006-07-01T00:00:00 7
    2006-08-01T00:00:00 8
    2006-09-01T00:00:00 9
    2006-10-01T00:00:00 10
    I can create a chart with a single series using syntax something like:
    begin
    return 'select null link, x label, y value
    from chart_test';
    end;
    and this works fine. However, if I add a second series:
    begin
    return 'select null link, x label, (y + 1) value
    from chart_test';
    end;
    then the whole of the chart region blanks out.
    There's an example at:
    http://htmldb.oracle.com/pls/otn/f?p=15491:1"
    Many thanks,
    John.

    On some, but not all SVG line charts, I had trouble when some values are ZERO.
    Putting a CASE WHEN var = 0 then 0.05 ELSE var END in the select statement
    fixed those situations.
    I had missing lines when the number of data points in a series exceeded the default number of 15, and I did not set in the series configuration to a number equal to or higher that the number of data points in that series.
    And I had one instance, where a couple missing lines reappeared when I exited
    the browser and app completely and restarted the app.
    All these comments apply to ver 1.6x and 2.0x

  • "no data found" in SVG Line Chart

    Hello,
    I have a problem with a SVG Line Chart!
    I have multiple series in the Line Chart, which data is based on multiple select lists.
    When I leave one select list blank, so that one line has no data, the "no data found" statement appears in the Chart.
    But when I delete the "no data found" statement in the Series Attributes it would not be deleted. Nevertheless when I open the Series Attributes again the message is still there....
    Does anybody have an idea how I van delete the "No Data found Message"???
    Thanks,
    Tim

    Chris and Cristoph -
    I have found that many times errors like this are caused by SQL statements that don't really address the business need or the requirements for the chart. Let me use a simple example:
    SELECT d.dept_name  dept_name,
           sum(s.sales_total)  sales_total
    FROM orders o, depts d
    WHERE o.dept_id = d.dept_id
      AND o.time_frame = 'Q1'
    GROUP BY dept_nameSeems simple enough. But what if this statement is run early during the Q1 timeframe and one dept hasn't made any sales yet? Well, they won't show up in the output of this statement. From a business perspective, you will want that dept to show on the report with a zero total sales. You don't want them excluded from the report. So how do we fix this?
    There are several options.
    One dirty way of solving this is putting in a dummy record for each dept into the orders table with a 0 sales_total value for each time unit. YUK! That has wrong written all over it!
    We could use a different type of join. And then use NVL or a Case or IF statement to turn Null Values into 0.
    SELECT d.dept_name dept_name,
           sum(nvl(s.sales_total,0))  sales_total
    FROM  orders o RIGHT JOIN dept d ON d.dept_id = o.dept_id
    WHERE o.time_frame = 'Q1'
    GROUP BY dept_nameWe could also square our data sets and summarize with an inner select
    SELECT dept_name dept_name,
           sum(sales_total) sales_total
    FROM (
      SELECT d.dept_name ,
             sum(s.sales_total)  sales_total
      FROM orders o, dept d
      WHERE o.dept_id = d.dept_id
        AND o.time_frame = 'Q1'
      GROUP BY dept_name
      UNION ALL
      SELECT DISTINCT dept_name ,
             0 sales_total
      FROM dept
    GROUP BY dept_nameThe final result is that every dept has a value. That is the key. This is how the chart expects the data and this is probably how your business expects the data.
    Austin

  • Transforming XML data into SVG line charts

    Hi
    I am trying to transform revenue data from an XML file into an SVG line chart. The problem is that I am quite new to XPath and XSLT and whereas I can draw the grid for my chart I struggle drawing the lines using the data from the XML doc.
    The XML look something like the one below, and I would like to have one chart for each product and in each chart having the time on the x-axis and chart the revenue by regions.
    Any help on this is much appreciated.
    Thanks
    Peter
    <?xml version="1.0"?>
    <revenue>
    <caption>
    <heading>My title</heading>
    </caption>
    <date name="01/01/2003">
    <region name="Asia">
    <product_a>30</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    </date>
    <date name="02/01/2003">
    <region name="Asia">
    <product_a>32</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>57</product_a>
    <product_b>31</product_b>
    <product_c>457</product_c>
    </region>
    </date>
    <date name="03/01/2003">
    <region name="Asia">
    <product_a>38</product_a>
    <product_b>12</product_b>Long postings are being truncated to ~1 kB at this time.

    Instead of using SVG charting can I suggest that you look into digital charts. This service creates charts on the fly and is very easy to integrate with web applications.
    Christopher
    www.billboard.net

  • Chart Flash Chart error: ORA-20001: Print Chart Data: Flash Chart error: OR

    Hi,
    if the query where my resource gantt chart is based on returns more the 107 rows, i will get the following error:
    chart Flash Chart error: ORA-20001: Print Chart Data: Flash Chart error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    If i reduce the number of results, the chart is working fine.
    Max rows attribute of the series is adjusted to 4000
    Any idea?
    Thank you

    Thank you,
    I have tried it, but it I am not able to make it work, here you find a snip of my pagesource:
    <anygantt> <resource_chart>
    <resources>
    <resource id="341" name="Drexler, Franz" />
    <resource id="5" name="Gross, Johannes-Ludwig" />
    <resource id="8" name="Pecherski, Andrzej" />
    <resource id="131" name="Steinmetz, Raphael" />
    <resource id="191" name="Jenks, Raymond" />
    <resource id="33" name="Alhambra, Roda Marie" />
    <resource id="31" name="Daminescu, Adrian" />
    </resources>
    <periods>
    <period resource_id= "31" start="24-DEC-12 12.00.00.000000000 AM" end="31-DEC-12 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="27-DEC-12 12.00.00.000000000 AM" end="28-DEC-12 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="02-JAN-13 12.00.00.000000000 AM" end="04-JAN-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "131" start="26-JAN-13 12.00.00.000000000 AM" end="04-FEB-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "131" start="01-JAN-13 12.00.00.000000000 AM" end="06-JAN-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "131" start="22-DEC-12 12.00.00.000000000 AM" end="31-DEC-12 12.00.00.000000000 AM" style="green" />
    <period resource_id= "5" start="21-DEC-12 12.00.00.000000000 AM" end="31-DEC-12 12.00.00.000000000 AM" style="green" />
    <period resource_id= "31" start="07-JAN-13 12.00.00.000000000 AM" end="11-JAN-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="21-DEC-12 12.00.00.000000000 AM" end="21-DEC-12 12.00.00.000000000 AM" style="blue" />
    <period resource_id= "33" start="26-DEC-12 12.00.00.000000000 AM" end="28-DEC-12 12.00.00.000000000 AM" style="green" />
    <period resource_id= "33" start="25-FEB-13 12.00.00.000000000 AM" end="25-FEB-13 12.00.00.000000000 AM" style="red" />
    <period resource_id= "33" start="28-MAR-13 12.00.00.000000000 AM" end="29-MAR-13 12.00.00.000000000 AM" style="red" />
    <period resource_id= "33" start="09-APR-13 12.00.00.000000000 AM" end="09-APR-13 12.00.00.000000000 AM" style="red" />
    <period resource_id= "33" start="01-MAY-13 12.00.00.000000000 AM" end="01-MAY-13 12.00.00.000000000 AM" style="red" />
    <period resource_id= "33" start="12-JUN-13 12.00.00.000000000 AM" end="12-JUN-13 12.00.00.000000000 AM" style="red" />
    <period resource_id= "33" start="26-AUG-13 12.00.00.000000000 AM" end="26-AUG-13 12.00.00.000000000 AM" style="red" />
    <period resource_id= "33" start="01-NOV-13 12.00.00.000000000 AM" end="01-NOV-13 12.00.00.000000000 AM" style="red" />
    <period resource_id= "33" start="30-DEC-13 12.00.00.000000000 AM" end="30-DEC-13 12.00.00.000000000 AM" style="red" />
    <period resource_id= "33" start="31-DEC-13 12.00.00.000000000 AM" end="31-DEC-13 12.00.00.000000000 AM" style="red" />
    <period resource_id= "33" start="21-AUG-13 12.00.00.000000000 AM" end="21-AUG-13 12.00.00.000000000 AM" style="red" />
    <period resource_id= "33" start="15-OCT-13 12.00.00.000000000 AM" end="15-OCT-13 12.00.00.000000000 AM" style="red" />
    <period resource_id= "8" start="23-DEC-13 12.00.00.000000000 AM" end="23-DEC-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="27-DEC-13 12.00.00.000000000 AM" end="27-DEC-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="30-DEC-13 12.00.00.000000000 AM" end="30-DEC-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="02-JAN-14 12.00.00.000000000 AM" end="03-JAN-14 12.00.00.000000000 AM" style="green" />
    <period resource_id= "5" start="31-MAY-13 12.00.00.000000000 AM" end="31-MAY-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="21-MAY-13 12.00.00.000000000 AM" end="24-MAY-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="27-MAY-13 12.00.00.000000000 AM" end="29-MAY-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="31-MAY-13 12.00.00.000000000 AM" end="31-MAY-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="02-APR-13 12.00.00.000000000 AM" end="05-APR-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "5" start="11-FEB-13 12.00.00.000000000 AM" end="11-FEB-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "131" start="29-JUN-13 12.00.00.000000000 AM" end="14-JUL-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "131" start="16-AUG-13 12.00.00.000000000 AM" end="16-AUG-13 12.00.00.000000000 AM" style="blue" />
    <period resource_id= "8" start="26-AUG-13 12.00.00.000000000 AM" end="30-AUG-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="02-SEP-13 12.00.00.000000000 AM" end="06-SEP-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="15-FEB-13 12.00.00.000000000 AM" end="15-FEB-13 12.00.00.000000000 AM" style="blue" />
    <period resource_id= "5" start="13-MAR-13 12.00.00.000000000 AM" end="13-MAR-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "8" start="22-MAR-13 12.00.00.000000000 AM" end="22-MAR-13 12.00.00.000000000 AM" style="blue" />
    <period resource_id= "33" start="20-MAR-13 12.00.00.000000000 AM" end="20-MAR-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "5" start="08-APR-13 12.00.00.000000000 AM" end="08-APR-13 12.00.00.000000000 AM" style="blue" />
    <period resource_id= "31" start="05-APR-13 12.00.00.000000000 AM" end="05-APR-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "31" start="02-MAY-13 12.00.00.000000000 AM" end="03-MAY-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "341" start="01-JUL-13 12.00.00.000000000 AM" end="22-JUL-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "341" start="09-MAY-13 12.00.00.000000000 AM" end="12-MAY-13 12.00.00.000000000 AM" style="green" />
    <period resource_id= "191" start="04-JUL-13 12.00.00.000000000 AM" end="06-JUL-13 12.00.00.000000000 AM" style="red" />
    <period resource_id= "31" start="15-JUN-13 12.00.00.000000000 AM" end="30-JUN-13 12.00.00.000000000 AM" style="green" />
    </periods>
    </resource_chart></anygantt>
    </textarea>
    <div id="chartDiv"></div>
    <script type="text/javascript" language="javascript">
    /* Set default swf path */
    AnyChart.swfFile = 'i/flashchart/anychart_6/swf/OracleAnyChart.swf';
    /* Create new gantt chart */
    var chart = new AnyChart();
    chart.width="2500";
    chart.height="2500";
    /* Get string data from text area */
    var data = document.getElementById('rowData').value.toString();
    /* Set data */
    chart.setData(data);
    /* Write chart to "chart" div */
    chart.write("chartDiv");
    </script>
    do you have a idea whats wrong? thank you

  • Transforming XML data into SVG line charts using XSLT

    Hi
    I am trying to transform revenue data from an XML file into an SVG line chart. The problem is that I am quite new to XPath and XSLT and whereas I can draw the grid for my chart I struggle drawing the lines using the data from the XML doc.
    The XML look something like the one below, and I would like to have one chart for each product and in each chart having the time on the x-axis and chart the revenue by regions.
    Any help on this is much appreciated.
    Thanks
    Peter
    <?xml version="1.0"?>
    <revenue>
    <caption>
    <heading>My title</heading>
    </caption>
    <date name="01/01/2003">
    <region name="Asia">
    <product_a>30</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    </date>
    <date name="02/01/2003">
    <region name="Asia">
    <product_a>32</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>57</product_a>
    <product_b>31</product_b>
    <product_c>457</product_c>
    </region>
    </date>
    <date name="03/01/2003">
    <region name="Asia">
    <product_a>38</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>31</product_a>
    <product_b>9</product_b>
    <product_c>357</product_c>
    </region>
    </date>
    <date name="04/01/2003">
    <region name="Asia">
    <product_a>33</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>43</product_a>
    <product_b>16</product_b>
    <product_c>430</product_c>
    </region>
    </date>
    <date name="05/01/2003">
    <region name="Asia">
    <product_a>36</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>54</product_a>
    <product_b>1</product_b>
    <product_c>561</product_c>
    </region>
    </date>
    </revenue>

    You could try Jeni's XSLT utilities for SVG :
    http://www.jenitennison.com/xslt/utilities/svg-utils.html
    Specifically, the sample code provided, when a couple of SVG charts are being generated from XML data :
    http://www.jenitennison.com/xslt/utilities/svg-example.html
    Hope that helps.

  • ORA-20001: Unable to create query and update page.

    I am using the wizard: Form on a table with report 2 pages. I do not change any of the values when using the wizard (just taking all default values)
    I created over 10 pages successfully already.
    When creating the one page, I received this error on clicking the 'Finish' button
    Error creating query and update.
    Return to Application
    ORA-20001: Unable to create query and update page. ORA-12899: value too large for column "FLOWS_010500"."WWV_FLOW_PAGE_PLUGS"."PLUG_QUERY_COL_ALLIGNMENTS" (actual: 269, maximum: 255)
    Seems like it might be table related since I can continue and create more forms/reports on other tables.
    Any help would be appreciated.

    336554,
    Looks like there is a 127-column limit on the number of report columns supported when using that wizard. Do you have more than that?
    57434

  • Help with an SQL Query on the Logger

    We are running UCCE 8.5(3) and need help with an SQL query. When I run the below I would also like to see skill group information(name preferably)? Any help would be greatly appreciated!
    select * from dbo.t_Termination_Call_Detail where DateTime between '10-11-2012 00:00:00:00' and
    '10-11-2012 23:59:59:59'

    David, thanks for replying.  Unfortunitly I don't know enough about SQL to put that into a query and have it return data.  Would you be able to give an example on what the query would look like?

  • Newbie - help with a SQL query for a bar chart  - Originally posted in APEX

    I originally posted this in the APEX forum but someone there suggested this is more of a SQL question.  Anyone out there who can provide some assistance?
    Hi,
    I'm a new user on APEX with no real SQL knowledge and I'm trying to build a dashboard with charts into an existing APEX application. Based on another application, I have come up with the following SQL code:
    select null link
    , CATEGORY label
    , count (decode(PROJECT_STATUS,'1',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'2',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'3',PROJECT_ID))"On Hold"
    , count (decode(PROJECT_STATUS,'4',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'5',PROJECT_ID))"Pending Review"
    from GRAPO_PROHEADTRK
    where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')
    group by CATEGORY
    Order by COUNT(PROJECT_ID) DESC
    The code from the other app was:
    select null link
    , FUNCTIONAL_AREA label
    , count (decode(PROJECT_STATUS,'Active',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'Complete',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'On Hold',PROJECT_ID)) "On Hold"
    , count (decode(PROJECT_STATUS,'Recurring',PROJECT_ID))"Recurring"
    , count (decode(PROJECT_STATUS,'Pipeline',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'Not Approved',PROJECT_ID))"Not Approved"
    from PM_V2
    where LOB='S2S' and (FUNCTIONAL_AREA='Accounts Payable' or FUNCTIONAL_AREA='Expense' or FUNCTIONAL_AREA='Procurement' or FUNCTIONAL_AREA='Fixed Assets')
    group by FUNCTIONAL_AREA
    Order by COUNT(PROJECT_ID) DESC
    I'm getting a "Failed to parse SQL query!" error when I try to run validation.
    Is this enough info for some assistance? Any help would really be appreciated.
    Thanks,
    Rachel

    Hi, Rachel,
    user10774102 wrote:
    I originally posted this in the APEX forum but someone there suggested this is more of a SQL question.  Anyone out there who can provide some assistance?
    Hi,
    I'm a new user on APEX with no real SQL knowledge and I'm trying to build a dashboard with charts into an existing APEX application. Based on another application, I have come up with the following SQL code:
    select null link
    , CATEGORY label
    , count (decode(PROJECT_STATUS,'1',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'2',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'3',PROJECT_ID))"On Hold"
    , count (decode(PROJECT_STATUS,'4',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'5',PROJECT_ID))"Pending Review"
    from GRAPO_PROHEADTRK
    where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')
    group by CATEGORY
    Order by COUNT(PROJECT_ID) DESCIs there a problem with the code above?
    It's curious that the WHERE clause includes "PROJECT_STATUS='6'", but there is no pivoted column for project_status='6', like there is for '1' through '5'. That's not necessarily a mistake, and it wouldn't raise an error in any case.
    Instead of
    where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')you could say
    where PROJECT_STATUS  IN ('1', '2', '3', '4', '5', '6')but that probably has nothing to do with your current problem.
    The code from the other app was:
    select null link
    , FUNCTIONAL_AREA label
    , count (decode(PROJECT_STATUS,'Active',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'Complete',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'On Hold',PROJECT_ID)) "On Hold"
    , count (decode(PROJECT_STATUS,'Recurring',PROJECT_ID))"Recurring"
    , count (decode(PROJECT_STATUS,'Pipeline',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'Not Approved',PROJECT_ID))"Not Approved"
    from PM_V2
    where LOB='S2S' and (FUNCTIONAL_AREA='Accounts Payable' or FUNCTIONAL_AREA='Expense' or FUNCTIONAL_AREA='Procurement' or FUNCTIONAL_AREA='Fixed Assets')
    group by FUNCTIONAL_AREA
    Order by COUNT(PROJECT_ID) DESC
    I'm getting a "Failed to parse SQL query!" error when I try to run validation.Is that an Apex error message? Sorry, I don't know anything about Apex.
    If you can't get a more specific error message from Apex, then try debugging this statement in SQL*Plus. When you get it fixed, then you can copy it back into Apex.
    If this is a SQL problem, then you should be able to re-create the problem in pure SQL.
    If you can't re-create the problem in pure SQL, then it's probably an Apex problem, and belongs in the Apex forum, not here.
    I don't see anything obviously wrong with your code, but I can't tell if, for example, you spelled a column name wrong, or if something has the wrong data type
    Is this enough info for some assistance? Any help would really be appreciated.It wiould be better if you posted a completE script that people could run to re-create the problem, and to test their ideas.
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Always say which version of Oracle (and any other software, such as Apex) you're using.

  • Newbie - need help with a SQL query for a bar chart

    Hi,
    I'm a new user on APEX with no real SQL knowledge and I'm trying to build a dashboard with charts into an existing APEX application. Based on another application, I have come up with the following SQL code:
    select null link
    , CATEGORY label
    , count (decode(PROJECT_STATUS,'1',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'2',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'3',PROJECT_ID))"On Hold"
    , count (decode(PROJECT_STATUS,'4',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'5',PROJECT_ID))"Pending Review"
    from GRAPO_PROHEADTRK
    where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')
    group by CATEGORY
    Order by COUNT(PROJECT_ID) DESC
    The code from the other app was:
    select null link
    , FUNCTIONAL_AREA label
    , count (decode(PROJECT_STATUS,'Active',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'Complete',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'On Hold',PROJECT_ID)) "On Hold"
    , count (decode(PROJECT_STATUS,'Recurring',PROJECT_ID))"Recurring"
    , count (decode(PROJECT_STATUS,'Pipeline',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'Not Approved',PROJECT_ID))"Not Approved"
    from PM_V2
    where LOB='S2S' and (FUNCTIONAL_AREA='Accounts Payable' or FUNCTIONAL_AREA='Expense' or FUNCTIONAL_AREA='Procurement' or FUNCTIONAL_AREA='Fixed Assets')
    group by FUNCTIONAL_AREA
    Order by COUNT(PROJECT_ID) DESC
    I'm getting a "Failed to parse SQL query!" error when I try to run validation.
    Is this enough info for some assistance? Any help would really be appreciated.
    Thanks,
    Rachel

    Hello,
    This is more of an SQL question, rather than specifically APEX-related. It's notable that you say: I'm a new user on APEX with no real SQL knowledgeWhich is fine (we all have to start somewhere, afterall) but it might be worth de-coupling the problem from APEX in the first instance. I'd also strongly recommend either taking a course, reading a book (e.g. http://books.google.co.uk/books?id=r5vbGgz7TFsC&printsec=frontcover&dq=Mastering+Oracle+SQL&hl=en#v=onepage&q=Mastering%20Oracle%20SQL&f=false) or looking for a basic SQL tutorial - it will save you a whole lot of heartache, I promise you. Search the oracle forums for the terms "Basic SQL Tutorial" and you should come up with a bunch of results.
    Given that you've copied your query template from another, I would suggest ensuring that the actual query works first of all. Try running it in either:
    * SQL Editor
    * SQL*Plus
    * an IDE like SQL Developer (available free from the OTN: http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html ) or TOAD or similar.
    You may find there are syntax errors associated with the query - it's difficult to tell without looking at your data model.
    select null link
    , CATEGORY label
    , count (decode(PROJECT_STATUS,'1',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'2',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'3',PROJECT_ID))"On Hold"
    , count (decode(PROJECT_STATUS,'4',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'5',PROJECT_ID))"Pending Review"
    from GRAPO_PROHEADTRK
    where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')
    group by CATEGORYNote that your "order by" clause references a field called "PROJECT_ID", which exists in the old query but you've changed other similar references to "PROJECT_STATUS" - is it possible you've just missed this one? The perils of copy-paste coding I'm afraid...

  • Flash chart with dynamic sql query does not display

    Hi,
    In my schema SIVOA I have a lot of tables declared like this :
      CREATE TABLE "SIVOA"."EVV_xxxx"
       (     "CLEF_VAR" NUMBER(4,0),
         "DATE1" DATE,
         "VALEUR" NUMBER(16,8) Only the last part of the name changes "xxxx". For example E009, E019, etc....
    I am making a chart page with report and want the user to select a name of a table and I will display using dynamic sql query, the table report and chart.
    P184_ENAME is a select list returning the last part of the name of the table, fro example 'E009', 'E019', etc.
    P8_CLEF_VAR is an item containing a value. This value is a key retrieved like this :SELECT CLEF_VAR
    FROM SIVOA.SITE_ECHELLE
    WHERE SITE = :P184_ENAMEI built a classic report using a sql dynamic function :DECLARE
    x VARCHAR2 (4000);
    BEGIN
    x := 'SELECT NULL, DATE1, VALEUR FROM SIVOA.EVV_'
    || UPPER(:p184_ename)
    || ' WHERE CLEF_VAR = :p8_clef_var' ;
    RETURN (x);
    END;:p8_clef_var is an itme containing the value '4544'.
    This works perfectly fine !
    When I use this sql fucytion into a flash chart it does not work. I get this message "No data found".
    I do not understand why a the report get a result and not the chart !
    But if i hard-code the number of the CLEF_VAR instead of fetching it from :p8_clef_var I get a nice chart ! Go figure !DECLARE
    x VARCHAR2 (4000);
    BEGIN
    x := 'SELECT NULL, DATE1, VALEUR FROM SIVOA.EVV_'
    || UPPER(:p184_ename)
    || ' WHERE CLEF_VAR = 4544 ' ;
    RETURN (x);
    I cannot stay with the key (CLEF_VAR) hard-coded unformtunately !
    My question is how to get the chart displaying properly ??
    Thank you for your kind answers.
    Christian                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Alex,
    Using your request, with the classic report I get results (data), but I get the same message with the Flash chart : "No data found" ! I don't know how to investigate this. i tried many things but nothing works.
    Christian
    PS I tried this :
    DECLARE
       X   VARCHAR2 (4000);
    BEGIN
    x := 'SELECT NULL, DATE1, ROUND(VALEUR,2) FROM SIVOA.EVV_'
          || UPPER (:p184_ename) ||
          ' WHERE CLEF_VAR = '
          || :p8_clef_var ||
          ' AND DATE1 BETWEEN TO_DATE ('''
    ||:P8_DATE_DEBUT||''', ''DD/MM/YYYY HH24:MI'') AND TO_DATE ('''
    ||:P8_DATE_FIN||''', ''DD/MM/YYYY HH24:MI'')'
    RETURN (X);
    END; But it does not work either. I could find that the SLQ syntax generated is good becaus I put it into an item which display the return done by the pls/sql.
    What is sttange also with the classic report is that if I do click on next or previous to see another rows, I get the message "No data found". If I try to export the report I get an excel file with "No data fouid".
    Does anybody already tried my "need" here ? i find strange thant I should not be the firs one trying to get a report an tables which name would be "dynamic".
    Tahnk you.
    Edited by: Christian from France on Feb 13, 2009 3:05 AM

  • Chart not getting columns from the SQL Query with InlineTransform(xsl)

    Hi All,
    I am using MII 12.0 . I tried to use the mii standard xsl for converting rows into columns by  Inline Transform in a SQL Query.
    while executing the Query it is giving me the correct output but i tried to load the same Query in a IChart there it is not showing me the available columns that i can able to see in simple executiion and chart is also not plotting it keeps on loading.
    Thanks in Advance.

    Hi LinoVaz,
    Some things to try for testing purposes -
    1. Don't do any Data Mapping of the query columns
    2. If a SQL Query, you may need to change the Server Scaling to use Global AutoScale.
    I found that when I mapped the inline-transformed query into a bar chart display template, and hit the Refresh button, only the first column name show in the Column Names area.  If I mapped it, I got only that column.  If I didn't map any columns, I got them all.
    Let me know if you find similar results.  I think this is likely a bug, so you may consider using a Business Logic Transaction and an XacuteQuery to accomplish the same result.
    Kind Regards,
    Diana Hoppe
    Edited by: Diana Hoppe on Mar 25, 2011 11:46 AM

Maybe you are looking for

  • How to develop a single form for multiple Layouts in Adobe

    Hi experts, I have Developed an AdobeForm in Letter Layout. Is there any settings in ADS/Layout in SFP, for giving print in both Letter and A4 Pages without developing new Page Layout? We are facing allignment issues, if print is given in A4. Thanks

  • How do I add a print button that would print out pdf or different version than what is on the site?

    I see this example on NY Times.  If you pick any of their articles and click print or do the short cut (Command-P) ... (Control-P for windows), the layout of their article is completely customized and cleaner.  It seems like they've edited the print

  • Transformation transport problems when containing routine

    Hi Gurus, I'm facing a transport problem. When i want to transport a transformation that contains routines, the transport says syntax error in routine. The routine in DEV is tested and correct. I realised, that the transport does not bring the routin

  • Sony Bridge Crash - Updating Sony Xperia Active

    Hy! Im trying to update my Sony Xperia Active. The Update process starts and goes on. On the point where i have to put my phone off the bridge software crashes. Here the text my mac shows: Process: Sony Ericsson Bridge for Mac [629] Path: /Applicatio

  • Why do tumbnails of RAW images no longer display?

    Just got a new camera (Sony a77) and when I took test shots and downloaded them to my computer, the tumbnails do not appear in CS3 Bridge?  Only as the stock RAW image.  My system is Mac OS X 10.5.8.  I also downloaded the included Sony CD Image Data