Oracle Developer Script Output - oracle-sqldeveloper

I read the answer earlier pertaining to my problem but it doesn't solve it. If I run a simple query to view a table, the script output would be in real time, it would come in line by line. I had it in a grid format but can't seem to get it back

At the top menu bar of your sql developer you have the first big green arrow "run statement", and next to it a document with a smaller green arrow, "Run script". The "run statement" should produce the grid view, while the "run script" will do the unformatted line by line view.
So sounds like you should be clicking the "run statement" instead, or you could just press "control-enter" on your query.

Related

Oracle sql developer - Auto clean 'script output' on every execution

In the worksheet, each time command is executed, it's output is added to "script output" page.
But the result from last executions is not cleared and it is very confusing.
Is there any way to auto clear all other outputs except the last one (instead clear manually each time)?
I did searched for solution but didn't find anything I can try.
Thanks
Attached the screens after first command and second command
First run:
Second run:
As far as I can tell, there's no such option. If you go to "Preferences" and search the whole list, there's nothing like that in there. Or, at least, I don't know it.
What you could do is to type
clear screen
(or even shorter, cl scr) in Worksheet.
Or, if you type fast and don't make much mistakes, press combination of
Alt + PgDn to navigate to script output
Ctrl + Shift + D to clear contents
Alt + PgUp to return up
Or, simply push the eraser icon in the toolbar.

Oracle SQL Developer does not show the grids in the query result

When executing a query on Oracle SQL Developer the result is text rather than a grid. I'd like it to display a grid, but I do not know how to display them.
That's because you're pressing F5, which is "Run Script" command.
You need to press green triangle at the top, or CTRL+Enter shortcut.

Matlab Run Section not working

I encountered an annoying problem with Matlab 2016b: I cannot run folded code sections separately. More specifically, in Matlab editor buttons "Run and Advance" ans "Run Section" appear grey (unclickable) and Ctrl+Enter to run a code section does not work either.
My script does recognize folded code sections (separated with %%) just fine and I am able to use the "Advance" button to move between folded sections, so it seems the problem is not some syntax error hidden in the code. I am also able to run the script in the usual way with "Run" and even run selected lines of code with F9 command. I would, however, want to avoid using the latter option as "Run Section" and "Run and Advance" options are quite handy and do not require highlighting lines of code.
Any ideas what could cause the problem?
The root of the problem was my auxiliary functions defined within the main script. Since these functions were located in one of the sections, I couldn't call them from other sections separately. The solution was to save auxiliary functions as separate m-files. The following image highlights the problem:

How to make "up"key complete the already typed command from history, not pick any that contains the already typed part?

Until recently, when I typed
x=1;
2*x;
x
into the command window (without pressing enter after x) and pressed the arrow up key, the line was completed with the last command in the history that started with the already typed part, here the first line. Recently, the behavior changed to replacing it with the last command that contains the already typed part, i.e. the second line in the example, without me knowingly changing any setting.
How do I get the old behaviour back? In "Perferences->Keyboard->Shortcuts" (as per this question) the up key is associated with "Cursor up" and "Previous History Command", but the description of the latter is ambiguous regarding the expected behaviour when something is already typed into the command line.
First, make sure that the command history window is docked (If you have a floating window every time you press up then it is not docked. There is a drop-down menu - little circle with a triangle inside. Open the menu and select "Dock").
Once\if the window is docked, open the menu again and make sure that "Match Beginning" is selected and not "Match Anywhere".

(matlab)implement "Evaluate or Open Code You Select" in everywhere? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How do you retrieve the selected text in MATLAB?
I want to implement and add some features to the function "Evaluate Selections", where you can highlight code and then "Evaluate Selections" by right click your mouse (or F9).
In the editor environment, this is how it is done:
editorObject = matlab.desktop.editor.getActive;
eval([editorObject.SelectedText ';']);
How can I implement this from the command line window, or the help window?
EDIT:
Maybe I didn't express my question clearly.
Imagining that we already have this function called eva_select(), I can use function this way:
I wrap the function as the Shortcuts button.
Use mouse to select a variable at command line window, maybe I entered before, say var_a
Then I click that Shortcuts button, the text which I selected before will be executed. This is exactly as press F9 key or choose right mouse menu -- "Evaluate Selections".
But if we really have that function, we can do more! We can modified eva_select() to eva_select_size(), in this way, we can select a variable, say var_a at command line window or help window, click eva_select_size() shortcuts button, then, we will get size(var_a) at command line window!
EDIT:
Thanks, I can retrieve the text in the command window, but I can't do the same thing in the help window, is it possible to do that?
The command window, like other GUI components in the MATLAB desktop, is Java-based. Therefore it can be accessed programmatically, but it is completely undocumented and its use is not officially supported.
Exploring around, here is a solution that seems to work in both R2012a and R2012b. It involves obtaining a handle to the underlying JTextArea of the command window, which is used to get the selected text (to evaluate size of selected variable name)
Create a shortcut with the following code:
x = com.mathworks.mde.cmdwin.XCmdWndView.getInstance();
s = char(x.getSelectedText());
if isvarname(s) && exist(s,'var')
eval( sprintf('size(%s)',s) );
end
Next highlight a variable name in the command window and execute the shortcut. The size will be immediately printed as shown in the screenshot below:
It is not very nice as it is an external solution, but this is how it could work:
Assuming you are in the command window and want to evaluate size(var_a) by selecting it, you can probably do this with a keyboard macro. Defind the appropriate function of var_a
f(x) = eval('size(' x ')'
%This could be done in the macro, but nicer to do it here for easy editing.
Then make sure your macro does this:
Copy 'var_a'
Turn it into 'f(var_a)'
Paste the result
Hit enter
Like i said, it's not pretty, but it should do the trick.