"Order By" in Exists / condition not exist cause ORA-00907 in Apex4.1.1

Hi guys,.
We have just improved Apex 3.2.1 to 4.1.1. on Oracle DB V11.2.0.1, while testing the apps in the apex, I encountered this problem.

When I have a page of the process with a defined condition.
What Type of Condition is Exists (SQL query returns at least one row) or it does not exist (SQL query returns no line) and the Expression 1 is a query with an "Order By" clause, for example
SELECT 123 DOUBLE
ORDER BY 1

When the process starts, Apex 3.2.1 assess the State and run the process very well, but the Apex 4.1.1 would throw an error: ORA-00907: lack the right parenthesis

I understand that as an order of the clause in a condition Exists or it does not exist is not necessary and agree that they shouldn't be there in the first place.
But unfortunately I'm dealing with other codes to developers, and these conditions were coded like that, probably from copy - paste the codes.

Saying that, I also think that an upgrade of the Apex should not stop anything that works in previous versions without warning or provide a workaround solution, right?

I don't know if this affects other types of artifacts that may have a condition by their Summit when upgraded to 3.2.1 e.g. areas, Items, calculations, Validations etc.
Does anyone else get this behavior? and there at - it an easy way to fix these?
Ideally I won't go through all the processes (and some other artifacts might be affected too) in all applications in all areas of work to verify the condition type and manually remove the "Order By" clause.

Thank you for advising them

Just did some tests more

'Calculation', 'Validation', 'Process' and 'Branches' have the same problem, 3.2.1 takes 'Order By' fine condition Exists/Not Exists, but 4.1.1 throws the error message.

"The regions", "Buttons", "Items" have the constant behavior - 3.2.1 both 4.1.1 throw error ORA-00907: lack the closing parenthesis, what page is rendered.

Published by: Danny on 04/25/2012 20:07

Hey Danny,

It's interesting. I just had a peek at what happens when you use an EXISTS or NOT EXISTS condition type. The following SQL statement final will be generated with your example above. You can also see that if you run your application in debug mode.

select count(*) from sys.dual where exists (select 123 from dual order by 1)

The execution of this statement within SQL * Plus will also see the error ORA-00907. It seems that the SQL parser does not have an order by clause in a clause EXIST.

I wonder why this should have worked in previous versions, but I can only suspect that in the past we can just running

select 123 from dual order by 1

which may be a little slower, because with the new engine EXISTS SQL statement may stop treatment earlier if it finds a record.
We try to be backwards compatible, as much as possible, but I doubt that we will change the way it was before due to the alteration of performance would be faced with 99.9% of our customers.

Possible workaround: you might be able to use the new "search request" to analyze your application "to" fix for all the shots where the attribute name is "Expression 1".

Concerning
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf

Tags: Database

Similar Questions

  • Change the order of the columns does not cause any data found error report

    Hello. I have a weird problem (and I'm new to APEX). I have a subregion of report that shows the details of a master record based on the ID of the parent area. When I have everything first to change SQL for the query and apply the changes page works fine. When I go back and change the region > attributes report and use the arrows to change the order of the columns the region then returns:

    error report:
    ORA-01403: no data found

    I tried to change the query so that the columns found in the desired order and who has also not returned no data error. If I go back to my original query (which had 2 fewer columns) the page works again. Then I change to the new query (2 addtl columns), and then it works again, until I have change the order of the columns again. Don't know if it would be serious or not, but one of the columns is a 2 columns of the table concat.

    Any ideas would be appreciated, because I'm out of them.

    Thank you!

    use: Apex 4.0
    DB: 10g Exp

    "807428," Hi

    using 4.0 or 4.0.1? Can you reproduce the same problem on apex.oracle.com as well?

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Order to restore (Ctrl-Y) not working anymore in CC of Dreamweaver

    Order to restore (Ctrl-Y) not working anymore in CC of Dreamweaver.  I'm on Windows 10.  I loaded my own set of keyboard shortcuts.  Menu command (Edit > Redo) is predefined for Ctrl-Y and Ctrl-Shift-Z but no shortcuts work.  Other similar commands such as Ctrl-Z (undo) works, but not do it again.  Redo is one of the most common commands that I use.  Please help me.

    -Masato

    Just pulled up the old versions and, CBWMS and CC 2014, it worked as explained in the OP, while nothing happens in CC2015.

    @masatok,

    Drop an official bug would probably be the way to go: feature request/Bug Report Form

  • SRA order "matrices of discovery has not not" adv0408 file not found in VMware Site Recovery Manager.

    Hi all

    Can we add several table managers at sites in VMware SRM?

    How to record several managers of the group a table copy in SRA?

    "When I try to add new array manager of second table at one site I get the error message" SRA order "matrices of discovery has not not" adv0408 file not found in VMware Site recovery manager.

    Versions: VMware SRM 5.5

    Cruiser storage: Fujitsu Eternus SF v16.1, SRA 2.3

    Thanks in advance,

    RAMU Reddy

    [email protected]

    Thanks Stefan,

    I contacted my storage team. It was with License Manager (ACM) advanced copy number. After license ACM registry in SRA Database of SRM server, everything was fine and I was able to protect all remaining VM.

    Best regards

    RAMU Reddy

  • "Cannot complete order because the extension could not be loaded." with the sample CEP5

    Hello

    I have trouble with my extension porting to CEP5. I get the error message "Cannot finish order because the extension could not be loaded." when I open the Panel.

    Is it possible to get more information about what happened and why? My post was properly signed zxp and managed Extension installed without problem.

    Also, to debug the problem, I tried to open the Test HTML CEP Extension - https://github.com/Adobe-CEP/Samples/tree/master/CEP_HTML_Test_Extension_5.0

    I copied on '~/Library/Application Support/Adobe/CEP/extensions/com.adobe.CEPHTMLTEST ", created .debug inside (https://gist.github.com/m6k/39a49786b7a85a9e312b), empty the file inside Photoshop CC 2014.app .debug (to remove the verification of the signature). When I open Photoshop CC 2014, I see test listed in menu extension panels, but when I try to open them, I also get the error "cannot complete order because the extension could not be loaded.".


    No reference to what I'm doing wrong and what I can do to debug this problem?


    Jan

    Please read this: Adobe Extension Builder and Creative Cloud 2014

  • order by desc rDate does not work

    Hello

    order by desc rDate does not work in my query
    select cv_id,to_char(rDate,'Month dd, yyyy') from jobResponses  
    where job_id=35 and (responseStatus=1 OR responseStatus=2) order by rDate desc
    
    March     03, 2012
    
    March     03, 2012
    
    March     04, 0012
    Thanks to anitcipation

    Christy H. wrote:

    order by desc rDate does not work in my query

    Well, it works fine. Year last rDate is 0012, thats why he is the last. It seems that the table data was not loaded properly and you ended up having rows with year 12 instead of 2012. Check the data in the table.

    SY.

  • root.sh failed with the CRS-2800: could not start the 'ora.ctssd' resource as it is

    Cannot start the "ora.ctssd" resource as it is already in the INTERMEDIATE State.

    I tried to install two-node RAC on linux REDHAT, I met because of errors:

    Beginning of the resource 'ora.crsd' failed
    CRS-2800: could not start the 'ora.ctssd' resource as it is already in the State INTERMEDIARY on the server
    CRS-4000: Start command has failed, or completed with errors.
    Exclusive mode Clusterware ready beginning of Clusterware Services failed to 6475 /u01/app/11.2.0/grid/crs/install/crsconfig_lib.pm line.
    /U01/app/11.2.0/grid/Perl/bin/perl-I/U01/app/11.2.0/grid/Perl/lib-I/U01/app/11.2.0/grid/CRS/install /u01/app/11.2.0/grid/crs/install/rootcrs.pl execution failed


    How to solve this problem?

    runCluvfy has been correctly executed.

    I discovered on the second node (oracle02), there is no any daemon running. But on the local installation (oracle01) node:
    [[email protected] bin] #. / stat crsctl res-t--init
    --------------------------------------------------------------------------------
    TARGET STATE SERVER STATE_DETAILS NAME
    --------------------------------------------------------------------------------
    Cluster resources
    --------------------------------------------------------------------------------
    ORA.asm
    1 road to oracle01 online
    ORA.cluster_interconnect.haip
    1 oracle01 online
    ORA. FIU
    1 OFFLINE IN OFFLINE MODE
    ORA.crsd
    1 ONLINE OFFLINE
    ORA. CSSD
    1 oracle01 online
    ORA.cssdmonitor
    1 oracle01 online
    ORA.ctssd
    1 LINE intermediate oracle01 bad check return.
    ORA. DiskMon
    1 oracle01 online
    ORA.drivers.ACFS
    1 oracle01 online
    ORA.evmd
    1 OFFLINE IN OFFLINE MODE
    ORA.gipcd
    1 oracle01 online
    ORA.gpnpd
    1 oracle01 online
    ORA.mdnsd
    1 oracle01 online
    [[email protected] bin] #.


    How to make the next step? What is the difficulty so that my installation is successful.

    Thanks in advance.

    Hi Angelina,.

    I got this error when I tried to install Oracle RAC on VMware with unassigned shared disk. When I attributed it which fixed the problem.

    Kind regards
    Gennady

  • Run DBMS_SQLTUNE as a user not sys, getting ORA-13774

    Hello
    I am trying to run DBMS_SQLTUNE as a user not sys and
    ORA-13774: not sufficient privileges to select data in the repository of the workload
    ORA-06512: at "SYS." DBMS_SYS_ERROR', line 79
    ORA-06512: at "SYS." PRVT_SQLADV_INFRA', line 240
    ORA-06512: at "SYS." DBMS_SQLTUNE', line 542
    ORA-06512: at line 4 level

    I grant all on

    SYS. DBA_HIST_BASELINE
    SYS. DBA_HIST_SQLTEXT
    SYS. DBA_HIST_SQLSTAT
    SYS. DBA_HIST_SQLBIND
    SYS. DBA_HIST_OPTIMIZER_ENV
    SYS. DBA_HIST_SNAPSHOT

    but still get the error.
    Anyone can share a thought?
    Thank you
    Anatoliy

    Handle: asmirnov
    Status level: Beginner
    Join date: January 10, 2001
    Messages total: 327
    Total Questions: 79 (47 pending)
    many questions and so few answers.
    :-(

    It works for me.

    SQL> !cat hr-privs.sql
    grant select on sys.DBA_HIST_BASELINE  to hr;
    grant select on sys.DBA_HIST_SQLTEXT to hr;
    grant select on sys.DBA_HIST_SQLSTAT to hr;
    grant select on sys.DBA_HIST_SQLBIND to hr;
    grant select on sys.DBA_HIST_OPTIMIZER_ENV to hr;
    grant select on sys.DBA_HIST_SNAPSHOT to hr;
    GRANT ADVISOR TO HR;
    
    SQL> show user
    USER is "SYS"
    SQL> connect hr/oracle
    Connected.
    SQL> @tt
    
    PL/SQL procedure successfully completed.
    
    SQL> BEGIN
    dbms_sqltune.execute_tuning_task (task_name => 'vega_tuning_task');
    END;
    /  2    3    4  
    
    PL/SQL procedure successfully completed.
    

    http://www.orafaq.com/node/1837

  • BeginDDL causes ora-00942 table or view does not exist

    Hello!

    When an I try to add a new column to a table of activated version, the beginddl fails with ora-00942, said that the table does not exist. It is really strange because I did a lot of changes this before on this table. Now, no tables enabled version can be altered, beginddl always returns with 00942. I checked the ALL_WM_VERSIONED_TABLES, all my active verison paintings are there. The schema WM_ADMIN_ROLE and CREATE TABLE has privileges to access any version (view) table. Also got the synonyms.
    The last successful change with beginddl happened two weeks ago. My guess is that something in the environment has changed, because it is a global problem. Don't know what else to deal with, and the other people who might have modified the system are on holyday unfortunately. Help, please!

    Kind regards
    Viktor

    Hi Victor,

    Appears not to be a bug. The comment in the description of the trigger definition part is not expected. So, the schema name is added bad table name. It would have worked if the comment came after the description of the real. In addition, it affects the two types of comments.

    If you need a fix for 11.1.0.7, I suggest filing a SR.

    Kind regards
    Ben

  • spooler printing error 1297 in order to function properly does not exist.

    missing Printer Spooler vista

    Here's a thread on this problem.  Read the whole thing - not only the answers because valid responses are not marked as answers (because they came much later than the first reactions and perhaps even better than the initial responses that seem generic enough). http://social.technet.microsoft.com/forums/en-US/itprovistaprinting/thread/cad5221a-d21b-4bf0-8e86-cacae254cb52/.

    If this does not work, here is another thread with other responses and recommendations about this problem: http://social.technet.microsoft.com/forums/en-US/itprovistaprinting/thread/391f3c57-5d2b-4e88-adc6-190429a7fdbe/.

    I hope that one of the options presented in one of these two threads will try to solve your problem.

    I hope this helps.

    Good luck! Lorien - MCSA/MCSE/network + / A +.

  • parameter test conditions not

    I'm converting some infiltration in PL/SQL operations and I have a situation where
    based on the results (i.e. the returned rows) I run different code.

    So I have a v_file_name_found parameter which is set locally to the procedure.
    The procedure is placed in a file name and I search for it...
    If found I then assign it to the v_file_name_found, if
    where clause has been reached. If I get 0 rows back, I A, if I get lines > 0 then I do B.

    In oracle that I have to assign the v_file_name because everything I do is test the
    where clause conditions?

    Here is the code of the entry with a handful of oraclese that I added to the conversion...
    create or replace procedure   msg_read  (file_name in char)
    user authid
    
    v_file_name_found    char;
    
    Begin
    
     select a.file_name into v_file_name_found 
      from table One A, Table Two B
    where a.file_name = b.file_name and
    a.vol_id = vol_id;
    
    if sqlcode <> 0  then  ... do something  AAA 
    
    else
    
    if iirowcound = 0  then   do BBB 
    
    end;
    /
    Thank you for your understanding.

    Published by: BluShadow on May 16, 2011 15:11
    addition of {noformat}
    {noformat} tags and fixed the <> symbols that don't appear together on the forum.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Hello

    What you have is a good way to do it in Oracle.
    You must SELECT IN something, if you need a variable. If all you really want to know is whether the query found something, or not, then you can do something like this:

    CREATE OR REPLACE PROCEDURE msg_read (in_file_name IN VARCHAR2)
    AUTHID CURRENT_USER
    IS
    
         v_file_name_found     a.file_name%TYPE;
    
    BEGIN
        BEGIN
                SELECT     a.file_name
         INTO     v_file_name_found
         FROM     table_One A
         ,     Table_Two B
         WHERE     a.file_name     = b.file_name
         AND     a.vol_id          = vol_id
         AND     ROWNUM          = 1;
    
         -- Do AAA
         ...
    
        EXCEPTION
            WHEN  NO_DATA_FOUND
         THEN
             -- Do BBB
             ...
        END;    -- End of nested BEGIN block
    
        -- The following code is done in all cases (unless a real error occurred) after AAA or BBB
        ...
    END     msg_read;
    

    where catch you the error that occurs when the query returns 0 rows. However, you must always SELECT a variable, so in this case, I don't think that thie approach wins above whatever it is for you. Keep doing it the way that you thought of.

    I have not tested the code above, but I know that it is closer to the correct Oracle syntax.

    Do not use the CHAR data type. Use VARCHAR2 or, if you want to specify that a variable local is the same type and size as a column of data, using % TYPE, as I did above.

    If the filename is the name of a column, you must choose a different name for the parameter, such as file_name_given or in_file_name. This is not necessarily a mistake to use the same name, but it can be confusing.

    If a SELECT INTO statement detects more than 1 row, it triggers the TOO_MANY_ROWS error. You could test for it in the section of the EXCEPTION to a nested block, but it is easier to avoid it completely by
    (a) using ROWNUM = 1, as shown above
    (b) to rewrite the query to use aggregate functions (but no GROUP BY), or
    (c) re-writng the query as an EXISTS subquery, as in "Double WHERE EXISTS SELECT 1 (...)"

    Published by: Frank Kulash, May 16, 2011 10:18

  • Pre-order only charged credit card not?

    I pre-ordered my iphone 7 more than 128 GB black at launch on apple.com. The order went through, and I received a confirmation email. BUT my credit card was not charged that there is not even an amount pending... Is this normal? Apple expects to charge the card until the delivered phone? If someone used a CC to order let me know if they hit your card. Thank you

    Yes, it's like that in general. My CC has not yet been charged too much. Don't worry - your CC will be charged and your iPhone will happen before or at the time (the only time wherever my iPhone was delayed was due to a weather condition)

  • Thunderbird "does not" publish CAUSE: unknown

    Hey guys and girls I have a problem with Thunderbird 38.3.0 and he began recently.
    I did not use thunder bird in a day or two and now whenever I open it, it works for maybe 5 seconds and then freezer and I get message "Thunderbird is not responding.

    Now I have not had the major updates of the software, but I'll tell you what I did to help out.

    First of all, I have disabled all security software 'Malwarebytes and Kaspersky Pure 3' tried Thunderbird and it did not work as it freezes again.
    Then I was able to quickly start Thunderbird and click option to restart in safe mode, before it froze, but even in safe mode it freezes within 5 seconds.
    I used msconfig and did a selective startup with what I was able to turn off and then ran Thunderbird.
    But the problem still exists, and everytime I run Thunderbird it freezes and I get the message "" Thunderbird is not responding".

    Thunderbird works a day or two before so I don't know what the heck is with her or how to fix it.
    Does anyone have an idea on how to fix to get it working again?

    If I open it I can click on the menu or message within five seconds before it crashes to the top / freezes.

    Is it possible to return to the latest version of Thunderbird to see if it's a version issue?

    Any help would be greatly appreciated.

    I point out that I don't update Kaspersky to a version more recent that the newer versions in conflict with several of my programs that's why I use Kaspersky Pure 3 again.
    I am also running Windows 8.1 64 bit if that matters.

    Help, please.
    Thanks in advance
    Gren

    Hey guys and girls,

    OK, here's an update after spending hours on this issue, that I ended up restoring Thunderbird accounts to an old backup of 5 months ago.

    Since I don't have that Thunderbird seems to work very well once again, you it is always downloading 5 months emails.

    I guess I learned my lesson that must the backup mail every week or two, just in case things like above occurs.

    Thanks for all the help.
    Gren

  • Totally freezes my PC "(ne répond pas) ' in the title bar, but not the CAUSE of Mac: Trend Micro antivirus"

    I used Thunderbird probably for as long as it exists, and I've never found an another e-mail client that I like better or even as well. But it crashes on my PC. It started a few years ago and I thought it was my computer (desktop computer). Then he started on my laptop. I was wondering if the problem occurred after an update, but could not target the exact date to try to link it to an update. 2 years ago, I added a Mac Air to my computers, Thunderbird installed and it worked without a hitch... e-mail accounts, same settings, same everything. It gets so bad on my PC it freezes everything on the computer and I have to walk away until it thaws, then I go to online access to my email accounts... that I don't like.

    Why OK on Mac, but not PC?

    I am back. I had a 'little' time with TrendMicro support over a few days. In the end, their suggestion was to add Thunderbird to the list of Exceptions. I did tonight and, so far, TB seems to work OK. During the next day, I'll see if it continues and post it here with the results.

    It is easy to add to the exceptions list. Here is the link I received technical support.
    http://eSupport.trendmicro.com/en-us/home/pages/technical-support/1059964.aspx

    Basically you just open the main console, click settings (the gear icon), then lists the Exceptions, programs/folders, click Add, then access Thunderbird.exe and add it.

    I hope that this is the case. I'll let you know in a few days.

    PK (Angelmutt)

  • EXISTS, and ORA-01476: divisor is equal to zero

    Hello

    Who can explain, what is?

    SQL> select 1 from dual where exists (select 1 / 0 from dual);
             1
    ----------
             1
    
    SQL> select * from v$version;
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0    Production
    TNS for HPUX: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    
    SQL> 
    

    Ok... I know that the condition EXISTS, expression in the inner query don't cheking but if inner query returns error why external query returns a line? ))))

    ----

    Ramin Hashimzade

    The query is rewritten by the CBO:

    SQL > set autotrace traceonly explain

    SQL > select 1 in double where exists (select 1 / 0 double);

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 1685426719

    -----------------------------------------------------------------

    | ID | Operation | Name | Lines | Cost (% CPU). Time |

    -----------------------------------------------------------------

    |   0 | SELECT STATEMENT |      |     1.     4 (0) | 00:00:01 |

    |*  1 |  FILTER |      |       |            |          |

    |   2.   QUICK DOUBLE |      |     1.     2 (0) | 00:00:01 |

    |   3.   QUICK DOUBLE |      |     1.     2 (0) | 00:00:01 |

    -----------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 Filter (EXISTS (SELECT 'SYS' 0.)) (("'" 'DOUBLE'))

Maybe you are looking for

  • What should I do if the pirate iPhone occurred?

    Community salvation.  I was looking at on Safari yesterday afternoon and I received an alert in red text to talk about a virus threat.  I was just expedition through the pages of an apartment, registration, a site that I have often used on my compute

  • iPad pro does not accept files in Macbook Pro Os10.6.8

    I can pair it with the success of the ipad pro with my macbook Pro at tleast, they say they see. When I try to send files of Macbook, I've only tried .jps far, a message appears in the dialog on the macbook, device does not required services. Don't k

  • Satellite L555-11 q - crazy keyboard

    Hello I have the following problem: After a while my keyboard won't any more correctly. The keyboard forget the letter or written twice and three times over.If I bring the laptop and the battery to take and then reintroduced, so everything is. After

  • WIFI does not work after installing WIN7 to HP Pavilion DV1000

    I hope you can help! After the complete collapse of the old WinXp I installed Win7 - mostly away from the ti works. However, WIFI does not work. (P/N is PY869PA #ABG, he also says dv1303ap on the label) Is there a driver for the available WLAN? Witou

  • Problems installing the three windows updates KB2698035, KB2761226, KB2727528, error Code: 0x8007F0DA

    I ran Windows repair , but the problem persists. some high priority updates do not install automactically or manually in detail below. Update for Windows XP (KB2761226) security Error Code: 0x8007F0DA  Security Update for Microsoft .NET Framework 1.0