APEX validations in updateable reports built on a PL/SQL query

Sorry if the question is not clear (english is not my mother language) or if the answer already exists on the forum (I have not been able to find it).
I build a report on a PL/SQL function query.
In this PL/SQL query i use apex_item.checkboxes or texts to let the end user change/enter some new data.
As i need to do some validations on the user entries, i have already used some events (e.g. onChange) that trigger
simple javascript validations checking if data is numeric or length of data entered....
But i would like to use also the standard validations of APEX to make some more complex validations (e.g. checking coherency) on
many data entered by the end user.
I am trying to build a PL/SQL to loop through the report lines through a checkbox item i have added
but the process of debugging is awfull for me.
- Is there a pointer to a code example of validations within a query report that would help me in achieving this validation
- or could someone give me some clue on how to acess these report data in the interface.
Thanks in advance,
Daniel

Daniel:
You can check out Denes Kubicek's APEX demo site for ideas on how to create validations for a tabular form.
http://htmldb.oracle.com/pls/otn/f?p=31517:41:3322496527336906:::RP,::
Varad

Similar Messages

  • Creating Crystal Reports Dynamically from an incoming SQL query

    Hi,
    I have a requirement where a sql query will be entered by the user in a text box and in the back end java code, i have to create a crystal report dynamically based on that sql query and show it in the crystalviewer object.
    For example if the user writes "select x,y from xtable ", i should be able to create a report with 2 fields, and if the user says "select x,y,z from xtable" then i should be able create and show a report with 3 fileds...thsi report creation should be done in the click event.
    Is this possible in java? I have found something similar in .NET... pls have a look at this 
    http://vb.net-informations.com/crystal-report/dynamic_crystal_report_from_sql_query_string.htm
    Thanks,
    Preethi

    Hi Preethi,
    Can you please share the steps with me? I am also looking for dynamic SQL being applied to the crystal report.
    Thank you so much for your help in advance.
    Regards,
    Janakiram D.

  • Sql Query (updateable Report) returning ORA-06502: PL/SQL: numeric or value

    Hi I have a Sql Query Report Region as defined below. On the report attributes I am not using any "Row Selector". In a After submit process I try to print out the results of the value I have entered in as a value in updatable report and i get the error: I am doing this as a test before i use the data to insert into another table...
    I receive this error if I enter in a characters (not numeric) into the "Field Value" field.:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error.
    If I enter in a numeric into the "Field Value" text box, then I get the value displayed back without error. I need to be able to enter a varchar value without error.
    My SQL QUERY is:
    select i.INDEXED_FIELD_ID, i.field_name,
    HTMLDB_ITEM.TEXT(3,d.indexed_field_value) field_value,
    decode(f.required, 0, 'O', 1, 'R', 'NOT USED') REQUIRED
    from XXVG_EFILE_DOCUMENT_FIELDS D,
    xxvg_efile_type_fields f, xxvg_efile_indexed_fields i
    WHERE f.indexed_field_id = i.indexed_field_id
    and f.required in (0,1)
    and i.indexed_field_id = d.indexed_field_id(+)
    and d.document_id(+) = -1
    and f.document_type_id = :p21_doc_type
    My after submit process is the following...**Note** I am using P21_test as a field just to display my test. I receive the value back just fine without error if numeric. If varchar, that is when the problems occur. I have used just a length variable like the lettter 't' for testing and still receive the error.
    DECLARE
    vRow BINARY_INTEGER;
    BEGIN
    -- update field values
    FOR i IN 1 .. HTMLDB_APPLICATION.g_f03.COUNT -- your field value
    LOOP
    vRow := HTMLDB_APPLICATION.g_f03(i);
    IF vRow is Not NULL --means the field has data in it.
    THEN
    :p21_test := HTMLDB_APPLICATION.G_F03(i); --set a variable to the field with data.
    END IF;
    END LOOP;
    END;
    Is there a conversion I need to do? I do not want to do this via checkboxes as I dont want the user have to check a checkbox and then enter a value in. I just want a blank text box the user can enter a value in and then i can do an insert.
    Thanks So much.

    Thanks Scott, That did do the trick as the varchar is now displayed of the entered item.
    How do i also display the value of indexed_field_id as well.
    I have an insert where i need the indexed field id and the entered field value.
    Thanks in advance.

  • Discoverer Report showing Null VS Show SQL query showing results !!!

    I created a simple Cross Tab Discoverer report from a custom SQL which has a calculation for balances. The output is giving all null values even though there are balances. The output doesn't seem right. So I copied the query from Tools-->Show SQL and ran the query in the TOAD where I'm showing balances for the report. I don't understand why it is not showing in the discoverer. Please help.
    Thanks
    Edited by: PA1B on Jan 27, 2010 11:40 AM

    Sorry for late reply.
    Below is the Show SQL query. I don't think the query is application dependent. C_1 is my calculation.
    SELECT o279709.SEGMENT3 as E279727,
    o279709.SEGMENT4 as E279728,
    CASE WHEN o279709.CURRENCY_CODE = 'USD' AND o279709.TRANSLATED_FLAG <> 'Y' THEN SUM(o279709.ENDING_BAL) ELSE 0 END as C_1,
    GROUPING_ID(o279709.CURRENCY_CODE,o279709.SEGMENT3,o279709.SEGMENT4,o279709.TRANSLATED_FLAG) as GID
    FROM ( --Foriegn Entity USD Balances
    SELECT                B.SEGMENT1,
                                       B.SEGMENT2,     
                                       B.SEGMENT3,
                                  (select distinct substr(cat.COMPILED_VALUE_ATTRIBUTES,5,1) from apps.fnd_flex_values cat
                   where FLEX_VALUE_SET_ID = (select bat.FLEX_VALUE_SET_ID from apps.fnd_id_flex_structures_vl aat, apps.fnd_id_flex_segments_vl bat
                                                                                                                       where bat.id_flex_code = 'GL#' and
                                                                                                                            bat.id_flex_code = aat.id_flex_code and
                                                                                                                            aat.APPLICATION_ID = bat.APPLICATION_ID and
                                                                                                                            aat.APPLICATION_ID = 101 and
                                                                                                                            bat.SEGMENT_NAME = 'Prime Account' and
                                                                                                                            aat.id_flex_num = bat.id_flex_num
                                                                                                                            and bat.id_flex_num in (select distinct chart_of_accounts_id from apps.gl_code_combinations gat
                                                                                                                                                                              where gat.code_combination_id = A.code_combination_id))
                                       and cat.flex_value = b.segment3) ACCT_TYPE ,
                                       B.SEGMENT4,
                                       B.SEGMENT5,
                                       B.SEGMENT6,
                                       B.SEGMENT7,
                                       B.SEGMENT8,
                                       B.SEGMENT9,
                                       B.SEGMENT10,
                                       B.SEGMENT11,
                                       B.SEGMENT12,
                                       B.SEGMENT13,
                                       C.NAME,
    A.SET_OF_BOOKS_ID,
                                       A.CURRENCY_CODE,A.TRANSLATED_FLAG,
                                  SUM(NVL(A.BEGIN_BALANCE_DR,0) - NVL(A.BEGIN_BALANCE_CR,0)) BEG_BAL,
                                  SUM(NVL(A.PERIOD_NET_DR,0)) DEBITS,
    SUM( NVL(A.PERIOD_NET_CR,0)) CREDITS ,
    A.PERIOD_NAME,
                                  SUM(NVL(A.BEGIN_BALANCE_DR,0) - NVL(A.BEGIN_BALANCE_CR,0))+ SUM(NVL(A.PERIOD_NET_DR,0) - NVL(A.PERIOD_NET_CR,0)) ENDING_BAL
    FROM                     APPS.GL_BALANCES A ,
                                       APPS.GL_CODE_COMBINATIONS B,
                                       APPS.GL_SETS_OF_BOOKS     C
    WHERE                     A.CODE_COMBINATION_ID = B.CODE_COMBINATION_ID
    --AND                           A.PERIOD_NAME = 'SEP-09'
    AND                          C.SET_OF_BOOKS_ID = A.SET_OF_BOOKS_ID
    --AND                           A.TRANSLATED_FLAG <> 'Y'
    --AND                           B.SEGMENT1 = '83101'
    --AND                           B.SEGMENT3 = '14602'
    --AND                           A.SET_OF_BOOKS_ID = 77
    --AND                           A.CURRENCY_CODE = 'USD'
    GROUP BY           A.CODE_COMBINATION_ID,
                                  B.SEGMENT1,
                                       B.SEGMENT2,     
                                       B.SEGMENT3,
                                       B.SEGMENT4,
                                       B.SEGMENT5,
                                       B.SEGMENT6,
                                       B.SEGMENT7,
                                       B.SEGMENT8,
                                       B.SEGMENT9,
                                       B.SEGMENT10,
                                       B.SEGMENT11,
                                       B.SEGMENT12,
                                       B.SEGMENT13,          
                                       A.CURRENCY_CODE,
                                       A.TRANSLATED_FLAG,
                                       C.NAME,A.PERIOD_NAME,
    A.SET_OF_BOOKS_ID
    ) o279709
    WHERE (o279709.PERIOD_NAME = 'DEC-09')
    AND (o279709.SET_OF_BOOKS_ID <> 72)
    AND (o279709.SEGMENT12 = '000')
    AND (o279709.SEGMENT3 IN ('10101','10301','10502','12001'))
    AND (o279709.SEGMENT1 IN ('82901','82902','82903','83001','83003','83201'))
    GROUP BY GROUPING SETS(( o279709.CURRENCY_CODE,o279709.SEGMENT3,o279709.SEGMENT4,o279709.TRANSLATED_FLAG ),( o279709.SEGMENT3,o279709.SEGMENT4 ),( o279709.SEGMENT3 ))
    HAVING (GROUP_ID()=0)
    ORDER BY GID DESC;
    Thanks,
    PA1
    Edited by: PA1B on Jan 29, 2010 12:50 PM

  • Report in Answers using a SQL Query(Sub Query) URGENT

    HI
    Can anyone help me in creating a report in answers using this below query please. Its little Urgent. I have no idea how to implement this, please suggest.
    Select
    a.account_external_id, a.edc_external_id, c.ann_usg, indclassificationcode, g.usage_cv, trunc(g.bill_month, 'mm') bill_month
    from
    crm2ro.cdi_customer_gas_all a, pwrline.account@lodestar_source b, crm2ro.cdi_ann_usg c,
    select * FROM
    select * from
    select distinct d.account_external_id, d.end_date, d.bill_month, USAGE_CV, dense_rank () over (partition by d.account_external_id order by d.end_Date desc) dr
    from
    crm2ro.cdi_usage_gas_all d, crm2ro.cdi_customer_gas_all e
    where
    d.account_external_id = e.account_external_id and upper(e.plan_id) like '%CPS%' and e.product_external_id = 'V' and e.crm_product = 'MV'
    and (e.plan_id like '%VAR_CPS_MX_G%' or e.plan_id like '%VAR_CPS_IT_G%') and e.account_status = 'ACTIVE'
    )where dr<=12
    ) h
    ) g
    where
    a.account_external_id = g.account_external_id and
    a.account_external_id = c.account_external_id and
    a.account_external_id = b.accountid
    thanks
    van

    Yes Jai,
    I want to do it from rpd or from the advance tab as 974053 said. But I am not aware of doing through advance tab and if I want to do through rpd then how can I do it. Please help me how to build this query through rpd or any other solution.

  • Crystal Reports 10 Datasource Location and SQL Query update

    I am running Crystal Reports 10 accessing SQL Server 2008 database on Windows 7. Our product changed database names and I'm trying to update reports to point to the new database. Sounds nice and simple. The database has no structure changes yet, it's just a copy and rename of the old database. Both databases exist, same SQL instance, same permissions, etc. ...
    Existing working report:
       Has an ODBC (RDO) location to database DbVersion1
       If I run Show SQL Query, the database name is in the query text (i.e. FROM DbVersion1.dbo.MyTable)
    Attempted:
       In Set Database Location popup, I created a new ODBC (RDO) connection to database DbVersion2
       Updated Current Data Source for report to this new ODBC (RDO) connection.
       Ran Verify Database. Popup stated "The database is up to date."
    But when I run "Show SQL Query", is still shows DbVersion1 in the text, and the report displays data from DbVerison1. When I display the Datasource Location for the report, it shows DbVersion2 as I changed to above. How do I "refresh" the SQL Query to recognize the new Datasource Location?
    Thanks,
    Gary

    Hi Gary,
    A possible couple of issues, CR 10 doesn't support SQL Server 2008 and it doesn't support Windows 7. We had to update CR XI R2 SP 6 and above to make SQL 2008 work. MS changed the name of their client dll so CR is not aware of the new drivers.
    MDAC native driver may work but not sure....
    Try OLE DB, it may work better.
    Thanks
    Don

  • Report Column Headings based on SQL Query

    Hi ,
    I am working on creating a SQL query based report. However, my column headers for this report are stored in a table and hence, I need the column headers to be based on a sql query also.
    Can you give me some pointers on how to do this ?
    Thanks!
    Lavanya

    Lavanya,
    The report column attributes page has a radiogroup of column heading types. One lets you specify a PL/SQL function that returns the headings.
    Scott

  • Report based on PLSQL returning SQL query

    I created function which builds the SQL and returns it as VARCHAR2. For testing purposes I harcoded the primary ID for the query to be based on. I run the function as standalone call to get the generated SQL and to test it. It works fine. The moment I try to use the ID parameter as an argument passed to the function it doesn't work and I get the "No data found" error. Again if I try this function outside of Apex it produces correct SQL syntax and it runs.
    The function signature is really simple:
    FUNCTION abc(i_id NUMBER) RETURN VARCHAR2
    IS
    l_id NUMBER;
    BEGIN
    -- this works:
    -- l_id := 300;
    -- this doesn't work:
    l_id := i_id;
    ... more code follows. It uses the l_id while building the query.
    I also tried to make it an anonymous block and place it directly in Apex region. Again I face the same problem. I modified this function slightly to reference the page attribute instead of accepting parameter:
    DECLARE
    l_id NUMBER;
    BEGIN
    -- this works:
    -- l_id := 300;
    -- this doesn't work:
    l_id := :P65_ID;

    Have you verified that i_id and P65_ID have a value when the procedure runs? Perhaps have something along the lines of "if i_id is null then return 'select <dummy data> from dual' else [build real query here]"...?
    -D.

  • Generating report based on dynamically generated sql query

    I have to rewrite asp reports to oracle reports.
    The original application has forms in asp where reports are generated dynamically based on the options selected.
    There are many options to select.
    Some add filter criteria to where clause.
    I have no problem with this. As i can generate report using parameter form.
    whereas i don't know how to generate reports whose columns change based on the user selection.
    The front end screens are going to be in java and jsp pages. The only way i can think of is generating reports on all possible options the user may select. But, as there are more than 15 options, i think this is not the right approach.
    How can i achieve this.
    Thank you very much.
    navya.

    One method that comes to mind would be to use an after parameter form, and use lexical parameters to create dynamic statements.
    For example in your after pform:
    If :P_NAME = 'JOHN' then
    :P_SELECT = 'SELECT COL1, COL2 ';
    :P_FROM = 'FROM JOHN ';
    :P_WHERE = 'WHERE COL3 = 'JOHN';
    END IF;
    Then in your query, you could say:
    &P_SELECT
    &P_FROM
    &P_WHERE
    Something like that - If only parts of you where statement will change, you can just write that one part -
    like
    IF :P_STATE is not null then
    :P_STATE = ' and table.state = :P_STATE_IN ';
    else :P_STATE = ' and 1=1 ';
    end if;
    and in your query...
    where....
    &:P_STATE
    So IF a person enters a state, then limit the search to that state, or else do a 1=1.
    Hope this gives you a start

  • Updateable Report with pagination(APEX 3.2)

    Hi,
    I am working on APEX 3.2 and I have a question on Sql Query(Updateable Report) and pagination. I have an updateable report which we have set to show 100 rows. When the user has more than 100 rows enters the data and clicks next the data disappears. How can i save first 100 records once i click next ?. Any suggestions will be appreciated.
    Thanks,
    Greenhorn

    Here is what I did to get it to work.
    1. Copy xmlparserv2.jar from my ORACLE_HOME/oc4j/lib directory to my glassfish domains/domain1/applications/fop/WEB-INF/lib directory.
    2. Added the following two lines to the glassfish domains/domain1/fop/apex_fop.jsp before the driver.run() line
    out.clear();
    out = pageContext.pushBody();The second part of solution I found on another forum page.

  • Conditional display of a column link in sql updateable report

    Hi There,
    I've attempted to look thru the Apex forum about using an Authorization Scheme in an SQL Query (Updateble Report) where I can conditionaly enable (display) a column link based upon a value in the report but alas I cannot find a solution.
    What I have is a SQL Query (updateable report). What I want to achieve is dependant on the value of one of the columns in the report query conditionaly display a column link for the row being displayed. For example if the report dispayed the data from emp, dept only display a column link for rows where the deptno = 100 otherwise don't display the column link. Is this possible to achieve?
    I've tried to define in the authorizatuon scheme in the where clause of an SQL Statement to reference the report column as #deptno# but this doesn't work.
    TIA

    Boketi,
    I was unsuccessful yesterday in demoing what I believe you want to achieve. It appears that an authorization scheme will not process row by row within a standard report so as to allow a conditional display of a link or any other column attribute. You can conditionally display a column by the use of a page item but this method appears to be all or nothing.
    I was successful when I coded the return of the empno via a Case statement but the Link still appeared even though there was no value (empno) to link with. So essence the link to you to a blank for with no PK to read the database by.
    SELECT CASE WHEN deptno = 10 THEN empno ELSE NULL END empno,
           ename,
           job,
           hiredate,
           sal,
           comm,
           deptno,
           phone_nbr
    FROM   empJeff

  • Bug? - Getting "ORA-20001: Unable to create updateable report"

    We have created hundreds of simple tabular reports, but have come across 3 tables that we cannot get past the following error for when finishing the last step of the create wizard:
    ORA-20001: Unable to create updateable report. ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Error creating tabular form.
    Return to application.
    Here is the DDL for this table:
    CREATE TABLE ancfx_test
    (ANCFX_ID NUMBER(31,0) NOT NULL ENABLE,
    APP_DTL_LVL_CD VARCHAR2(160),
    NOTE_CALL_FR_TYP_CD VARCHAR2(15),
    ANCFX_VOID_IND CHAR(1) DEFAULT 'n' NOT NULL ENABLE,
    PCT_AUDT_USER_CREA VARCHAR2(30) DEFAULT 'PCT',
    PCT_AUDT_DTM TIMESTAMP (6) DEFAULT SYSDATE
    I have tried an alternate surrogate key, renaming the table, excluding the 160 character column etc., but not able to create this form.
    Based on this and the many hundreds of unique tabular forms we have created, seems we may have run across a bug?
    Any help would be greatly appreciated.
    Thanks!

    Hi Scott,
    Turns out we did reach some sort of limit in APEX regarding how many pages can be assigned to a tab as the current tab for assigned pages. We had around 750 or more pages listed under a given tab as the current tab for those pages, which apparently created a list of page numbers in a string presumably that exceeded the maximum size for a field somewhere in APEX apparently, thus the error about the character buffer being too small. Not only could we not create new pages, but we could not even view the tab page in the shared components area for this tab without getting the error, but could get into the tab page to view the page numbers assigned to the tab.
    To get around this we had to remove all the page numbers that were listed for the tab as the current tab for those pages. Once that was done, everything was back to normal, although the tab in question is no longer shown as the current tab for any of those pages, which is not really a problem for us.
    Anyway, seems Oracle may want to review any field limits that are related to page numbers assigned to a tab to be the current tab for those pages and consider doubling that limit. In our case, 785 pages were too many for this limit, and there were no messages that helped us deduce where this was coming from - just brute force trial and error to figure this one out. Since we have more pages to go, we might run into some limits elsewhere which I'll post here if so.
    Monte Malenke

  • Need to adjust SQL query for left outer join in Crystal Reports 2008.

    I need to change this SQL 2005 query.....
    SELECT     omnicell_anl.DeviceIDsLastMetricTable.member_id, omnicell_anl.DeviceIDsLastMetricTable.[Device Name],
                          omnicell_anl.DeviceIDsLastMetricTable.Account, omnicell_anl.labeledLastMetrics.PROPERTY_NAME,
                          omnicell_anl.labeledLastMetrics.latest_monitor_value
    FROM         omnicell_anl.DeviceIDsLastMetricTable LEFT OUTER JOIN
                          omnicell_anl.labeledLastMetrics ON omnicell_anl.DeviceIDsLastMetricTable.member_id = omnicell_anl.labeledLastMetrics.member_id
    WHERE
        omnicell_anl.labeledLastMetrics.PROPERTY_NAME = ?MyProperty
    To this query in Crystal Reports Report Writer:
    SELECT     omnicell_anl.DeviceIDsLastMetricTable.member_id, omnicell_anl.DeviceIDsLastMetricTable.[Device Name],
                          omnicell_anl.DeviceIDsLastMetricTable.Account, omnicell_anl.labeledLastMetrics.PROPERTY_NAME,
                          omnicell_anl.labeledLastMetrics.latest_monitor_value
    FROM         omnicell_anl.DeviceIDsLastMetricTable LEFT OUTER JOIN
                          omnicell_anl.labeledLastMetrics ON omnicell_anl.DeviceIDsLastMetricTable.member_id = omnicell_anl.labeledLastMetrics.member_id AND
                          omnicell_anl.labeledLastMetrics.PROPERTY_NAME = ?MyProperty
    I can't seem to get the left outer join function of Crystal Reports to emulate the same SQL query in SQL 2005.  Any ideas on how I can create this same query in Crystal 2008?
    Thanks,
    Dominic
    Edited by: Dominic Carissimi on Oct 28, 2008 7:55 PM
    Edited by: Dominic Carissimi on Oct 28, 2008 7:56 PM

    If you want the list of values for command level parameter then you need to add another command like
    select PropertyField from table
    and delete the links between this command and the existing command.
    Now go to field explorer and edit the command level parameter and make it as dynamic and add the property field from newly added command.
    Hope this helps!
    Raghavendra

  • Discoverer Report - SQL Query to retrieve list of parameters

    Hi
    We have around 100 Discoverer reports and I'm trying to find the list of parameters used in each report.
    Is there any SQL query that I can use to find the parameters used for each report
    or
    should I open the reports one by one to fetch the list of parameters used.
    I checked the tables in EUL4_US schema but no luck.
    - Amarnath.K

    give this a try for starters. It looks at the custom folders defined in the business area, which is where any LOV's defined for you parameters would be. As far as looking at the workbooks themselves, no, there is no way to do that in sql.
    select
    decode(eb.ba_created_by,'ORACLE_APPS','Seeded','Custom') Origin,
    eb.ba_name business_area,
    eo.OBJ_TYPE,
    decode(eo.obj_type, 'SOBJ','From Database', 'CUO', 'Custom Query', 'COBJ', 'Complex Folder', eo.obj_type) obj_type_desc,
    eo.OBJ_NAME folder,
    eo.OBJ_DESCRIPTION folder_description,
    decode(eo.sobj_ext_table, NULL, NULL, eo.obj_ext_owner || '.' || eo.sobj_ext_table) base_object,
    decode(es.seg_obj_id, null, UPPER(trim(eo.obj_object_sql1)||trim(eo.obj_object_sql2)||trim(eo.obj_object_sql3))
    , UPPER(trim(es.seg_chunk1) || trim(es.seg_chunk2) || trim(es.seg_chunk3) || trim(es.seg_chunk4))) SQL
    from
    eul4_us.EUL5_BAS eb,
    eul4_us.EUL5_objs eo,
    eul4_us.EUL5_BA_OBJ_LINKS ebol,
    eul4_us.eul5_segments es
    where
    eb.BA_ID = ebol.BOL_BA_ID and
    ebol.BOL_OBJ_ID = eo.OBJ_ID and
    eo.obj_id = es.seg_obj_id (+) and
    decode(eb.ba_created_by,'ORACLE_APPS','Seeded','Custom') = 'Custom'
    order by
    /*decode(eb.ba_created_by,'ORACLE_APPS','Seeded','Custom'), */eb.ba_name, ebol.BOL_SEQUENCE, es.seg_sequence

  • Help with PL/SQL returning SQL query for Report

    Hi
    I have got a report which I have formatted as PL/SQL function body returning SQL query.
    I have the following code
    declare
    q VARCHAR2(32000); -- query
    w VARCHAR2(4000) ; -- where clause
    begin
    q := 'select min(identified_date) first_identified,' ||
    ' max(actual_resolution_date) last_closed,' ||
    ' count("HELPDESK_CALL_ID) total_issues,' ||
    ' from tbl_helpdesk_calls';
    if :P9_call_type != '-1' then
    w := 'HELPDESK_CALL_TYPE_ID = :P9_call_type';
    end if;
    q := q || ' WHERE '|| w;
    return q;
    end;
    When I apply changes I get this error message
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00972: identifier is too long
    Any Idea where I maybe going wrong?

    thanks its compiling now but when I run the page I get this error message in the reports region
    failed to parse SQL query:
    ORA-00933: SQL command not properly ended
    This is my code that I have at the momment.
    declare
    q VARCHAR2(32000); -- query
    w VARCHAR2(4000) ; -- where clause
    we VARCHAR2(1) := 'N'; -- identifies if where clause exists
    begin
    q := 'select min(identified_date) first_identified,' ||
    ' max(actual_resolution_date) last_closed,' ||
    ' count(HELPDESK_CALL_ID) total_issues,' ||
    ' sum(decode(status,''Open'',1,0)) open_issues, ' ||
    ' sum(decode(status,''On-Hold'',1,0)) onhold_issues,' ||
    ' sum(decode(status,''Closed'',1,0)) closed_issues,' ||
    ' sum(decode(status,''Open'',decode
    (priority,''High'',1,0),0)) open_high_prior,' ||
    ' sum(decode(status,''Open'',decode
    (priority,''Medium'',1,0),0)) open_medium_prior, '||
    ' sum(decode(status,''Open'',decode
    (priority,''Low'',1,0),0)) open_low_prior '||
    ' from tbl_helpdesk_calls';
    if :P9_call_type != '-1' then
    w := 'where HELPDESK_CALL_TYPE_ID = :P9_call_type';
    we := 'Y';
    end if;
    if we = 'Y' then
    q := q ||w;
    end if;
    return q;
    end;
    I have a select list with a list of reports. what I am trying to do build an sql depending on what the :p9_call_type value is. -1 represents the display value of -All Reports- so if the user selects all reports it should display all results thus removing the where clause. However as my code stands when I user clicks on all reports he get the correct results for all reports. If the user selects anything else they get the error message above.

Maybe you are looking for

  • IF_FPM_WORK_PROTECTION is not working in portal

    Dear Experts. IF_FPM_WORK_PROTECTION is not working in portal . Which i have re-implemented in my Z-Wdp Component and in IS_DIRTY( ) method, following is the code which i have written.   ev_dirty = abap_true.   DATA lo_api_component  TYPE REF TO if_w

  • Unable to connect to a database

    Hello I am trying to connect to a database, but it comes up with an error message. the code is shown below. Error is as shown below init: deps-jar: Compiling 1 source file to C:\Documents and Settings\prozario\AssetManage\build\classes compile-single

  • Very Large String

    I have a String that is suppose to hold info of about 200 MB, but when the string grows my program crashes giving a OutOfMemory Exception. Is there some JVM configuration that will help me solve this problem? Or will shifting to Java5.0 help solve th

  • Search 10.0.1 - Multi facet issue.

    Hello, I am trying to get multi facets operational on storefront and as mentioned in the documentation, I configured filterProperties of RefinementConfigurationXMLGenerator.properties component with the properties to avoid filtering the results for n

  • Printer won't align cartridges

    I just want to align the black cartdrige because I only replace that one. I don't need color. The printer can't scan the alignment sheet without the color portion on it. How do I eliminate the pop up asking for an alignment before every print job?