Bug ?? in HTMLDB_ITEM.POPUP_FROM_QUERY function

Hi
I have problems using the HTMLDB_ITEM.POPUP_FROM_QUERY function in a multiple update report.
When choosing from the dropdown list (new_persid) the return value is inserted into another row.
I have also tried the POPUP_FROM_LOV with the same result.
Is this a bug? or do I do something wrong?
Using SELECT_LIST_FROM_QUERY is OK, but the problem is that the user can't choose to type straight into the field, he always have to use the select list-dropdown box.
Below is the select statement:
select
HTMLDB_ITEM.DISPLAY_AND_SAVE(1,a.peapeaid ) peapeaid,
HTMLDB_ITEM.POPUP_FROM_QUERY(2,new_persid,
'Select distinct paris_group disp,paris_group from om_conv_org
order by 1') new_persid,
HTMLDB_ITEM.select_list(4,main_office ,'Y;Y,N;N') main_office,
HTMLDB_ITEM.SELECT_LIST_FROM_QUERY_XL(8,new_domicile, 'SELECT COUNTRY_NAME||''( ''||country_code||'')'' , COUNTRY_CODE R FROM PARIS_ISO_COUNTRY' ) new_domicile
from
xxxxx

Hi Scott :-)
Yes , that seems to be the problem.
when removing the sort possibility everything seems to be in order.
This is a serious bug, because when developing the form everything is fine , the update goes to the correct row (because the developer haven't sorted the data)
The error occurs first when sorting has been choosen once.
Is there a solution for this?
Regards
Evelyn

Similar Messages

  • HTMLDB_ITEM.POPUP_FROM_QUERY Populating Previous Text Field

    I have manually created an updateable report from an SQL Query in which I manually index each editable field. I also include some hidden values which I also attempt to control the index values. The rows to be displayed on this page are the result of an adhoc search page (P30). Everything works fine except when I have more than one row returned and try to edit any row other than the first. When I do, the previous row's corresponding field is affected and the last row popup fields can never be changed. My listboxes work fine and appear to be indexed correctly. Am I missing something? Thanks in-advance.
    A condensed version of my SQL:
    select
    NULL "CHECK$01", -- index 01? -- Checkbox for multiple updates is first index
    "TRANSACTION_NUMBER",
    "H_RID", -- index 02?
    "DUTY", -- index 03?
    "IC", -- index 04?
    "IS_NEW", -- index 05?
    "SUBMIT" -- index 06?
    from(
    select
    '0' AS "TRANSACTION_NUMBER", -- to be replaced with dynamic value
    HTMLDB_ITEM.HIDDEN(2,PE||FO) AS "H_RID", -- could hiddens be the problem?
    HTMLDB_ITEM.SELECT_LIST_FROM_QUERY_XL(3,DUTY,'SELECT DUTY||'' - ''||NVL(TITLE,''None Selected'') a, DUTY b FROM PDM.DUTY ORDER BY b') AS "DUTY",
    HTMLDB_ITEM.POPUP_FROM_QUERY(4,IC,'SELECT IC||'' - ''||NVL(TITLE,''None Selected'') a, IC b FROM PDM.INFRA_STRUCTURE ORDER BY b') AS "IC",
    HTMLDB_ITEM.SELECT_LIST(5,'N','Yes;Y,No;N') AS "IS_NEW",
    HTMLDB_ITEM.SELECT_LIST(6,'N','Yes;Y,No;N') AS "SUBMIT",
    HTMLDB_ITEM.MD5_CHECKSUM(duty,ic)
    from fd.pe
    /* Where condition to address previous search page values to determine number of rows to return for editing */
    where (:P30_DUTY = DUTY OR :P30_DUTY IS NULL)

    Scott,
    I had indicated the example was throwing errors associated with the HTMLDB_ITEM.POPUP_FROM_QUERY items. Although this is not the same error I am encountering in version 2.0 it does indicate that either there is an issue with my SQL or a bug with version 3. The SQL used to generate the reports is almost identical to the query I am running on my development site. The table and column names are different and I have provided a "Reader's Digest" version of my actual SQL.
    I can eliminate the LOV errors on this site by replacing the POPUPs with LISTs, but that defeats the point. For efficiency of time, I need to implement POPUPs because the data behind them can potentially result in hundreds of records. Compound this with the number of fields per record which might also employ POPUPs and I could very quickly exceed memory limitations of HTMLDB.
    Again, any assistance would be appreciated. Thanks.
    Ed
    PS. I have edited my SQL for the POPUPs. Apparently, the init LOV errors associated with them were generated by a simple concatenation of data fields within the inner select. I originally had:
    HTMLDB_ITEM.POPUP_FROM_QUERY(4,IC,'SELECT IC||'' - ''||NVL(TITLE,''No Title Available'') as a, IC as b FROM BORG_CUBE.IC ORDER BY b') AS "IC",
    by changing the above to read:
    HTMLDB_ITEM.POPUP_FROM_QUERY(4,IC,'SELECT IC as a, IC as b FROM BORG_CUBE.IC ORDER BY b') AS "IC",
    the init LOV errors went away. Now, there are no errors and no ability to replicate my error for you. Upgrading is not an option at this point, so I will begin recoding. :-(
    Message was edited by: MovingTarget
    MovingTarget

  • HT1665 There is a bug in the spellchecking functionality when typing in the web view or while using Blogsy App. Why? Why my IPad crashes so often?

    There is a bug in the spellchecking functionality when typing in the web view or while using Blogsy App. Why? Why my IPad crashes so often?

    I have always found spell check to be "buggy" in every version of all of the iOS's that I have run on my original model iPad and my new iPad - especially when replying and typing posts in these forums. It works perfectly in every other application on my iPad but it has never worked perfectly in any web browser that I have used on my iPad - no matter what I have done to try to correct it. That is what MY experience has been with spell check on my iPads.
    As for the crashes on your iPad try these basic troubleshooting steps.
    Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    Quit all apps and restart. Go to the home screen first by tapping the home button. Quit/close open apps by double tapping the home button and the task bar will appear with all of you recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner to close the apps. Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.

  • BUG in Blackberry 8700v functionality....

    In my view there is a bug in Blackberry 8700v functionality. its in the functionality of keypad lock.
    Regards,
    Abhinav Arya
    {edit}
    Message Edited by cathy298 on 10-13-2009 10:48 PM

    charmingnavy wrote:
    M not sure whether this is a right place to publish this
    Then why do you pop in with this "seekrit". This isn't junior high school where pass a friend in study hall and whisper "I know a seekrit about JoeBob but I can't tell you!"
    charmingnavy wrote:
      and with which team you are assiciated with...
    I root for Alabama. Roll Tide!
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • HTMLDB_ITEM.POPUP_FROM_QUERY - character string buffer too small

    I am creating a updateable report with a popup_from_query item on a table with a high number of columns (40 columns) where every column should be displayed as a popup_from_query.
    I get the following error message when running the page:
    report error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    *** It seems the longer the column list gets, the shorter the p_lov_query parameter could be.
    - Region 1: If you use only one column, your lov query fails with a statement that is 807+ characters. (if you use 806 it will work without an error).
    - Region 2: If you use only two column, you will fail just with a value of 800.
    - Region ?: I have 40 columns, now my query fails of about 30 charachters.
    * Region 1:
    select
    htmldb_item.popup_from_query(5,'x',
    'SELECT distinct '||COLUMN_NAME||' d, '||COLUMN_NAME||' r'||
    rpad(' ',807,' ')||
    ' FROM '||TABLE_NAME||' order by 1') xxxxxxxxxxxxxxxxxxxxxxxxxxxxx1
    from all_tab_columns
    where rownum < 2
    * Region 2:
    select
    HTMLDB_ITEM.POPUP_FROM_QUERY (
    44, 'x',
    'SELECT distinct '||COLUMN_NAME||' d, '||COLUMN_NAME||' r'||
    rpad(' ',800,' ')||
    ' FROM '||TABLE_NAME||' order by 1',
    least(DATA_LENGTH,60),2000
    ) xxxxxxxxxxxxxxxxxxxxxxxxxxxxx1,
    HTMLDB_ITEM.POPUP_FROM_QUERY (
    44, 'x',
    'SELECT distinct '||COLUMN_NAME||' d, '||COLUMN_NAME||' r'||
    rpad(' ',800,' ')||
    ' FROM '||TABLE_NAME||' order by 1',
    least(DATA_LENGTH,60),2000
    ) xxxxxxxxxxxxxxxxxxxxxxxxxxxxx2
    from all_tab_columns
    where data_type in ('VARCHAR2')
    I have set the region to: Use Generic Column Names (parse query at runtime only)
    Has anyone some suggestions or workaround for updateable reports with a lot of columns where popup's are needed?
    Thx Willi

    Hallo,
    Thank you a lot for that hint. But if this would be the case, why does Region 2 work then?
    Any further comments are welcome.
    Thx, Willi
    P.S.: I had reached the 2000 items (<input>) limit, but now only display less 2000 items on the page: "Your browser sent a request that this server could not understand.
    mod_plsql: /pls/htmldb/wwv_flow.accept HTTP-400 Too many arguments passed in.
    Got 9016 parameters. Upper limit is 2000"

  • Htmldb_item.popup_from_query does not display what it must display

    Hello everybody,
    Is the any but with htmldb_item.popup_from_query, I am using it but it does not display the value but the key ?
    thank you.

    sounds like you want to use htmldb_item.popupkey_from_query as opposed to htmldb_item.popup_from_query....
    select htmldb_item.popupkey_from_query (1,deptno,'select dname, deptno from dept') dt from dept
    ...and there's more info on it in our online doc at...
    http://htmldb.oracle.com/i/doc/mvl_api002.htm#CHDEHBAC
    ...regards,
    raj

  • Any solution to the iOS 6 bug for auto lock function for the iPhone 4S

    Any solution to the iOS 6 bug for auto lock function for the iPhone 4S

    My guess is they don't care. Most likely they're illiterate and don't know what a colon is for. They probably think it's a little-used character. Remember: these are the people who don't know the difference between "deprecate" and "depreciate".
    I have the same colon problem as you do. But it's not the biggest problem I have encountered in Lion. If it was only that I'd be Mr. Delighted with Lion. There's worse than having a colon - uh -  that won't cooperate. A lot worse, in Lion.

  • HTMLDB_ITEM.SELECT_LIST function returns wrong result in 1.6?

    Look at following select statements:
    1. select flows_010600.htmldb_item.select_list(1,null,'Full;F,Read;R,No;N',
    '','YES',null,'Derived','f01_'||TO_CHAR(ROWNUM,'FM0000'),'D')
    from dual
    &lt;label for="f01_0001" class="hideMe508"&gt;D&lt;/label&gt;&lt;select name="f01" id="f01_0001"&gt;&lt;option value=""&gt;Derived&lt;/option&gt;&lt;option value="F" &gt;Full&lt;/option&gt;&lt;option value="R" &gt;Read&lt;/option&gt;&lt;option value="N" &gt;No&lt;/option&gt;&lt;option value="" selected="selected"&gt;&lt;/option&gt;&lt;/select&gt;
    2.select flows_010500.htmldb_item.select_list(1,null,'Full;F,Read;R,No;N',
    '','YES',null,'Derived','f01_'||TO_CHAR(ROWNUM,'FM0000'),'D')
    from dual
    &lt;label for="f01_0001" class="hideMe508"&gt;D&lt;/label&gt;&lt;select name="f01" id="f01_0001"&gt;&lt;option value=""&gt;Derived&lt;option value="F" &gt;Full&lt;option value="R" &gt;Read&lt;option value="N" &gt;No&lt;/select&gt;
    If selected value of list is null version 1.6 call adds extra item without display value. Version 1.5 call works fine. Is it a bug or implied behavior?

    Hi Alexey,
    This is the intended behavior; in your htmldb_item.select_list call, you are setting the current value to NULL. This is the value shown in 1.6. In 1.5 the first value from your list of values was shown. This behavior wasn't appropriate in most cases. If for example you had a tabular form with a select list and the values retrieved from the database were not part of the list of values used for the select list, it would basically default the select list to the first value from your list of values. If you then saved your tabular form, you would have ended up with the wrong data. Now the select list will show the actual value from the database, if it's not part of the list of values. Otherwise it will show the correct display value. If in your case this is not the behavior you need, you can simply turn that off by modifying your query to:
    select flows_010600.htmldb_item.select_list(1,null,'Full;F,Read;R,No;N',
    '','YES',null,'Derived','f01_'||TO_CHAR(ROWNUM,'FM0000'),'D','NO')
    from dual
    I simply added another attribute which is called p_show_extra and set it to 'NO'. Here's the full specification of the function:
    function select_list (
    p_idx in number,
    p_value in varchar2 default null,
    p_list_values in varchar2 default null,
    p_attributes in varchar2 default null,
    p_show_null in varchar2 default 'NO',
    p_null_value in varchar2 default '%null%',
    p_null_text in varchar2 default '%',
    p_item_id in varchar2 default null,
    p_item_label in varchar2 default null,
    p_show_extra in varchar2 default 'YES'
    ) return varchar2
    Hope this helps,
    Marc

  • Acrobat 9 bug? - Print Pages function does not print all bookmarked pages

    We use the Bookmark Print Pages function to allow for easy printing of sections of large PDFs. All of the pages that should be printed are bookmarked. The bookmarked pages print correctly in Adobe 8, but not in Adobe 9.
    I have put together a javascript workaround, but would prefer a solution that does not require distributing a file to all users.
    I would appreciate any suggestions on other possible workarounds.
    Here is the bug report I submitted to Adobe:
    Concise problem statement: The "Print Pages" function for bookmarks does not print all bookmarked pages in Adobe Reader 9.0 and 9.1. The same bookmarks print properly in Adobe Reader, Standard, and Pro 8.
    Steps to reproduce bug:
    1. Open the Adobe Acrobat SDK JavaScript for Acrobat API Reference PDF (Version 8.1, April 2007) in Adobe Reader 9.0 or 9.1.
    2. View the bookmarks. Right-click on New Features and Changes and choose "Print Pages."
    3. Open the same PDF in Adobe Reader, Standard, or Pro 8. (I used Adobe Professional 8.1.3.)
    4. View the bookmarks. Right-click on New Features and Changes and choose "Print Pages."
    Results and Expected results: Printing from v8 results in 12 pages. Printing from v9 results in 9 pages. Pages 741, 754, and 769 did not print from v9.

    I'm having the same issues.  Using the latest version 9.3.3.  Is this a bug? I tired calling adobe but their CR sounds like 3rd country only.  Anyone can shed a light on this issue?

  • Bug in 11g CUBE_TABLE function?

    An unusual feature of the 11g OLAP CUBE_TABLE function has surfaced when querying a dimension.
    If a dimension has more than one hierarchy then if CUBE_TABLE is used to query a second or subsequent hierarchy on a dimension, and a WHERE clause on the DEPTH column is specified, no records will appear regardless of the value queried.
    eg. Imagine a dimenson TIME with two hierarchies FINANCIAL and CALENDAR (FINANCIAL having been defined first).
    The query "SELECT DEPTH, COUNT(*) DCOUNT from TABLE(CUBE_TABLE('TIME;FINANCIAL')) GROUP BY DEPTH ORDER BY DEPTH" will list how many dimension values have each value of DEPTH
    The query "SELECT * from TABLE(CUBE_TABLE('TIME;FINANCIAL')) WHERE DEPTH=0" will show the entire record corresponding to the top of the FINANCIAL hierarchy
    Repeat this for hierarchy CALENDAR.
    The first query will work correctly but the second will return an empty record set.
    I would say this is a bug.
    To demonstrate this effect in your own database you can run the following procedure (it will loop though all your dimensions and run these two queries.):-
    create or replace
    PROCEDURE SHOW_CUBE_TABLE_ERROR AS
    BEGIN
    DECLARE
    OLINE VARCHAR2(100);
    SLINE VARCHAR2(300);
    CURSOR ahv IS SELECT owner, dimension_name, hierarchy_name FROM sys.all_cube_hierarchies ;
    TYPE dynCurTyp IS REF CURSOR;
    dyn dynCurTyp;
    RDEPTH INTEGER;
    RCOUNT INTEGER;
    BEGIN
    FOR item IN ahv LOOP
    OLINE := item.owner || '.' || item.dimension_name || ';' || item.hierarchy_name;
    DBMS_OUTPUT.PUT_LINE(OLINE);
    DBMS_OUTPUT.PUT_LINE(LPAD('=',LENGTH(OLINE),'='));
    SLINE := 'SELECT DEPTH, COUNT(*) DCOUNT FROM TABLE(CUBE_TABLE(''' || OLINE || ''')) GROUP BY DEPTH ORDER BY DEPTH';
    DBMS_OUTPUT.PUT_LINE(SLINE);
    OPEN dyn FOR SLINE;
    DBMS_OUTPUT.PUT_LINE('DEPTH DCOUNT');
    DBMS_OUTPUT.PUT_LINE('----- ------');
    LOOP
    FETCH dyn INTO RDEPTH, RCOUNT;
    EXIT WHEN dyn%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(LPAD(RDEPTH, 5, ' ') || LPAD(RCOUNT, 9, ' '));
    END LOOP;
    DBMS_OUTPUT.PUT_LINE(' ');
    CLOSE dyn;
    SLINE := 'SELECT count(*) DCOUNT FROM TABLE(CUBE_TABLE(''' || OLINE || ''')) where DEPTH=0';
    DBMS_OUTPUT.PUT_LINE(SLINE);
    OPEN dyn FOR SLINE;
    DBMS_OUTPUT.PUT_LINE('DCOUNT');
    DBMS_OUTPUT.PUT_LINE('------');
    LOOP
    FETCH dyn INTO RCOUNT;
    EXIT WHEN dyn%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(LPAD(RCOUNT, 6, ' '));
    END LOOP;
    DBMS_OUTPUT.PUT_LINE(' ');
    CLOSE dyn;
    DBMS_OUTPUT.PUT_LINE(' ');
    END LOOP;
    END;
    END SHOW_CUBE_TABLE_ERROR;

    David
    Thanks for replying.
    1) I am using version Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production (A patch)
    2) There currently only is one schema but the problem is reproduceable in all AW's
    3) Attaching all AW's explicitly and performing ALLSTAT does not affect the result
    4) Reversing the order of the hierarchies does not affect the result either
    I have modified my procedure to perform actions (3) and (4)
    create or replace
    PROCEDURE SHOW_CUBE_TABLE_ERROR(REVHIER BOOLEAN) AS
    BEGIN
    DECLARE
    THISAW VARCHAR2(20);
    OLINE VARCHAR2(100);
    SLINE VARCHAR2(300);
    CURSOR awl IS SELECT aw_name FROM sys.user_aws;
    TYPE ahvCurTyp IS REF CURSOR;
    ahvr ahvCurTyp;
    TYPE dynCurTyp IS REF CURSOR;
    dyn dynCurTyp;
    ROWNER VARCHAR2(20);
    RDIMENSION VARCHAR2(20);
    RHIERARCHY VARCHAR2(20);
    RDEPTH INTEGER;
    RCOUNT INTEGER;
    BEGIN
    FOR item IN awl LOOP
    THISAW := item.aw_name;
    dbms_aw.execute('aw attach ' || THISAW || ' ro');
    END LOOP;
    IF REVHIER THEN
    OPEN ahvr for 'SELECT owner, dimension_name, hierarchy_name FROM sys.all_cube_hierarchies ORDER BY owner, dimension_name, hierarchy_name desc';
    ELSE
    OPEN ahvr for 'SELECT owner, dimension_name, hierarchy_name FROM sys.all_cube_hierarchies ORDER BY owner, dimension_name, hierarchy_name asc';
    END IF;
    LOOP
    FETCH ahvr INTO ROWNER, RDIMENSION, RHIERARCHY;
    EXIT WHEN ahvr%NOTFOUND;
    --FOR item IN ahv LOOP+
    --THISAW := dbms_aw.eval_text('obj( aw ''' || item.dimension_name || ''')');+
    --OLINE := item.owner || '.' || item.dimension_name || ';' || item.hierarchy_name;+
    THISAW := dbms_aw.eval_text('obj( aw ''' || RDIMENSION || ''')');
    OLINE := ROWNER || '.' || RDIMENSION || ';' || RHIERARCHY;
    DBMS_OUTPUT.PUT_LINE(OLINE || ' (AW: ' || THISAW ||')');
    DBMS_OUTPUT.PUT_LINE(LPAD('=', LENGTH(OLINE) LENGTH(THISAW) + 7,'='));+
    dbms_aw.execute('aw attach ' || THISAW || ' first');
    dbms_aw.execute('allstat');
    SLINE := 'SELECT DEPTH, COUNT(*) DCOUNT FROM TABLE(CUBE_TABLE(''' || OLINE || ''')) GROUP BY DEPTH ORDER BY DEPTH';
    DBMS_OUTPUT.PUT_LINE(SLINE);
    OPEN dyn FOR SLINE;
    DBMS_OUTPUT.PUT_LINE('DEPTH   DCOUNT');
    DBMS_OUTPUT.PUT_LINE('-----   ------');
    LOOP
    FETCH dyn INTO RDEPTH, RCOUNT;
    EXIT WHEN dyn%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(LPAD(RDEPTH, 5, ' ')  || LPAD(RCOUNT, 9, ' '));
    END LOOP;
    DBMS_OUTPUT.PUT_LINE(' ');
    CLOSE dyn;
    SLINE := 'SELECT count(*) DCOUNT FROM TABLE(CUBE_TABLE(''' || OLINE || ''')) where DEPTH=0';
    DBMS_OUTPUT.PUT_LINE(SLINE);
    OPEN dyn FOR SLINE;
    DBMS_OUTPUT.PUT_LINE('DCOUNT');
    DBMS_OUTPUT.PUT_LINE('------');
    LOOP
    FETCH dyn INTO RCOUNT;
    EXIT WHEN dyn%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(LPAD(RCOUNT, 6, ' '));
    END LOOP;
    DBMS_OUTPUT.PUT_LINE(' ');
    CLOSE dyn;
    DBMS_OUTPUT.PUT_LINE(' ');
    END LOOP;
    END;
    END SHOW_CUBE_TABLE_ERROR; ------------------------------------------------------------------------------------------------------------------------------------------------------
    I am not alone in noticing this issue. The developers at Simba said they'd seen it too but that it was fixed in the B patch. Any idea when this is available for Windows?
    Paul

  • Bug with ResultSet.wasNull() function

    The wasNull() function is incorrectly reporting false when null values are read for doubles. This is in conjunction with the Oracle 10gr2 classes12.jar driver.
    The case where I am seeing this is for a left outer join SQL statement. Double columns on the right side of the join are reporting false with wasNull when they are in fact null. I haven't tested other conditions yet.
    Is this a documented bug?
    Also, I apologize if there is a more appropriate forum for this question. If so, just let me know and I'll post there.

    Hi ,
    There is a bug mentioned on http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4424215.
    You can go through this for the fix release.
    -Priyanka

  • Bug? using MAX() function on char(1) column returns something larger

    details:
    -- we have a complex nested query, where we are essentially returning the max() value into a variable
    -- the max() function is being used on a char(1) column
    -- where MAX() is part of an inner select, we have started getting
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    errors.
    SELECT MAX(X) INTO var FROM ... works in 9i and 10g
    SELECT X INTO var FROM (SELECT MAX(X) X FROM ... worked in 9i, does not work in 10g!
    -- We never had problems with the code until upgrading to 10g release 2.
    -- the Solution is to cast the final value with TO_CHAR(). The cast MUST be done at the outer most point of the select:
    SELECT TO_CHAR(X) INTO var FROM (SELECT MAX(X) X FROM ... works
    SELECT X INTO var FROM (SELECT TO_CHAR(MAX(X)) X FROM ... causes an error!
    The following script demonstrates the issue, and includes the solution:
    * October 3, 2006
    * Possible SQL bug introduced with Oracle 10G
    * Natalie Gray DBA/Developer, Environment Canada
    * Description:
    * Have discovered a problem with using the MAX() function
    * on columns of type char(1)
    * only an issue when used in an inner select
    * solution (see test 4)
    CREATE TABLE SQL_BUG_TEST
    X NUMBER,
    Y NUMBER,
    Z CHAR(1)
    INSERT INTO SQL_BUG_TEST (X, Y, Z)
    VALUES (1,1,'A');
    INSERT INTO SQL_BUG_TEST (X, Y, Z)
    VALUES (1,1,'B');
    INSERT INTO SQL_BUG_TEST (X, Y, Z)
    VALUES (1,2,'C');
    INSERT INTO SQL_BUG_TEST (X, Y, Z)
    VALUES (1,2,'D');
    DECLARE
    TYPE REC IS RECORD (
          x SQL_BUG_TEST.X%TYPE,
          y SQL_BUG_TEST.Y%TYPE,
          z SQL_BUG_TEST.Z%TYPE
    v_rec REC;
    BEGIN
          -- DISPLAY THE TABLE DATA
          BEGIN
                 DBMS_OUTPUT.PUT_LINE('TABLE DATA:');
                DBMS_OUTPUT.PUT_LINE('');
                 DBMS_OUTPUT.PUT_LINE('SELECT * FROM SQL_BUG_TEST ORDER BY X,Y,Z;');
                 FOR crs IN (SELECT *
                                     FROM SQL_BUG_TEST
                               ORDER BY X,Y,Z) LOOP
                    DBMS_OUTPUT.PUT_LINE(':'||crs.X||':'||crs.Y||':'||crs.Z);
                END LOOP;
          EXCEPTION WHEN OTHERS THEN
                 DBMS_OUTPUT.PUT_LINE(SQLERRM);       
          END;
          -- TEST 1
          -- returning result from MAX into a variable when the MAX is in the outer most select
          -- does not cause an error
          BEGIN
                 DBMS_OUTPUT.PUT_LINE('*****************************************************');
                 DBMS_OUTPUT.PUT_LINE('TEST 1');
                DBMS_OUTPUT.PUT_LINE('');
                 DBMS_OUTPUT.PUT_LINE('SELECT X, Y, MAX(Z) Z');
                DBMS_OUTPUT.PUT_LINE('FROM SQL_BUG_TEST');
                DBMS_OUTPUT.PUT_LINE('GROUP BY X,Y');
                FOR crs IN (SELECT X, Y, MAX(Z) Z
                                     FROM SQL_BUG_TEST
                               GROUP BY X, Y
                               ORDER BY X,Y,Z) LOOP
                     DBMS_OUTPUT.PUT_LINE(':'||crs.X||':'||crs.Y||':'||crs.Z);
                END LOOP;
          EXCEPTION WHEN OTHERS THEN
               DBMS_OUTPUT.PUT_LINE(SQLERRM);
          END;
          -- TEST 2
          -- returning MAX() from an inner select to an outer select and then into a variable
          -- causes an error
          BEGIN
                 DBMS_OUTPUT.PUT_LINE('*****************************************************');
                 DBMS_OUTPUT.PUT_LINE('TEST 2');
                DBMS_OUTPUT.PUT_LINE('THIS DID NOT CAUSE AN ERROR WITH ORACLE 9i');
                DBMS_OUTPUT.PUT_LINE('');
                 DBMS_OUTPUT.PUT_LINE('SELECT * INTO v_rec');
                DBMS_OUTPUT.PUT_LINE('FROM');
                DBMS_OUTPUT.PUT_LINE('(SELECT X, Y, MAX(Z) Z');
                DBMS_OUTPUT.PUT_LINE('FROM SQL_BUG_TEST');
                DBMS_OUTPUT.PUT_LINE('GROUP BY X,Y)');
                DBMS_OUTPUT.PUT_LINE('WHERE Y = 1');
                SELECT * INTO v_rec
                FROM
                (SELECT X, Y, MAX(Z) Z
                 FROM SQL_BUG_TEST
                 GROUP BY X, Y)
                WHERE Y = 1;
                DBMS_OUTPUT.PUT_LINE(':'||v_rec.X||':'||v_rec.Y||':'||v_rec.Z);
          EXCEPTION WHEN OTHERS THEN
               DBMS_OUTPUT.PUT_LINE(SQLERRM);
          END;
          -- TEST 3
          -- casting the result from MAX to char before returning to the outer select
          -- still causes an error
          BEGIN
                 DBMS_OUTPUT.PUT_LINE('*****************************************************');
                 DBMS_OUTPUT.PUT_LINE('TEST 3');
                DBMS_OUTPUT.PUT_LINE('');
                 DBMS_OUTPUT.PUT_LINE('SELECT * INTO v_rec');
                DBMS_OUTPUT.PUT_LINE('FROM');
                DBMS_OUTPUT.PUT_LINE('(SELECT X, Y, to_char(MAX(Z)) Z');
                DBMS_OUTPUT.PUT_LINE('FROM SQL_BUG_TEST');
                DBMS_OUTPUT.PUT_LINE('GROUP BY X,Y)');
                DBMS_OUTPUT.PUT_LINE('WHERE Y = 1');
                SELECT * INTO v_rec
                FROM
                (SELECT X, Y, to_char(MAX(Z)) Z
                 FROM SQL_BUG_TEST
                 GROUP BY X, Y)
                WHERE Y = 1;
                DBMS_OUTPUT.PUT_LINE(':'||v_rec.X||':'||v_rec.Y||':'||v_rec.Z);
          EXCEPTION WHEN OTHERS THEN
               DBMS_OUTPUT.PUT_LINE(SQLERRM);
          END;
          -- TEST 4 - SOLUTION
          -- the return value of MAX must be cast with to_char at the point where it is assigned to
          -- variable (outer most select)
          BEGIN
                 DBMS_OUTPUT.PUT_LINE('*****************************************************');
                 DBMS_OUTPUT.PUT_LINE('TEST 4 SOLUTION');
                DBMS_OUTPUT.PUT_LINE('');
                 DBMS_OUTPUT.PUT_LINE('SELECT X, Y, TO_CHAR(Z) Z INTO v_rec');
                DBMS_OUTPUT.PUT_LINE('FROM');
                DBMS_OUTPUT.PUT_LINE('(SELECT X, Y, MAX(Z) Z');
                DBMS_OUTPUT.PUT_LINE('FROM SQL_BUG_TEST');
                DBMS_OUTPUT.PUT_LINE('GROUP BY X,Y)');
                DBMS_OUTPUT.PUT_LINE('WHERE Y = 1');
                SELECT X, Y, TO_CHAR(Z) Z INTO v_rec
                FROM
                (SELECT X, Y, MAX(Z) Z
                 FROM SQL_BUG_TEST
                 GROUP BY X, Y)
                WHERE Y = 1;
                DBMS_OUTPUT.PUT_LINE(':'||v_rec.X||':'||v_rec.Y||':'||v_rec.Z);
          EXCEPTION WHEN OTHERS THEN
               DBMS_OUTPUT.PUT_LINE(SQLERRM);
          END;
    END;

    I certainly looks like a bug, but you should raise an iTAR on Metalink since Oracle does not monitor this forum.
    I was able to replicate your results on my 10.2.0.1 database.
    There is an easier workaround than yours. Try
    ALTER TABLE sql_bug_test MODIFY (z VARCHAR2(1));That seems to eliminate the problem on my instance.
    John

  • Bug?: Tabular Form function "addRow" can't handle multi-line Row Templates

    Hi all,
    i created a custom Report Template (Named Column Row Template) which creates 2 lines per Record (which in fact is 2 rows in a HTML table).
    In the APEX function initTabForm (apex_4_0.js) the sample row (f01_0000) is read and stored in gTabFormInitRow
    This is done by using a jQuery Selector like this: jQuery('#init_row_'+pRegionID) which returns only the first row of my multiline record.
    Is this behaviour intended or is it a bug? Or do i have to change my HTML structure?
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    Work: http://www.click-click.at
    Training: http://www.click-click.at/apex-4-0-workshops

    Hi Marc,
    thanks for the quick reply.
    I was afraid you would say it is intended behavior :-)
    A table per row has the disadvantage of loosing the automatic column width, i would have to set the column width to a fixed value to maintain a nice look.
    Well, thanks for the moment, i'll try to find a general solution and (if i succeed) get back to you.
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    Work: http://www.click-click.at
    Training: http://www.click-click.at/apex-4-0-workshops

  • Bug in "look up" functionality in textareas in safari

    The first word on a new line of a text area displays funny (highlights NOT where the word originally was) if you use the "look up" functionality (triple-click). See images below.
    Using safari 5.1.3 (7534.53.10) and OSX 10.7.3.

    hi rupesh,
    i would implement it like that:
    program a svc that is called from other services as request reply compoenent.
    svcLookup always gets all data or bits of data that a client (Use1, Use2) needs and replys the data to the requesting service. Use1 and 2 may cache results in case the db is down then the requests to Lookup would timeout.
    DB<------>svcLookup   <------>   svcUse1
                          <------>   svcUse2regards chris
    Edited by: cbrennsteiner on Sep 9, 2008 11:27 AM

  • Is this a bug? (about analytic function)

    create table emp (
    empno varchar2(10),
    deptno varchar2(10),
    sal number(10)
    insert into emp(empno,deptno,sal) values('1','10',101);
    insert into emp(empno,deptno,sal) values('2','20',102);
    insert into emp(empno,deptno,sal) values('3','20',103);
    insert into emp(empno,deptno,sal) values('4','10',104);
    insert into emp(empno,deptno,sal) values('5','30',105);
    insert into emp(empno,deptno,sal) values('6','30',106);
    insert into emp(empno,deptno,sal) values('7','30',107);
    insert into emp(empno,deptno,sal) values('8','40',108);
    insert into emp(empno,deptno,sal) values('9','30',109);
    insert into emp(empno,deptno,sal) values('10','30',110);
    insert into emp(empno,deptno,sal) values('11','30',100);
    SELECT empno, deptno, sal,
    last_value(sal)
    OVER (PARTITION BY deptno order by sal desc) col1,
    first_value(sal)
    OVER (PARTITION BY deptno order by sal asc) col2,
    first_value(sal)
    OVER (PARTITION BY deptno order by sal desc) col3,
    last_value(sal)
    OVER (PARTITION BY deptno order by sal asc) col4
    FROM emp
    col2, col3 return what I expect.
    I don't know why col1 and col4 return the these kinds of results.

    Well... I learned something new today!
    This is because you have not defined a windowing clause in your analytic query. If you do not specify a windowing clause, the default used is RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW. So your query is equivalent to:
      1  select empno, deptno, sal,
      2  last_value(sal) over (
      3     partition by deptno
      4     order by sal desc
      5     range between unbounded preceding and current row
      6  ) col1,
      7  first_value(sal) over (
      8     partition by deptno
      9     order by sal asc
    10     range between unbounded preceding and current row
    11  ) col2,
    12  first_value(sal) over (
    13     partition by deptno
    14     order by sal desc
    15     range between unbounded preceding and current row
    16  ) col3,
    17  last_value(sal) over (
    18     partition by deptno
    19     order by sal asc
    20     range between unbounded preceding and current row
    21  ) col4
    22* from emp
    SQL> /
         EMPNO     DEPTNO        SAL       COL1       COL2       COL3       COL4
             4         10        104        104        101        104        104
             1         10        101        101        101        104        101
             3         20        103        103        102        103        103
             2         20        102        102        102        103        102
            10         30        110        110        100        110        110
             9         30        109        109        100        110        109
             7         30        107        107        100        110        107
             6         30        106        106        100        110        106
             5         30        105        105        100        110        105
            11         30        100        100        100        110        100
            11         30        100        100        100        110        100
             8         40        108        108        108        108        108
    12 rows selected.What you need to do is specify the correct windowing clause as follows:
      1  select empno, deptno, sal,
      2  last_value(sal) over (
      3     partition by deptno
      4     order by sal desc
      5     range between unbounded preceding and unbounded following
      6  ) col1,
      7  first_value(sal) over (
      8     partition by deptno
      9     order by sal asc
    10  ) col2,
    11  first_value(sal) over (
    12     partition by deptno
    13     order by sal desc
    14  ) col3,
    15  last_value(sal) over (
    16     partition by deptno
    17     order by sal asc
    18     range between unbounded preceding and unbounded following
    19  ) col4
    20* from emp
    SQL> /
         EMPNO     DEPTNO        SAL       COL1       COL2       COL3       COL4
             4         10        104        101        101        104        104
             1         10        101        101        101        104        104
             3         20        103        102        102        103        103
             2         20        102        102        102        103        103
            10         30        110        100        100        110        110
             9         30        109        100        100        110        110
             7         30        107        100        100        110        110
             6         30        106        100        100        110        110
             5         30        105        100        100        110        110
            11         30        100        100        100        110        110
            11         30        100        100        100        110        110
             8         40        108        108        108        108        108
    12 rows selected....which gives the expected results. Or just use max(), which is clearer anyway :)
    This is documented on Metalink, bug number 5684819:
    "If you omit the windowing_clause of the analytic_clause, it defaults to RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW. This default will return a value that sometimes may seem unexpected, because the last value in the window is at the bottom of the window, which is not fixed. It keeps changing as the current row changes. For expected results, specify the windowing clause as RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING. Another option, is to specify the windowing clause as RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING."
    cheers,
    Anthony

Maybe you are looking for

  • Why resolution will change in After Effect?

    Would you please help me? I have problem with imported files in After Effect, the file resolution in After Effect is different from source file. I am editing an NTSC video file in Edius, the resolution is 720x480-widescreen16:9 and aspect ratio is 1:

  • Strange behavior in HTMLDB

    Greetings, We've been running HTMLDB since 1.5 and are currently at 2.2.1.00.04, but within the last two weeks we have been seeing some very strange behavior. Form submissions or moving from one page to the next in either the Development GUI or withi

  • Can i use windows operating system in e51 in addit...

    E51 has huge 130 mb of phone memory.so can we install additionlly windows mobile operating system in addition to symbian and java.because there are many good softwares in windows which are not available in symbian.

  • WLC 4400 and LAP 1131 radio reset daily at 2 P.M.

    192 Tue Mar 25 14:35:46 2014 AP's Interface:0(802.11b) Operation State Down: Base Radio MAC:00:24:c4:1d:11:10 Cause=Radio interface reset. Status:NA 193 Tue Mar 25 14:35:46 2014 AP's Interface:0(802.11b) Operation State Up: Base Radio MAC:00:24:c4:8f

  • ABAP and J2EE ports

    Dear @all, I had in past two links to check all available ports smply by requesting two urls like http://hostname.domain.de:8000/sap/public/icf_info/icr_groups; but for J2EE and ABAP ports... I'm interested to find out quickly the JMS and MSG Server