How To Block Select Text in Oracle SQL Developer

thatjeffsmith SQL Developer 14 Comments

Tell Others About This Story:

This drove me nuts for a few minutes, so I figure you might need help too. That probably explains why you had to Google ‘Block Select’ and wound up here.

Here is what you want:

Block selection, works with the keyboard and mouse in SQL Developer

There’s No Trick, But You Do Have to Enable It

The default behavior is to do a normal ‘wrapping’ selection of text. You can disable this under the Edit menu.

By default your selections will ‘wrap’

Selecting Text In Action

Now you see it, now you don’t!

Related Posts Plugin for WordPress, Blogger...
Tell Others About This Story:

Comments 14

    1. thatjeffsmith Post
      Author

      Not yet. Have you seen my post on how to setup external editors? You could setup a button to auto-suck your editor text to something like Notepad++, and then when you’re done, update the text back to the SQL Developer worksheet.

  1. Hi Jeff,

    I came to your site after searching for ‘line wrap in sql developer’ on google but appraently the article is on the ‘wrap selection’ which atleast help me to figure that ‘wrap selection’ is not what I am looking for. 🙂

    Basically what I want is fairly simple but somehow I am not able to turn it on.

    What I am trying to do is that when the query in the sql developer goes beyond the visual area then instead of generating a horizontal scrollbar, it should simply wrap the line to next line.

    Now I thought that this should be possible through some option in “tool->prefrences->code editor” but apparently it is not there. I did a little bit of googling but couldn’t find anything. Any thoughts?

    1. thatjeffsmith Post
      Author
  2. On a related note, if I have three SQL’s in a window (like as per your example), do you know if there is any way of running just one of them … without … having to highlight it ?

    Its fine when the SQL’s are 1 line long, but when they get very long … its a pain.

    Cheers
    Connor

    1. thatjeffsmith Post
      Author
      1. Jeff, I’ve never been able to get that functionality to work properly.

        I place the cursor inside the statement i want to run. I don’t select the statement. The statement can be either SQL or PL/SQL. The statement ends with a semi-colon. I hit control-enter. Rather than executing that statement, it tries to run the whole worksheet, and then errors out.

        Am I missing something here?

        1. thatjeffsmith Post
          Author
          1. Hi Jeff,

            I’ve looked a bit deeper, and the issue i’m describing only happens if there’s more than one anonymous pl/sql block.

            So, for example :

            begin
            dbms_output.put_line(‘test1’);
            end;

            begin
            dbms_output.put_line(‘test2’);
            end;

            If I place the cursor in either block and hit control-enter,
            then i get the following error.

            Error report –
            ORA-06550: line 7, column 1:
            PLS-00103: Encountered the symbol “BEGIN”
            06550. 00000 – “line %s, column %s:\n%s”

            Which is basically because it’s attempted to run the whole worksheet, and errored because it’s found more than one begin.

            Would you consider that a bug or expected behaviour?

            Because, yes, the following code does work :

            begin
            dbms_output.put_line(‘test1’);
            end;
            /

            begin
            dbms_output.put_line(‘test2’);
            end;
            /

            The additional slash at the end of each block apparently delineates them so that sql developer recognises them as a separate block. I’d rather do without the slashes – so sqlplus!
            What are your thoughts?

            Paul Stuart

          2. thatjeffsmith Post
            Author

            From the Docs

            SQL*Plus treats PL/SQL subprograms in the same manner as SQL commands, except that a semicolon (;) or a blank line does not terminate and execute a block. Terminate PL/SQL subprograms by entering a period (.) by itself on a new line. You can also terminate and execute a PL/SQL subprogram by entering a slash (/) by itself on a new line.

Leave a Reply

Your email address will not be published. Required fields are marked *