4 Replies Latest reply on Jul 11, 2016 5:19 PM by Gary Graham-Oracle

    Strange behavior of sql developer ?

    98824883-912a-4064-b8c5-7c4514d8270e

      Hi,

       

      I have a query regarding the strange behavior as listed.

      SQL1.PNG

      It happens when only when i write A or C after semicolon of my statement. But if I use any other letter beside A or C it gives me error as listed.

      SQL2.PNG

      Can anybody suggest me whats the reason for this unexpected as well as strange behavior.

       

      Thanks.

        • 1. Re: Strange behavior of sql developer ?
          AndrewSayer

          In the first screenshot you have the line highlighted, in the second you only have the line after selected.

           

          Does it really matter? You shouldn't have anything after the semicolon on the same line.

          • 2. Re: Strange behavior of sql developer ?
            Saubhik

            Yes, you are write. If you run select * from dual;a it will not give an error and if you run select * from dual;b or for that matter other NON keywords (in this case letter!) it will give you an error.

            select * from v$reserved_words where keyword='A'; will show you what I am talking about.

            Similarly select * from dual;I / select * from dual;H will not give you an error. select * from v$reserved_words where length(keyword)=1;

            • 3. Re: Strange behavior of sql developer ?
              jgarry

              When I run a; by itself in sqldeveloper, it tells me it ran a system file.  In sqlplus, it tells me "nothing to append."  As noted, it is a reserved word, and b; is not a command.

              • 4. Re: Strange behavior of sql developer ?
                Gary Graham-Oracle

                One might think this anomaly is new behavior introduced in 4.1 by the SQLcl command line beta, but the Worksheet functions the same way in 4.0.

                 

                Comparing SQL*Plus and SQLcl in terms of the commands used to edit the SQL buffer, Append and Change, we see

                SQL*Plus: Release 12.1.0.2.0 Production on Mon Jul 11 09:44:29 2016

                Copyright (c) 1982, 2014, Oracle.  All rights reserved.

                Connected to:

                Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

                SQL> A

                SP2-0004: Nothing to append.

                SQL> C

                SP2-0024: Nothing to change.

                SQL>

                versus...

                SQLcl: Release 4.2.0.16.112.0616 RC on Mon Jul 11 09:46:26 2016

                Copyright (c) 1982, 2016, Oracle.  All rights reserved.

                Connected to:

                Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

                SQL> a

                SP2-0004: Nothing to append.

                SQL> c

                SP2-0025: Invalid change string.

                SQL>

                But looking at the 4.0.3 Help for the Worksheet, Append and Change are in the list of unsupported command and are silently ignored...

                WorksheetSQLPllusHelp.jpg