Classic Report CSV output failed to parse SQL query

Hi,
I'm trying to get a CSV output from a classic report. I'm generating the report based on a PL/SQL block that will return an SQL query. But when i download the CSV excel just gives me a:
failed to parse SQL query:
ORA-00936: Missing expression
and shows me the query that the application is trying to parse. I'm also using bind variables (page items) in the PL/SQL block that is returning me the SQL query. I think that the reason that it fails to parse the query is that the query that is shown in excel has no bind variable values.
Anyone got any ideas?

Hi Arif,
run your page in debug mode and check out the SQL statement which is actually executed for the report. That might help to diagnose what is going wrong.
If you wish you can also post the report SQL statement which is getting executed.
Regards
Patrick
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf

Similar Messages

  • Report failed to parse SQL query:ORA-01745: invalid host/bind variable name

    Hi,
    We are currently upgrading from v2.2.0.00.32 to v4.0.0.00.46.
    I have copied the applications onto our test server along with the various database objects and data etc.
    When I am running a report in v4, it is failing with the following error: "failed to parse SQL query: ORA-01745: invalid host/bind variable name".
    When I copy the SQL that builds the report into TOAD (on out test server) it runs OK so really cant see why it would fail in APEX. It works fine when I run the query in our APEX v2 and in TOAD in our live server.
    The query is as follows:
    SELECT
    aea.ALTERATION_ID
    ,aea.ALTERATION_ID "ALTERATION_ID_DISPLAY"
    ,aea.assembly_name "Revised BOM"
    ,assembly.description "Revised BOM Description"
    ,assembly.INVENTORY_ITEM_STATUS_CODE "Revised BOM Status"
    ,aea.BEFORE_CHANGE_QTY
    ,flv.MEANING "Alteration Type"
    ,aea.component_name "Part No"
    ,component.description "Part No Description"
    ,component.INVENTORY_ITEM_STATUS_CODE "Part No Status"
    ,aea.AFTER_CHANGE_QTY
    ,TO_CHAR(aea.last_update_date,'DD-MM-YYYY HH24:MI:SS')"Last Update Date"
    ,aea.LAST_UPDATE_BY
    ,aea.COMMENTS
    ,aea.ORACLE_CHANGE_NOTICE
    ,AEA.SELECTION_CRITERIA
    FROM XXMEL_APEX_ECO_ALTERATIONS aea
    , fnd_lookup_values flv
    , (SELECT INVENTORY_ITEM_STATUS_CODE
    ,segment1
    ,description
    FROM mtl_system_items_b
    WHERE 1=1
    AND organization_id = 26) component
    , (SELECT INVENTORY_ITEM_STATUS_CODE
    ,segment1
    ,description
    FROM mtl_system_items_b
    WHERE 1=1
    AND organization_id = 26) assembly
    WHERE 1=1
    AND aea.COMPONENT_NAME = component.segment1 (+)
    AND aea.assembly_NAME = assembly.segment1 (+)
    AND flv.lookup_code = aea.acd_type
    AND aea.eco = :P13_ECO
    AND flv.lookup_type = 'ECG_ACTION'
    AND modify_flag = 'Y'
    ANy help would be great,
    Thanks
    Chris
    Edited by: Cashy on 22-Nov-2010 04:13
    Edited by: Cashy on 22-Nov-2010 04:14

    For some reason, the updatable fields (this is a updateable report) where not connecting to the database properly. Whn I changed them to a report columns and removed the database field reference, the report rendered

  • Fail to parse SQL query after report attributes changes on sample app

    This errors occurs in the sample application istalled in Workspace PMW on the http://htmldb.oracle.com web site. Goto home page, edit Page 1, Select "Top Orders" in Region, select report attributes, change max count from 5 to 5 in "Layout and Pagination", apply changes, run page and parse SQL error occurs. Select "debug" and the following is shown regarding the query.
    0.10: query could not be parsed:
    SELECT a.ORDER_ID, a.ORDER_TIMESTAMP, a.CUSTOMER_ID,
    b.cust_last_name || ', ' || b.cust_first_name cust_name, NVL(a.ORDER_TOTAL, 0)
    FROM demo_orders a, DEMO_CUSTOMERS b
    WHERE a.customer_id = b.customer_id
    ORDER BY NVL(a.ORDER_TOTAL, 0) DESC order by 5 desc,5 desc
    failed to parse SQL query:
    ORA-00933: SQL command not properly ended
    I can't see that I'm doing anything wrong but maybe someone can shed some light on this!
    Thanks

    this is sort of an oversight on our part. what's going on is that the sample app installs with that order by clause in the query. at the same time, the report attributes page for that region has a default sort sequence value of "1 desc" (even though column heading sorting isn't enabled). when you go to that page and try to apply any change, htmldb tries to set things up correctly for you...and you end up with that double order by. the best way to avoid the issue is to remove the order by clause from the query on the Region Definition page.
    hope this helps,
    raj

  • Failed to parse SQL query: ORA-01403: no data found

    I'm going to post and answer my own question in the hope that others will not have to struggle with this error.
    Using a report of the type PL/SQL Function Body Returning SQL and using generic columns you may run into this error
    failed to parse SQL query:
    ORA-01403: no data found
    The SQL will run stand alone but the report fails.
    There is a setting just below the source you should check:
    "Maximum number of generic report columns"
    In my case the number of columns was dynamic and when it exceeded the number set as the maximium number of generic columns I received the 1403 error.
    Hope this helps someone.
    Greg

    Thanks for much for the pointer. For anyone else struggling with this too, I found that my generic columns had unordered themselves. Reordering them solved the problem for me.
    Edited by: user11096971 on Jul 22, 2010 3:19 AM

  • Failed to parse SQL query by one user

    Hi all,
    in my app i have a text-item with a submit button. In this item i type a name and a report after the item-region show me the result(s). this works for all my users (>2000) perfectly, but one of this users become an error in the report-region:
    failed to parse SQL query:
    ORA-01403: no data found
    We try this with the same searchstring on the same computer/browser. If i logged in the result is ok, if the user logged in, the error message shows. If i try this on the computer from the user with me logged in, result ok. If the user try this on an other pc, results error.
    I have an productive and a developer workspace. In the developer workspace the user can try this perfectly without errors. Only in the productive workspace the error shows.
    The SQL-Select in the reprirt ist verry simple:
    select id
    , name
    , raum
    from table
    where instr(upper(name), upper(:P60_SEARCH))>0
    However all users can use this search-field with report perfectly, only this one user has the error. It is no restrictions on this item or report.
    Can anybody help me?

    Carsten,
    user preferences do not have anything to do with the fact where the user resides (apex built in, LDAP, whatever). User Preferences are saved for a named user and they are loaded next time the same user loggs in. For example, if you sort your report on a column x, apex will save this as a setting and next time you call the same report, this report will be sorted the same way. Since you don't have a permission to edit services, you should check your adminstrative permissions and conntact the real administrator of the workspace to do that "purge prefference" for you. I could bet this is the reason you are getting that strange error message.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • Chart Query and Failed to parse SQL query

    Hi,
    first of all, this is not a question. It is a reminder for me and maybe for someone with the same problem.
    I just fell over this for the 123124 time.
    I have a 3D Chart Query
    select sum(order_ok) value,
          count(*) maximum_value
    from      v_dialer_campaign
    where campaign_uuid = :P300_CAMPAIGN_IDSaving fails with
    "1 error has occurred Failed to parse SQL query!" ...
    Saving the query without validation works, but does not show any result in the chart.
    v_dialer_campaign is a view selecting from a view in a mssql db over database link and HS.
    running the select in sqlplus or toad works.
    Without any trace on freetds/unixodb/hs side, i would have not found the following line:
    [FreeTDS][SQL Server]The data types nvarchar and text are incompatible in the equal to operator.[FreeTDS][SQL Server]Statement(s) could not be prepared.
    Solution:
    with q as (select :P300_CAMPAIGN_ID val from dual)
    select     sum(order_ok) value,
         count(*) maximum_value
    from     v_dialer_campaign
    where     campaign_uuid in ( select val from q)Maybe the error output when validating the query should be included in the APEX error message.
    Same solution applies for dynamic LOV's reading from HS using a where clause.

    I tried your first query on Apex 3.2 and it created a nice dial chart.
    Is there any ORA-xxxxx error along with the "failed to parse SQL query" message? Did you double check column & table name spelling?
    P.S. The second query is invalid (a superfluous comma after the second column).

  • Column sort gives "failed to parse SQL query"

    Hi folks,
    I have a page with a chart and 5 reports. All report columns are sortable.
    When I first navigate to the page from a menu, the chart and all reports display correctly. Given certain query criteria, reports 2 and 4 correctly return no data, and show my polite 'no data found' message.
    If I sort report 1 or 3 or 5 by clicking a column heading, the chart and reports 1, 3 and 5 display correctly, but in report regions 2 and 4 I then get
    failed to parse SQL query:
    ORA-06502: PL/SQL: numeric or value error: NULL index table key valueThese errors can be cleared by navigating to the page again from a menu.
    What's wrong? How can I fix it?
    I'm at 1.6.0.00.87, db 10.1.0.3.0.
    All ideas gratefully received.
    Thanks
    John D

    OK, I now have a workspace.
    I recreated the problem using page 1 of the Sample Application (app 15027).
    1 - Copy region "My Top Orders" to "My Top Orders 2" on page 1 (same display point, column 2).
    2 - Edit the SQL of "My Top Orders 2" to remove the ORDER BY clause.
    3 - Edit the columns of "My Top Orders 2" to make all columns other than ORDER_ID sortable.
    4 - Copy region "My Top Orders 2" to "My Top Orders 3" on page 1 (same display point, column 2)..
    5 - Run page 1
    6 - Click a column heading on "My Top Orders 2" and I got "failed to parse..." on "My Top Orders 3".
    BUT it's intermittent. Navigate away from page 1 then return, and you may find the error doesn't recur.
    So, what's up Doc?
    Many thanks,
    John

  • Failed to parse SQL Query - External Tables [Apex 4.0.2]

    Greetings experts -
    Has anyone encountered errors when creating a report in Apex that sources from an external table within the database? I'm using the 4.0.2 version that is packaged with the 11g XE edition on 64bit CentOS.
    For example, I might run:
    SELECT NULL LINK,
    COL1 LABEL,
    COL2 VALUE
    FROM MYTAB;
    Where MYTAB is an external table sitting on top of a comma-separated file. When I go to create the page, I'm prompted with the "Failed to parse SQL" dialogue.
    I noticed that if I did CTAS on the external table, and referenced the CTAS table, my page ran without problem!
    Any ideas? Is this a known "limitation" of Apex?
    Thanks,
    CJ

    Chiedu,
    Please try removing all declarative validations on this tabular form, and see if it works as expected then. There are some limitations on the type of views and joins that are supported by tabular forms when using the new declarative validations, i.e. you'll need a key preserved table in your view or join.
    Regards,
    Marc

  • Getting the classical report's output automatically to local disk

    hi gurus,
                 i need to save the classical report's output into my local disk as soon as the user executes the report or press F8. Mind well, it should not be manual. I know the manual way system->list->save.
    Gaurav

    Check this function module.
    "SO_NEW_DOCUMENT_SEND_API1"
    Check this link for ,Download a report to excel with format .
    http://www.sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm
    Check this link for sample program.
    How to download a ABAP report to text file
    Regards,
    Maha

  • Use a flexible Filename in REPORT CSV OUTPUT

    -> ReportAttributes -> csv-output -> filename
    I tried to use &item. and :Item but it seems the FILENAME of the csv-output is fixed. But I would like to give a name depending from context. Any ideas ?

    Marc,
    Sure. The region is a PL/SQL function body returning a SQL query :
    declare q varchar2(256);
    begin
    q := 'select * from ' || v('CURRASSVIEW');
    if v('CURRASSSLXID') IS NOT NULL THEN
    q := q || ' WHERE INSTR(' || '''' || v('CURRASSSLXID') || '''' || ', SLXID ) > 0';
    end if;
    return q;
    end;
    Where CURRASSVIEW is an app item that is the name of a VIEW object behind the scenes. Various view objects have been created to peek into a data wharehousing scheme. Unfortunately, I can't go into great detail....my company would freak if I posted actual data (pharmaceutical). However, I have tracked it down to the following scenario :
    One of the columns that comes through is a VARCHAR2(2). The excel-spoolling is fine while this column is empty, and when the report in Excel reaches a row with a value in this column, it dies. The values are all of length 1, so I'm not sure where else to look.
    Sorry for lack of details...any hints you could give as to where to continue research would be appreciated.
    Matt

  • Failed to parse SQL Expression Field

    Hi,
    I design a report with an SQLExpressionField.  When I change datasource at runtime:
                    reportClientDoc.getDatabaseController().setTableLocation(table, tableNew);
    I got this error:
    ERROR com.businessobjects.reports.sdk.JRCCommunicationAdapter -  detected an exception: Failed to parse expression.
         at com.crystaldecisions.reports.reportdefinition.SQLExpressionFieldDefinition.ta(Unknown Source)
    How should I handle SQLExpressionFields?
    I am using CRJ (2.0.1.r566)

    Could be a couple of reasons.
    You can't use SQL SELECT statments in SQLExpressions, they were not nor are they supported to be used this way.
    SQLExpressions functions are defined in the Driver you are using so it may be you are not using the same Driver version as originally created with.
    Need more info on the driver you are using and the Expression SQL you are using?
    It may be you are failing to log on to the new server also.
    Don

  • In classical report list output  checkbox is value is not changed

    Hi Abapers,
      I am developing one classical  report program, out put list hast one check box.
      I need to read wheather checkbox is checked or not dynamically .
      but the check box value is not changed  if I check or uncheck How can I  
      solve this problem.
      Regards.
       Shashikumar.G

    Hi Abapers,
    I codded as.
    DATA: CHKBOX TYPE C.
    WRITE: CHKBOX AS CHECKBOX INPUT ON.
    it will be displayd on output list  if click on it It will be ticked or unticked it is fine.
    but the value of chkbox is not changed.
    but I need to change the value of chkbox regarding to clicking on it(check, uncheck).
    Regards,
    Shashikumar.G

  • Fail to create SQL query report because of ORA-00923

    Hi expert,
    I would like to SQL query report using the following query:
    select min(identified_date) first_identified,
    max(actual_COMPLETE) last_closed,
    count(id) total_issues,
    sum(decode(status,'Open',1,0)) open_issues,
    sum(decode(status,'Pending',1,0)) pending_issues,
    sum(decode(status,'Resolved',1,0)) closed_issues,
    sum(decode(status,'Will Not Resolve',1,0)) not_resolve_issues,
    sum(decode(status,
    'Open',decode(priority,null,1,0),
    0)) open_no_prior,
    sum(decode(status,
    'Open',decode(priority,1,1,0),
    0)) open_prior_1,
    sum(decode(status,
    'Open',decode(priority,'2',1,0),
    0)) open_prior_2
    sum(decode(status,
    'Open',decode(priority,3,1,0),
    0)) open_prior_3,
    sum(decode(status,
    'Open',decode(priority,'4',1,0),
    0)) open_prior_4,
    sum(decode(status,
    'Open',decode(priority,5,1,0),
    0)) open_prior_5
    from SOFTPROJ_issues
    where project_id = :P83_PROJECT
    However, I got the following error during the steps of creation:
    1 error has occurred
    Query cannot be parsed, please check the syntax of your query. (ORA-00923: FROM¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿)
    I wonder why if it is getting the error because I could create the report with the following query without problems:
    select min(identified_date) first_identified,
    max(actual_COMPLETE) last_closed,
    count(id) total_issues,
    sum(decode(status,'Open',1,0)) open_issues,
    sum(decode(status,'Pending',1,0)) pending_issues,
    sum(decode(status,'Resolved',1,0)) closed_issues,
    sum(decode(status,'Will Not Resolve',1,0)) not_resolve_issues,
    sum(decode(status,
    'Open',decode(priority,null,1,0),
    0)) open_no_prior,
    sum(decode(status,
    'Open',decode(priority,1,1,0),
    0)) open_prior_1,
    sum(decode(status,
    'Open',decode(priority,3,1,0),
    0)) open_prior_3,
    sum(decode(status,
    'Open',decode(priority,5,1,0),
    0)) open_prior_5
    from SOFTPROJ_issues
    where project_id = :P83_PROJECT
    1 error has occurred
    Query cannot be parsed, please check the syntax of your query. (ORA-00923: FROM¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿)
    The difference is to add the followings only:
    sum(decode(status,
    'Open',decode(priority,'2',1,0),
    0)) open_prior_2
    sum(decode(status,
    'Open',decode(priority,'4',1,0),
    0)) open_prior_4,
    Does anyone have any idea to resolve the issue?
    Thanks in advance,
    Rui

    By putting a comma after open_prior_2:
    sum(decode(status,
    'Open',decode(priority,'2',1,0),
    0)) open_prior_2,Sima

  • Creating reports in BI EE from PL/SQL query

    Please provide me solution of how to create reports in Oracle BI EE tool while using PL/SQL query block.
    Thanks
    Rajni Sharma

    Narender Singh wrote:
    Dear All,
    We are using Oracle APPS, we have two tier structure.I bet it is actually 3-tier & WebServer exists
    1) Application Tier
    2) Database Tier
    My requirement is to run a PL/SQL script to create directory structure in Unix box of Database Tier. I would be very grateful to person proving the input related to the same.
    I want to create directory structure to store different type of files.
    /usr/tmp/2000/jan/file1
    /usr/tmp/2000/jan/file2
    /usr/tmp/2000/jan/file3
    /usr/tmp/2000/jan/file4
    similarly, I have to create directory structure from year 2000- 2011 and for each year I have to 12 folder for months and then for each month I can have n number of file folders.
    We are using 11g database.
    Thanks in Advance!!
    Regards,
    Narender
    Edited by: Narender Singh on Aug 9, 2011 10:50 AMDBMS_SCHEDULER that invokes OS shell script

  • Report data  does not reflect the SQL Query?

    Hi,
    I have a report which does not seem to be processing all records returned from the database. When I run the SQL Query produced by crystal manually against the SQL Server all data is returned correctly in crystal not. Does this mean my links are not set up correctly in the Database Expert? or is there another issue, I use a Crystal Syntax selection formulae which is based on a couple of paramters to filter the database records.
    Help is appreciated
    K

    <p>I agree with Rahul on checking the record count on the report vs. the record count from the query.  Conditional suppression and Group selection formula will hide records that are actually being returned.</p><p>It sounds like (from your question) that you are using the database linking expert in CR.  You can also check the SQL that CR is sending by going to Database -> Show SQL Query... compare this with the query you are using for validation, this will give you some clues as to whether your linking structure has an issue. </p>

Maybe you are looking for

  • How to use SELECTION-SET with FREE-SELECTIONS?

    Hi, how to use SELECTION-SET with FREE-SELECTIONS? Regards, Vinay.

  • How to avoid form submitting ?

    All, I have a form that gets submitted when I press a button, and I need to prevent the submitting of the data on the database, which in our case is an update of the record. In the bean I want to get the user inputs, so I need the submitted values of

  • Can a session bean call a database?? design issue

    Is there a thumb rule that all my database calls should be made through an entity bean ? I have data that needs to be saved across calls as well as persisted to the database. But the instance of the object is not going to be modified concurrently. So

  • Apex_util.is_login_password_valid

    Hi, Just a quick gripe in the concern that I haven't fully understood the problem and someone can add their feedback please: I'm following the custom authentication recipe around page 74 of the Pro Oracle Application Express book. There is an example

  • IStore Catalog update migration utility?

    Hello, We are using Oracle iStore 11i with E-Business Suite 11.5.10.2. Oracle Content Management is not installed. Is there a way to migrate/copy iStore catalog insertions or updates from one instance to another (i.e. dev, test, prod)? Any FNDLOAD or