SQL Report with 1 updatable column - help urgent

Hi,
I have a SQL report. I am using collection to store value of selected record by link column.
I have a updatable text item (NULL) in the column. I am able to store that value in the collection.
Any clue?
Code
1. Creating a collection in parent page:
apex_collection.create_or_truncate_collection
(p_collection_name => 'ORDER');
2. Query to populate item rows with option to key 'QTY' before pressing 'Add to Order' link.
select
itemcode,
description,
NULL AS qty,
'Add to Order' add_to_order
from itemtab
3. Made 'QTY' to Text item -- to allow users to key value
4. Created 'hidden & protected' items P1_ITEMCODE, P1_QTY
5. Set values of itemcode, qty in add_to_order link
6. Created a process to add values into collection:
for x in (select * from itemtab where itemcode = :P1_ITEMCODE)
loop
apex_collection.add_member(p_collection_name => 'ORDER',
p_c001 => x.ITEMCODE,
p_c002 => x.DESCRIPTION,
p_c003 => :P1_QTY
end loop;
7. Display value of itemcode, description, qty in report region
select c001, c002, c003
from apex_collections
where collection_name = 'ORDER'
Probem: The value of qty is not being stored in the collection and not appearing in the #7 report. itemcode and description values are fine.
Thanks,
Dip

Dip,
I'm guessing here as I can't see your application, I think your missing the page process to collect the data from your QTY field.
I created a quick demo of what i think your trying to achieve on apex.oracle.com
http://apex.oracle.com/pls/apex/f?p=19923:2
I added this to the html expression on the report Field add to:
<input type="button" onclick="doSubmit(#RANDOM_ID#)" value="Add To" />
Then the page process to collect and set the page item:
DECLARE
l_qty number;
BEGIN
FOR i in 1..APEX_APPLICATION.G_F03.COUNT LOOP
l_qty := nvl(APEX_APPLICATION.G_F03(i),0);
IF l_qty > 0
THEN
:P2_QTY := l_qty;
:P2_RANDOM_ID := :REQUEST;
EXIT;
END IF;
END LOOP;
END;
Let me know if this helps
Mark
Don't forget to mark reply as helpful or correct as this may help others reading this thread in the future!
Edited by: cptbutcher on Mar 25, 2010 10:40 PM

Similar Messages

  • Re: BUG? APEX 4.0: ORA-20503 error editing report with 400+ columns

    Hello Everyone.
    I've run into something quite strange and am hoping you can help me.
    I am using Apex 4.0.1 and Oracle version 10.2.0.5. I've created a "classical" report in which the underlying SQL is a very simple:
    select * from pvtabThe Oracle table pvtab consists of 419 columns, all of which are varchar2(88) and number type. That's it.
    When I run the report, al of the columns show up as expected.
    However, when I go into the "Report Attributes" tab and click on one of the fields (any of them, it doesn't matter which one), I immediately get the following error:
    ORA-20503: Current version of data in database has changed since user initiated update process. current checksum = "598CAA7B68746A66F4B99E1512C36DED" application checksum = "0"If if replace the "*" with a few actual column names, then I am able to access any of these columns without problem.
    If I put back the "*", I then encounter this error again.
    I have never seen this error with other SQL SELECT statements in which I use the "*" qualifier to retrieve all columns from the table.
    And so, I am wondering if the error is caused because of the large number of columns (419) in my table.
    I've seen this same error mentioned in connection with forms but never with a report.
    So, is there some limit to the number of columns one can have in a "classic" or interactive report?
    Any idea why I would be getting this error?
    Here is the DDL for my table pvtab:
    CREATE TABLE  "PVTAB"
       (     "MICRO" VARCHAR2(4),
         "PRIM" VARCHAR2(4),
         "UNIT" NUMBER,
         "SEC_REF_1" NUMBER,
         "SECN_1" VARCHAR2(88),
         "SEC_REF_2" NUMBER,
         "SECN_2" VARCHAR2(88),
         "SEC_REF_3" NUMBER,
         "SECN_3" VARCHAR2(88),
         "SEC_REF_4" NUMBER,
         "SECN_4" VARCHAR2(88),
         "SEC_REF_5" NUMBER,
         "SECN_5" VARCHAR2(88),
         "SEC_REF_6" NUMBER,
         "SECN_6" VARCHAR2(88),
         "SEC_REF_7" NUMBER,
         "SECN_7" VARCHAR2(88),
         "SEC_REF_8" NUMBER,
         "SECN_8" VARCHAR2(88),
         "SEC_REF_9" NUMBER,
         "SECN_9" VARCHAR2(88),
         "SEC_REF_10" NUMBER,
         "SECN_10" VARCHAR2(88),
         "SEC_REF_11" NUMBER,
         "SECN_11" VARCHAR2(88),
         "SEC_REF_12" NUMBER,
         "SECN_12" VARCHAR2(88),
         "SEC_REF_13" NUMBER,
         "SECN_13" VARCHAR2(88),
         "SEC_REF_14" NUMBER,
         "SECN_14" VARCHAR2(88),
         "SEC_REF_15" NUMBER,
         "SECN_15" VARCHAR2(88),
         "SEC_REF_16" NUMBER,
         "SECN_16" VARCHAR2(88),
         "SEC_REF_17" NUMBER,
         "SECN_17" VARCHAR2(88),
         "SEC_REF_18" NUMBER,
         "SECN_18" VARCHAR2(88),
         "SEC_REF_19" NUMBER,
         "SECN_19" VARCHAR2(88),
         "SEC_REF_20" NUMBER,
         "SECN_20" VARCHAR2(88),
         "SEC_REF_21" NUMBER,
         "SECN_21" VARCHAR2(88),
         "SEC_REF_22" NUMBER,
         "SECN_22" VARCHAR2(88),
         "SEC_REF_23" NUMBER,
         "SECN_23" VARCHAR2(88),
         "SEC_REF_24" NUMBER,
         "SECN_24" VARCHAR2(88),
         "SEC_REF_25" NUMBER,
         "SECN_25" VARCHAR2(88),
         "SEC_REF_26" NUMBER,
         "SECN_26" VARCHAR2(88),
         "SEC_REF_27" NUMBER,
         "SECN_27" VARCHAR2(88),
         "SEC_REF_28" NUMBER,
         "SECN_28" VARCHAR2(88),
         "SEC_REF_29" NUMBER,
         "SECN_29" VARCHAR2(88),
         "SEC_REF_30" NUMBER,
         "SECN_30" VARCHAR2(88),
         "SEC_REF_31" NUMBER,
         "SECN_31" VARCHAR2(88),
         "SEC_REF_32" NUMBER,
         "SECN_32" VARCHAR2(88),
         "SEC_REF_33" NUMBER,
         "SECN_33" VARCHAR2(88),
         "SEC_REF_34" NUMBER,
         "SECN_34" VARCHAR2(88),
         "SEC_REF_35" NUMBER,
         "SECN_35" VARCHAR2(88),
         "SEC_REF_36" NUMBER,
         "SECN_36" VARCHAR2(88),
         "SEC_REF_37" NUMBER,
         "SECN_37" VARCHAR2(88),
         "SEC_REF_38" NUMBER,
         "SECN_38" VARCHAR2(88),
         "SEC_REF_39" NUMBER,
         "SECN_39" VARCHAR2(88),
         "SEC_REF_40" NUMBER,
         "SECN_40" VARCHAR2(88),
         "SEC_REF_41" NUMBER,
         "SECN_41" VARCHAR2(88),
         "SEC_REF_42" NUMBER,
         "SECN_42" VARCHAR2(88),
         "SEC_REF_43" NUMBER,
         "SECN_43" VARCHAR2(88),
         "SEC_REF_44" NUMBER,
         "SECN_44" VARCHAR2(88),
         "SEC_REF_45" NUMBER,
         "SECN_45" VARCHAR2(88),
         "SEC_REF_46" NUMBER,
         "SECN_46" VARCHAR2(88),
         "SEC_REF_47" NUMBER,
         "SECN_47" VARCHAR2(88),
         "SEC_REF_48" NUMBER,
         "SECN_48" VARCHAR2(88),
         "SEC_REF_49" NUMBER,
         "SECN_49" VARCHAR2(88),
         "SEC_REF_50" NUMBER,
         "SECN_50" VARCHAR2(88),
         "SEC_REF_51" NUMBER,
         "SECN_51" VARCHAR2(88),
         "SEC_REF_52" NUMBER,
         "SECN_52" VARCHAR2(88),
         "SEC_REF_53" NUMBER,
         "SECN_53" VARCHAR2(88),
         "SEC_REF_54" NUMBER,
         "SECN_54" VARCHAR2(88),
         "SEC_REF_55" NUMBER,
         "SECN_55" VARCHAR2(88),
         "SEC_REF_56" NUMBER,
         "SECN_56" VARCHAR2(88),
         "SEC_REF_57" NUMBER,
         "SECN_57" VARCHAR2(88),
         "SEC_REF_58" NUMBER,
         "SECN_58" VARCHAR2(88),
         "SEC_REF_59" NUMBER,
         "SECN_59" VARCHAR2(88),
         "SEC_REF_60" NUMBER,
         "SECN_60" VARCHAR2(88),
         "SEC_REF_61" NUMBER,
         "SECN_61" VARCHAR2(88),
         "SEC_REF_62" NUMBER,
         "SECN_62" VARCHAR2(88),
         "SEC_REF_63" NUMBER,
         "SECN_63" VARCHAR2(88),
         "SEC_REF_64" NUMBER,
         "SECN_64" VARCHAR2(88),
         "SEC_REF_65" NUMBER,
         "SECN_65" VARCHAR2(88),
         "SEC_REF_66" NUMBER,
         "SECN_66" VARCHAR2(88),
         "SEC_REF_67" NUMBER,
         "SECN_67" VARCHAR2(88),
         "SEC_REF_68" NUMBER,
         "SECN_68" VARCHAR2(88),
         "SEC_REF_69" NUMBER,
         "SECN_69" VARCHAR2(88),
         "SEC_REF_70" NUMBER,
         "SECN_70" VARCHAR2(88),
         "SEC_REF_71" NUMBER,
         "SECN_71" VARCHAR2(88),
         "SEC_REF_72" NUMBER,
         "SECN_72" VARCHAR2(88),
         "SEC_REF_73" NUMBER,
         "SECN_73" VARCHAR2(88),
         "SEC_REF_74" NUMBER,
         "SECN_74" VARCHAR2(88),
         "SEC_REF_75" NUMBER,
         "SECN_75" VARCHAR2(88),
         "SEC_REF_76" NUMBER,
         "SECN_76" VARCHAR2(88),
         "SEC_REF_77" NUMBER,
         "SECN_77" VARCHAR2(88),
         "SEC_REF_78" NUMBER,
         "SECN_78" VARCHAR2(88),
         "SEC_REF_79" NUMBER,
         "SECN_79" VARCHAR2(88),
         "SEC_REF_80" NUMBER,
         "SECN_80" VARCHAR2(88),
         "SEC_REF_81" NUMBER,
         "SECN_81" VARCHAR2(88),
         "SEC_REF_82" NUMBER,
         "SECN_82" VARCHAR2(88),
         "SEC_REF_83" NUMBER,
         "SECN_83" VARCHAR2(88),
         "SEC_REF_84" NUMBER,
         "SECN_84" VARCHAR2(88),
         "SEC_REF_85" NUMBER,
         "SECN_85" VARCHAR2(88),
         "SEC_REF_86" NUMBER,
         "SECN_86" VARCHAR2(88),
         "SEC_REF_87" NUMBER,
         "SECN_87" VARCHAR2(88),
         "SEC_REF_88" NUMBER,
         "SECN_88" VARCHAR2(88),
         "SEC_REF_89" NUMBER,
         "SECN_89" VARCHAR2(88),
         "SEC_REF_90" NUMBER,
         "SECN_90" VARCHAR2(88),
         "SEC_REF_91" NUMBER,
         "SECN_91" VARCHAR2(88),
         "SEC_REF_92" NUMBER,
         "SECN_92" VARCHAR2(88),
         "SEC_REF_93" NUMBER,
         "SECN_93" VARCHAR2(88),
         "SEC_REF_94" NUMBER,
         "SECN_94" VARCHAR2(88),
         "SEC_REF_95" NUMBER,
         "SECN_95" VARCHAR2(88),
         "SEC_REF_96" NUMBER,
         "SECN_96" VARCHAR2(88),
         "SEC_REF_97" NUMBER,
         "SECN_97" VARCHAR2(88),
         "SEC_REF_98" NUMBER,
         "SECN_98" VARCHAR2(88),
         "SEC_REF_99" NUMBER,
         "SECN_99" VARCHAR2(88),
         "SEC_REF_100" NUMBER,
         "SECN_100" VARCHAR2(88),
         "SEC_REF_101" NUMBER,
         "SECN_101" VARCHAR2(88),
         "SEC_REF_102" NUMBER,
         "SECN_102" VARCHAR2(88),
         "SEC_REF_103" NUMBER,
         "SECN_103" VARCHAR2(88),
         "SEC_REF_104" NUMBER,
         "SECN_104" VARCHAR2(88),
         "SEC_REF_105" NUMBER,
         "SECN_105" VARCHAR2(88),
         "SEC_REF_106" NUMBER,
         "SECN_106" VARCHAR2(88),
         "SEC_REF_107" NUMBER,
         "SECN_107" VARCHAR2(88),
         "SEC_REF_108" NUMBER,
         "SECN_108" VARCHAR2(88),
         "SEC_REF_109" NUMBER,
         "SECN_109" VARCHAR2(88),
         "SEC_REF_110" NUMBER,
         "SECN_110" VARCHAR2(88),
         "SEC_REF_111" NUMBER,
         "SECN_111" VARCHAR2(88),
         "SEC_REF_112" NUMBER,
         "SECN_112" VARCHAR2(88),
         "SEC_REF_113" NUMBER,
         "SECN_113" VARCHAR2(88),
         "SEC_REF_114" NUMBER,
         "SECN_114" VARCHAR2(88),
         "SEC_REF_115" NUMBER,
         "SECN_115" VARCHAR2(88),
         "SEC_REF_116" NUMBER,
         "SECN_116" VARCHAR2(88),
         "SEC_REF_117" NUMBER,
         "SECN_117" VARCHAR2(88),
         "SEC_REF_118" NUMBER,
         "SECN_118" VARCHAR2(88),
         "SEC_REF_119" NUMBER,
         "SECN_119" VARCHAR2(88),
         "SEC_REF_120" NUMBER,
         "SECN_120" VARCHAR2(88),
         "SEC_REF_121" NUMBER,
         "SECN_121" VARCHAR2(88),
         "SEC_REF_122" NUMBER,
         "SECN_122" VARCHAR2(88),
         "SEC_REF_123" NUMBER,
         "SECN_123" VARCHAR2(88),
         "SEC_REF_124" NUMBER,
         "SECN_124" VARCHAR2(88),
         "SEC_REF_125" NUMBER,
         "SECN_125" VARCHAR2(88),
         "SEC_REF_126" NUMBER,
         "SECN_126" VARCHAR2(88),
         "SEC_REF_127" NUMBER,
         "SECN_127" VARCHAR2(88),
         "SEC_REF_128" NUMBER,
         "SECN_128" VARCHAR2(88),
         "SEC_REF_129" NUMBER,
         "SECN_129" VARCHAR2(88),
         "SEC_REF_130" NUMBER,
         "SECN_130" VARCHAR2(88),
         "SEC_REF_131" NUMBER,
         "SECN_131" VARCHAR2(88),
         "SEC_REF_132" NUMBER,
         "SECN_132" VARCHAR2(88),
         "SEC_REF_133" NUMBER,
         "SECN_133" VARCHAR2(88),
         "SEC_REF_134" NUMBER,
         "SECN_134" VARCHAR2(88),
         "SEC_REF_135" NUMBER,
         "SECN_135" VARCHAR2(88),
         "SEC_REF_136" NUMBER,
         "SECN_136" VARCHAR2(88),
         "SEC_REF_137" NUMBER,
         "SECN_137" VARCHAR2(88),
         "SEC_REF_138" NUMBER,
         "SECN_138" VARCHAR2(88),
         "SEC_REF_139" NUMBER,
         "SECN_139" VARCHAR2(88),
         "SEC_REF_140" NUMBER,
         "SECN_140" VARCHAR2(88),
         "SEC_REF_141" NUMBER,
         "SECN_141" VARCHAR2(88),
         "SEC_REF_142" NUMBER,
         "SECN_142" VARCHAR2(88),
         "SEC_REF_143" NUMBER,
         "SECN_143" VARCHAR2(88),
         "SEC_REF_144" NUMBER,
         "SECN_144" VARCHAR2(88),
         "SEC_REF_145" NUMBER,
         "SECN_145" VARCHAR2(88),
         "SEC_REF_146" NUMBER,
         "SECN_146" VARCHAR2(88),
         "SEC_REF_147" NUMBER,
         "SECN_147" VARCHAR2(88),
         "SEC_REF_148" NUMBER,
         "SECN_148" VARCHAR2(88),
         "SEC_REF_149" NUMBER,
         "SECN_149" VARCHAR2(88),
         "SEC_REF_150" NUMBER,
         "SECN_150" VARCHAR2(88),
         "SEC_REF_151" NUMBER,
         "SECN_151" VARCHAR2(88),
         "SEC_REF_152" NUMBER,
         "SECN_152" VARCHAR2(88),
         "SEC_REF_153" NUMBER,
         "SECN_153" VARCHAR2(88),
         "SEC_REF_154" NUMBER,
         "SECN_154" VARCHAR2(88),
         "SEC_REF_155" NUMBER,
         "SECN_155" VARCHAR2(88),
         "SEC_REF_156" NUMBER,
         "SECN_156" VARCHAR2(88),
         "SEC_REF_157" NUMBER,
         "SECN_157" VARCHAR2(88),
         "SEC_REF_158" NUMBER,
         "SECN_158" VARCHAR2(88),
         "SEC_REF_159" NUMBER,
         "SECN_159" VARCHAR2(88),
         "SEC_REF_160" NUMBER,
         "SECN_160" VARCHAR2(88),
         "SEC_REF_161" NUMBER,
         "SECN_161" VARCHAR2(88),
         "SEC_REF_162" NUMBER,
         "SECN_162" VARCHAR2(88),
         "SEC_REF_163" NUMBER,
         "SECN_163" VARCHAR2(88),
         "SEC_REF_164" NUMBER,
         "SECN_164" VARCHAR2(88),
         "SEC_REF_165" NUMBER,
         "SECN_165" VARCHAR2(88),
         "SEC_REF_166" NUMBER,
         "SECN_166" VARCHAR2(88),
         "SEC_REF_167" NUMBER,
         "SECN_167" VARCHAR2(88),
         "SEC_REF_168" NUMBER,
         "SECN_168" VARCHAR2(88),
         "SEC_REF_169" NUMBER,
         "SECN_169" VARCHAR2(88),
         "SEC_REF_170" NUMBER,
         "SECN_170" VARCHAR2(88),
         "SEC_REF_171" NUMBER,
         "SECN_171" VARCHAR2(88),
         "SEC_REF_172" NUMBER,
         "SECN_172" VARCHAR2(88),
         "SEC_REF_173" NUMBER,
         "SECN_173" VARCHAR2(88),
         "SEC_REF_174" NUMBER,
         "SECN_174" VARCHAR2(88),
         "SEC_REF_175" NUMBER,
         "SECN_175" VARCHAR2(88),
         "SEC_REF_176" NUMBER,
         "SECN_176" VARCHAR2(88),
         "SEC_REF_177" NUMBER,
         "SECN_177" VARCHAR2(88),
         "SEC_REF_178" NUMBER,
         "SECN_178" VARCHAR2(88),
         "SEC_REF_179" NUMBER,
         "SECN_179" VARCHAR2(88),
         "SEC_REF_180" NUMBER,
         "SECN_180" VARCHAR2(88),
         "SEC_REF_181" NUMBER,
         "SECN_181" VARCHAR2(88),
         "SEC_REF_182" NUMBER,
         "SECN_182" VARCHAR2(88),
         "SEC_REF_183" NUMBER,
         "SECN_183" VARCHAR2(88),
         "SEC_REF_184" NUMBER,
         "SECN_184" VARCHAR2(88),
         "SEC_REF_185" NUMBER,
         "SECN_185" VARCHAR2(88),
         "SEC_REF_186" NUMBER,
         "SECN_186" VARCHAR2(88),
         "SEC_REF_187" NUMBER,
         "SECN_187" VARCHAR2(88),
         "SEC_REF_188" NUMBER,
         "SECN_188" VARCHAR2(88),
         "SEC_REF_189" NUMBER,
         "SECN_189" VARCHAR2(88),
         "SEC_REF_190" NUMBER,
         "SECN_190" VARCHAR2(88),
         "SEC_REF_191" NUMBER,
         "SECN_191" VARCHAR2(88),
         "SEC_REF_192" NUMBER,
         "SECN_192" VARCHAR2(88),
         "SEC_REF_193" NUMBER,
         "SECN_193" VARCHAR2(88),
         "SEC_REF_194" NUMBER,
         "SECN_194" VARCHAR2(88),
         "SEC_REF_195" NUMBER,
         "SECN_195" VARCHAR2(88),
         "SEC_REF_196" NUMBER,
         "SECN_196" VARCHAR2(88),
         "SEC_REF_197" NUMBER,
         "SECN_197" VARCHAR2(88),
         "SEC_REF_198" NUMBER,
         "SECN_198" VARCHAR2(88),
         "SEC_REF_199" NUMBER,
         "SECN_199" VARCHAR2(88),
         "SEC_REF_200" NUMBER,
         "SECN_200" VARCHAR2(88),
         "SEC_REF_201" NUMBER,
         "SECN_201" VARCHAR2(88),
         "SEC_REF_202" NUMBER,
         "SECN_202" VARCHAR2(88),
         "SEC_REF_203" NUMBER,
         "SECN_203" VARCHAR2(88),
         "SEC_REF_204" NUMBER,
         "SECN_204" VARCHAR2(88),
         "SEC_REF_205" NUMBER,
         "SECN_205" VARCHAR2(88),
         "SEC_REF_206" NUMBER,
         "SECN_206" VARCHAR2(88),
         "SEC_REF_207" NUMBER,
         "SECN_207" VARCHAR2(88),
         "SEC_REF_208" NUMBER,
         "SECN_208" VARCHAR2(88)
       );Thank you for any help/advice.
    Elie
    Edited by: EEG on Jun 12, 2011 2:09 PM

    So, is there some limit to the number of columns one can have in a "classic" or interactive report?Yes. See Oracle® Application Express Application Builder User's Guide Release 4.0, Appendix B: Oracle Application Express Limits.
    Any idea why I would be getting this error?No, but I've replicated it in APEX 4.0.2.00.07 on 11.2.0.1.0 EE using a table of 420 <tt>varchar2(88)</tt> columns:
    >
    ORA-20503: Current version of data in database has changed since user initiated update process. current checksum = "50C9BDC0AA1AEF0EB272E9158B2117B4" application checksum = "0"
    >
    Happens whether using <tt>select *</tt> or including all column names in the query. (I know you don't want to type all the column names, but I'd never use <tt>select *</tt> in a production application: always use a proper column list. You can get one without typing by drag-and-drop of a table in most IDEs, or a query from <tt>user_tab_columns</tt>.)
    I hit the problem at 274 columns. Such an arbitrary number leads me to think that the problem is not one of the number of columns per se, but is due to some other limit (possibly a 32K VARCHAR2/RAW buffer somewhere).
    Workaround:
    Updates to the report column attributes are actually being saved, and you can navigate them using the Page Definition tree view as described in Appendix B.
    Getting More Help:
    This is probably a bug. If you have a support agreement with Oracle raise an SR with Oracle Support.
    Also:
    <li>Search the forum using the "ORA-20503" code and other possible terms to see if there's anything relevant. I had a quick look but the only thread in this context recommended an upgrade on an Oracle 9 DB version that's not compatible with APEX 4.0.
    <li>To get the attention of the Oracle APEX team or anyone else who may know more about this problem than we do, edit your original post and change the Subject to be more specific about the actual nature of the problem: <em>BUG? APEX 4.0: ORA-20503 error editing report with 400+ columns</em>, and include your database version/edition and the definition of the <tt>PVTAB</tt> table.
    Finally:
    Somebody's bound to ask, so we might as well get started:
    <li>Why so many columns?
    <li>What requirement is this trying to fulfil?

  • Report with multiplying columns  and WITH clause

    Hello
    I saw sth strange in my report. I assume that it could happens very often.
    I have report with few columns which two of them ar most complicated (many joins subqueries aggreagations on joined values etc.) These two columns (i.e C3,C4) should be multiplied (C3*C4).
    When i do pure report without multiplying only columns C1,C2,C3,C4 everything is ok - duration about 15 sec. but... when I put next column on report which multiply these columns (in Answers C5=C3*C4)
    I wait 3-4 minutes and my database hungs :(. After investigation I saw that in first case to databese goes pure "SELECT" statement it means:
    "Select ... as C1, ... as C2, max(...) as C3, sum(xxx)... C4 from yyy,sss,ttt WHERE aaa"
    but in second case BI uses WITH clause it means:
    WITH SAWITH0 AS
    ( Select ... as C1, ... as C2, max(...) as C3, sum(xxx)... C4 from yyy,sss,ttt WHERE aaa )
    SELECT SAWITH0.C1 as C1,
    SAWITH0.C2 as C2,
         SAWITH0.C3 as C3,
         SAWITH0.C4 as C4,
         SAWITH0.C3*SAWITH0.C4 as C5 FROM SSS
    and this statement is long runninq query and kills my database :(.
    I checked that SQL like this:
    Select ... as C1, ... as C2, max(...) as C3, sum(xxx)... C4, max(...)*sum(xxx)... As C5 from yyy,sss,ttt WHERE aaa" -
    runs few times faster than that above
    I know that I can do this multiply in business model layer but sometimes users can multiply(or other operations) on columns in reports without my knowledge and it kills my db :(. Where is bug? Why SQLs with WITH clause takes so much db time?
    Thank you for each kind of help

    WITH clause or Subquery Factoring allows the set of data to be reused multiple times within the SQL. Oracle will usually materialize the data into a temporary table (you will see it if you take an explain plan of the SQL).
    I would be surprised if it was the actual WITH clause that was causing the performance issue, however you can test this by turning the WITH clause feature off. Go to the Physical model, right mouse click on your Database > Properties > Features Tab, scroll down to WITH_CLAUSE_SUPPORTED and switch it off.
    I'd be interested to know if you do see actual improvement.
    Good Luck.

  • BO xi 3.1 u2013 schedule a template for multiple reports with different column

    Hi,
    I need to migrate the existing reports from SQL Server Reporting Services to BO, and the column order in the report is very important to the clients since clients have existing code to ingest these reports into their database. Now I want to schedule a single template with different parameters for all reports in BO, or create a single template with lot of parameters for all reports. My question is how I might use one template to create multiple reports with different column orders in the reports?
    For example, client A has the following column order in their report: firstName, LastName, DateBirth, SSN. Client B has the following column order in their report: SSN, DateBirth, LastName, FirstName. Can I use one template to create these multiple reports?
    Thanks!

    Hi,
    The only approach I can think of is to create a template report which uses variables
    For each column you would need to variable
    v_columnAName and v_columnAValue
    v_columnAName would have a if statement in it
    =if([client]="clientA" or [client]="clientC";NameOf([firstName]);if([client]="clientB";NameOf([SSN]);NameOf([lastName]));
    v_columnA would have a if statement in it
    =if([client]="clientA" or [client]="clientC";[firstName];if([client]="clientB";[SSN],[lastName]));
    This would only work when you had a small set of clients.
    This might be more managable if it was done in the universe
    Regards
    Alan

  • Report with piped Column incl. html-code

    Hi,
    I have a SQL Report with a table based function behind, like:
    SELECT * FROM table(my_function());
    One of the column in this report is with html-code. In the Column Attributes of this column I have changed the "Display As" to "Standard Report Column". That works perfect for me. But if I enable the report to print (pdf or excel) the export shows the html-code.
    Is it possible to change the html-code in the pdf/excel export to the same view like the "Display As"/"Standard Report Column"?
    thanks,
    carsten

    I dont think so.
    How will you display a textbox in PDF?
    If you need similar look and feel then using XML Publisher you can create a similar output.
    Regards,
    Abhishek

  • Design a single template for multiple reports with different column order

    Hi,
    I need to migrate the existing reports from SQL Server Reporting Services to Crystal Report 2008, and the column order in the report is very important to the clients since clients have existing code to ingest these reports into their database. Now I want to create a single template with lot of parameters for all reports. My question is how I might use one template to create multiple reports with different column orders in the reports?
    For example, client A has the following column order in their report: firstName, LastName, DateBirth, SSN. Client B has the following column order in their report: SSN, DateBirth, LastName, FirstName. Can I use one template to create these multiple reports?
    Thanks in advance.

    -As I mentioned you can find Template Field object in Insert menu of crystal report Designer 2008.
    As soon as you select Template Field object you will be able to see a box beside ur mouse cursor. Drag and drop this box at required place. Now when you place this object in report you will get some thing like this "<TemplateField1>" listed under Formula Fields tree. Double click "<TemplateField1>" formula to add your conditions.
    -I have not tested it for large amount of Customers. However as the number of customer increases the number of conditions will get increased.
    For the customer that want the same ordering of columns you can put those customers under one condition.
        for Example...
              if(?Client in ['clientA','clientA']) then
                        <TableName>.<Field>......
    -What do you mean be 40 columns? Do you mean 40 fields or you want to show 40 columns in report? Please elaborate.
    Regards,
    Amrita
    Edited by: Amrita Singh on May 21, 2009 7:54 AM

  • SQL Report with Scroll - javascript

    This is an example of Apex SQL Report with Scroll - made with javascript: http://tryapexnow.com/apex/f?p=12090:9
    Waiting for comments here.

    Yes, because of the page generated by APEX, if you use the Report Template APEX 4.0 Standard, the div created for the report table has the ID "with_scroll" but there is another div which actually contains the table, and it's ID is "report_with_scroll", they just add a "report_" in front of it.
    I find the table by searching through the childs of that div: var table = document.getElementById(myRegion).rows[1].cells[0].firstChild;
    You can use the first one, with the ID "with_scroll", but this code line will be longer.
    Also to addapt the script for other report templates, you just need to see the code generated by every template, and correct this line, to get the real table containing your report.

  • SQL report with delete capability

    I want to create a SQL report with the capability of delete rows (show checkboxes next to each row). Is this possible?

    You can create a page type of Tabular Form, remove all buttons but delete, change all the edit boxes to display as text (saves state) and use that.

  • PLSQL-generated SQL report with variable number of columns

    I created an app to track college football bowl picks:
    http://apex.oracle.com/pls/otn/f?p=21723
    The main report region includes columns for the various games as well as a column for each participant. In order not to hard code the number of participants, I used PLSQL to generate the SQL so that new columns could be added on the fly.
    However, whenever I add a new user I get this result -
    report error:
    ORA-01403: no data found
    If I copy and paste the PLSQL into a new report region and then delete the old one, however, all is well.
    Is there something I can do to overcome this?
    Thanks.
    Bill

    Roberto
    <br><br>
    Here are the tables:
    <br><br>
    BOWL_GAMES<br>
    ID     NUMBER<br>
    NAME     VARCHAR2(30)<br>
    FAV     VARCHAR2(20)<br>
    DOG     VARCHAR2(20)<br>
    BDATE     DATE<br>
    LINE     NUMBER(3,1)<br>
    FAV_SCORE     NUMBER(4,0)<br>
    DOG_SCORE     NUMBER(4,0)<br>
    <br>
    BOWL_USERS<br>
    ID     NUMBER<br>
    USERNAME     VARCHAR2(20)<br>
    PW     VARCHAR2(20)<br>
    NAME     VARCHAR2(20)<br>
    EMAIL     VARCHAR2(50)<br>
    <br>
    BOWL_PICKS<br>
    ID     NUMBER(5,0)<br>
    USERID     NUMBER(10,0)<br>
    GAMEID     NUMBER(10,0)<br>
    PICK     NUMBER(1,0)<br>
    <br>
    <br>
    Below is my PLSQL. Feel free to try out the app. Thanks.
    <br><br>
    Bill<br><br>
    declare<br>
    p_sql varchar2(32767);<br>
    cursor c1 is select * from bowl_users order by id;<br>
    begin<br>
    p_sql := q'! select to_char(b.bdate, 'Mon FMdd') "Date", b.name, '< a href="javascript$pickEm(''' || b.fav || ''')">' || b.fav || '</ a> -' || b.line || ' < a href="javascript$pickEm(''' || b.dog || ''')">' || b.dog || '</ a>' "Line" !';<br>
    for a1 in c1 loop<br>
    p_sql := p_sql || q'! , bowl_strike(b.id, !' || a1.id || q'! , 0) || (select decode(p.pick, 0, substr(b.dog,1,4), 1, substr(b.fav,1,4), 'No pick') from bowl_picks p where p.userid = !' || a1.id || q'! and p.gameid = b.id) || bowl_strike(b.id, !' || a1.id || q'! , 1) "!' || upper(a1.name) || q'!" !';<br>
    end loop;<br>
    p_sql := p_sql || q'! , bowl_score(b.id) "SCORE" from bowl_games b order by b.bdate !';<br>
    return replace(p_sql,'$',':');<br>
    end;
    <br><br>
    Message was edited by:
    [email protected]

  • How to create a report with dynamic columns

    Hi all,
    I am using Apex 4.0 with Oracle 10g
    I am creating a report and I need to display columns dynamically based on the item values.
    example:
    I have a table employee with columns name, designation, sal
    In the report page i have a select list with designations and when I select a designation from the select list,
    I need to display the names of the employees horizontally,
    like each name as a new column in the report with that particular designation. and same has to continue when I select different designations.
    Can some one help me how we can do that.
    I appreciate your answer
    Thanks,
    Rik

    Essentially you want to write a pl/sql function which returns a varchar2 string. The contents of the string must be a valid sql statement.
    Once you have done this, you need to add a report region as type sql report and you will have the option of writing it as a query or as a function returning query. Choose function returning query and enter in the function call.
    Note your function must be valid, and must be executable by your apex parsing schema.
    example:
    create or replace
    function test_report(   p1_tablename       in varchar2)
    return varchar2
    is
    v_query varchar2(4000);
    begin
    v_query  :=
    'SELECT * from '||p_tablename;
    return v_query;
    end test_report;Edited by: Keith Jamieson on Aug 15, 2011 4:50 PM

  • Problem of POP LOV  in a  SQL Report  with pagination

    I am using a pop up lov (along with some other fields), HTMLDB_ITEM.POPUP_FROM_LOV(5, null, 'EMPLOYEE_LIST', '20', '50')), in a sql report. This is a report with pagination. Whenever I select any value from pop up lov on first page of the report it gets populated properly in the corresponding text field. But from second page onwards it doesn’t populate any value.
    For example, my report fetches a total of 50 rows, of which I am displaying 15 at a time. The popup lov comes with a text field for each row. Whenever I do select from popup lov for 1-15 rows which come on page 1, the values come up in the text field properly, but for rows 16-30 on second page, 31-45 on third 46-50 on fourth the values do not get populated. When I changed the pagination settings to display 40 rows..the values were still coming properly on page 1(1-40 rows) and not on the next page. Any clues… how to resolve this problem?

    good find. this is a bug that has already been identified and will be corrected in the upcoming patch release for htmldb. a good work-around for now is to use the equivalent declarative options in the tool. so rather than coding your query like...
    select ename , HTMLDB_ITEM.POPUP_FROM_LOV(2, null, 'DEPARTMENT', '20', '50') as "department" from emp
    ...just code it like this...
    select ename , null as "department" from emp
    ...and then use the column attributes screen for your "department" column to indicate that you'd like that col to be rendered as a "Popup LOV (named LOV)" using your DEPARTMENT list of values.
    hope this helps,
    raj

  • How to Print a report with 50 columns. Crystal Reports

    Dear Experts,
    I'm Using Crystal Reports 2008. I have a requirement that 50 columns should be placed in a  Single Report with single line . But Page size should be A4 ( While Printing).
    With Page Size A4 I'm able to place 5 columns.
    Is there any possibility to acheave this no matter if number of opages increases
    I Appreciate for the help in this regard.
    But I need to display all the 50 fields (columns) in a single report.
    I Achieved this by changing horizontal width to 70.
    I can Place all the fields in one line.
    But my concern is to print this report in A4 Paper I think its horizontal width will be 11.  from crystal reports itself
    I don't want to use cross tabs nor even use sql expression. Its just a simple display report for all the employees.
    is there any simple way out to Achieve this by paging... or any other method.
    Any help regarding this issue will be appreciated.
    Thanks

    Hi:
       I'm not a expert in crystal report, but I would like help you,  i don't understand if must to show 50 diferrents fields in your report  or same field through 50 columns ?  for exemple:
    first case: You ned diferents fields
    F1                F2                 F3                 ... F50
    item1  F1      Item1 F2         Item1 F3       Item F50
    item2  F1      Ite21 F2         Item2 F3       Item F50
    In this case you must put the 50 fields in the report, just enough small to fit page
    second case: You nedd the same field in 50 columns
    Colum 1      Colum2      Column 50
    item 0          item 11      item 490
    item 1          item 12      item 491
    item 2          item 13      item492
    item 10       item 20      item 500
    inm this case i haven't idea how to make it (sorry)
    Edited by: Wgramirez on May 29, 2010 7:01 PM

  • Pl-sql report with parameter

    Hi
    I have created report with region source as pl-sql. In pl-sql block, calling package where i am passing query. In query's where clause i want to pass paramter value which user had selected.
    There are two regions on page. On upper part, there is select list, on lower part there is report with pl-sql region but value of select list is not found in query. I am trying to access with bind variable, select list of item :SL_TEXT. But it is not showing any value in it.
    How to use select list value in query of report? Or let me know how to use parameter in pl-sql report which is selected in other region?
    Thanks in advance

    I am attempting to define the variable as a date variable through Oracle BI and yes it does use a colon to signal variable substitution.
    So thank you the first way you stated should work.
    The only problem I'm running into now I believe steems from the date format that column that I am trying to filter on. It is in what appears to be the worst format possible.
    Is it common for dates to be stored in a DD-MON-YY format? (e.g. 01-JAN-08) I thought we as a community had moved past that post Y2K scare. lol.
    When I set up the bind variable in BI it allows me to define the date format, much similar to the TO_DATE function but then it says (must be java date format). So I'm thinking that maybe DD-MON-YY is not a java date format.
    In that case is there a way to cast or convert my date format in the sql so that it is a supported java date format?
    Or should I just give up and pass it as a varchar2?

  • Turning sql  string (with dynamic columns) into a pipelined function

    Hi guys,
    I was working on an apex report the other day, and wrote the sql below (for those who don't know apex well, in an apex report you can define the columns at runtime.) When I was finished, I said to myself: "It would be great to have a pipeline function with this capability." So, the idea would be to have a sql string where the columns are created dynamically, depending on input parameters - and then be able to use this sql everywhere (oracle reports, sqlplus) through a pipelined function.
    Here's the sql (simplified, of course, the data itself is actually not important - the LOOP is the key)
    declare
    v_sql varchar2(4000);
    begin
    v_sql := 'select client, ';
    for i in (select employee from company_employees_view where condition = pi_parameter order by 1) loop
    v_sql := v_sql || sum(decode(employee,''' || i.employee || ''', total)) "' || i.employee || '"';
    end loop;
    v_sql := v_sql || ', sum(total) "Total"';
    v_sql := v_sql || ' from company_employees_view group by client';
    end;
    This sql would result in a final product like:
    select client
    , sum(decode(employee,'John',total) "John"
    , sum(decode(employee,'Paul',total) "Paul"
    , sum(decode(employee,'George',total) "George"
    (and so on... this sql could have more or less columns depending on the input parameters of the function)
    from company_employees_view
    group by client;
    I have tried feeding this sql into a ref cursor and an object, but always received an "inconsistent datatypes" message.
    The object would be something like:
    create or replace object rt_employee as (total number);
    create or replace tt_employee as table of rt_employee;
    create or replace object rt_client as (
    client varchar2(100),
    employee tt_employee);
    create or replace tt_client as table of rt_client;
    (I am not paying too much attention to syntax here.)
    By the way, no hurry whatsoever, this is just for fun, take your time. I am using database XE with apex 2.1 and sql developer 1.2.
    Thanks, Roger

    This is the only solution I've ever seen to dynamic pipelined columns...
    How to pipeline a function with a dynamic number of columns?

  • Interactive Report with Null Columns

    I've got a user who wants to export an interactive report, and he needs certain columns to appear on the export for him to fill the data in later (this is an intermediate step, while we work on getting all the data he needs in to the database). I've created the report query, and there are a handful of null/empty columns (to preserve the correct order for the export). When I try to add this query to APEX in an interactive report, I get a "ORA-00001: unique constraint (APEX_040000.WWV_FLOW_WORKSHEET_COLUMNS_UK2) violated" error.
    Googling around shows me that this happens because of similarly-named columns, and the solution is to provide aliases to all columns. My report has aliases on all columns, but I still cannot create an interactive report. I've tried changing the null columns to empty strings, as well as enclosing the aliases in double-quotes, but nothing works. I can however use my original query to create a standard report, but due to the export requirement, this isn't ideal.
    I was able to create the interactive report with one null column, and then edited the report source to add in the others. This had to be done one at a time, since trying to add multiple null columns at the same time gives the same error again. Unfortunately, when I try and run the page, I get an "ORA-20001: get_dbms_sql_cursor error ORA-00918: column ambiguously defined" error.
    My original query:
    select customer.customer_name as customer,
           project.name as project_name,       
           trunc(project.estimated_end_dt) as due_date,
           project_status.project_status_desc as status,
           null as revenue,
           project.baseline_effort as baseline_hours,
           null as projected_cost,
           null as est_gain_loss,
           project.actual_hours as actual_hours,
           project.estimated_hours as projected_hours,
           null as projected_cost,
           null as projected_gain_loss,
           null as roi      
        from project,
             customer
      where customer.customer_id = project.customer_id
      and project.inactive_ind = 0
      and project.customer_id is not null
      and project.estimated_end_dt >= :DTP_P50_STARTDT
      and project.estimated_end_dt <= :DTP_P50_ENDDT
    order by customer.customer_name,
             project.estimated_end_dt;             Can someone tell me a way to create an interactive report with multiple null columns?

    Hi shimmoril,
    The problem is likely that you have two columns aliased as "projected_cost" (7th column and 11th column).
    Hope this helps,
    John
    If you find this information useful, please mark the post "helpful" or "correct" so that others may benefit as well.*

Maybe you are looking for

  • Quicktime is 'choppy' when playing MP4's

    I just recently purchased an HD camcorder and am having trouble playing an MP4 file in Quicktime. Windows Media player wont play the format at all and while I have no problem using Quicktime (I actually like the player better) the playback is 'choppy

  • ITunes doesn't open, QuickTime freezes

    Well, as I read on the subject, a lot of people are experiencing this issue so I don't expect to hear a quick recommendations, still ... Mine is that I upgraded to the last version of iTunes yesterday. Till that moment both Quicktime and iTunes worke

  • Adobe Reader XI Signature and touch monitor issue

    Hi. I am trying to utilize signature feature on this new Adobe Reader XI. When I first tried this at a local Microsoft Store, it worked beautifully and I immediately downloaded the software on my computer (Windows 7; touch screen computer).  Upon ins

  • Roxio Media Manager - 8830

    I just got  8830 (VZN) I have DM version - 4.3 and device software V 4.2.2.176 When I open up Roxio Media Manager. The Application recognizes my device folders , but not my media card. I have a SD 2GB media in my device. Any suggestions?

  • French dictionary and other dictionaries

    Are they available to download from somewhere? I just want a decent french dictionary.