How to execute SQL in the IntelliJ Ultimate SQL Console? - sql

In IntelliJ Ultimate 2017.2, the SQL Console opened from the Database panel lets me enter some SQL.
Unfortunately, when I click the green triangle icon in its upper-left corner, sometimes my SQL executes and sometimes it does not. Sometimes I need to select all the text before hitting the triangle to make it execute, sometimes I do not. Apparently there is some logic or magic trick intended by this tool that escapes me.
➠ How to execute the SQL Console?
The documentation for Database Console says:
Use this icon or shortcut to execute the selected (highlighted) SQL statement or statements.
If nothing is selected, the current statement is executed.
That is not the behavior I see when running on macOS Sierra 10.12.5.

You can control what IDE executes on this action in the Preferences/Settings > Tools > Database > Execute in Console.
You may want to set some of those to the Whole script.

Related

Configure DataGrip to run whole script by default when executing

I'm using the 2020.1 version of DataGrip on a Mac and have connected to BigQuery using the recommended Simba JDBC drivers.
If I try run, either with cmd+Enter or pressing the green play button, code with a CTE I get an error that the CTE can't be found, as below. The issue is that only the last line of code is being executed by default. If I select all the text and then execute it runs fine.
Looking in preferences I see there's options for what gets by default in certain situations. However, even with these set to "Whole script" (and applying and trying restarting) I still get the same issue and still have to select all text to get it to run properly.
Having to press cmd+a before a executing isn't a deal breaker, it's just annoying. Anyone know how to get the whole script to execute by default on a Mac?
You need change settings in the following way:
When inside statement execute to Smallest statement
otherwise execute to Nothing
for selection execute to Exactly as statements

Show executed query in Microsoft SQL Server 2016

In MySQL Workbench, after editing a column, table, or whatever, it will show the query for that action.
I could not find a similar feature in SQL Server 2016. I just want to view the SQL for the action I perform, such as editing a column.
Is it possible?
Something I've always set is Auto generate change scripts which can be found within the options:
This shows the script and prompts you to save it.
If I don't want it so that every time I do a change it prompts me I use the Generate Change Script icon (first icon below):
This is usually greyed out until you make a modification then you can click it. However the annoying thing is you have to click the icon to generate the script prior to saving the modification.
Downloaded SSMS 2016
The icon has slightly changed. In 2016 this is what you are looking for:
You will want to use the first icon on the toolbar above.
There is also a menu that appears called Table Designer. From there you can also generate the change script. This isn't a new feature in 2016 it was something I noticed when looking for the icon.

How to run code from sql file directly from toad oracle

i have a *.sql file on my desktop. How can i create a job in toad for oracle so that it can directly pick up the file and run it everyday at a specific time.
thank you
What version of Toad? If it's a somewhat newer one, check out the Automation Designer. It's available from the Utilities menu.
Create a new app on the left side, give it a meaningful name
On the DB Misc tab double click the Execute Script action to add it to your app.
Double click the new execute script action and add your file to it. Set other options within as desired.
Click Apply and exit the script action properties dialog.
Right click on your script action and choose Schedule. Work through the Windows Task Scheduler prompts and it will be setup for you.
well different version of the TOAD have different options
the best way i would suggest you is - on the button "Execute as script"
Execute as script --> Execute via SQL plus
then the SQL-plus window will pop up and it will auto connect to your DB.
Gather all your sql queries / script in the file and run below command
#C:\Users\Desktop\script.sql
this will start executing the script from file directly and will give the log in the SQL plus window.

Juno IDE for Julia, how to interact?

One way to comfortably use an IDE in an interactive language is to interact via the IDE in a command line environment. I am wondering if that is a possibility in Juno. In other words, is there a command line environment as in Matlab, to call functions, give initial values, and run expressions. If so what is the way to access it?
Note: There is a console window in Juno, but I can't find a way to insert my commands inside that.
Note: The question and this answer apply to the version of Juno that was based on LightTable. The current version is based on Atom and has an interactive console.
You can't enter commands into the console in Juno--that's for displaying output. Commands can be submitted from within the editor by setting your cursor in the line to submit and pressing Ctrl+Enter or Shift+Enter. The value will then be displayed in a small popup next to the line and the output will be printed to the console if you have the console visible.
Note that the inability to use the console as you desire is by design. See here for information about the console from the Juno docs.

SMSS IDE: Addon to colour tab or background by server?

I haven't been able to find anything that can colour the background and/or add a tab bar to the SMMS IDE to better identify the difference between prod, test and dev servers. SMSS Tools appears to be the only plugin trying to do this but I'm yet to see it work (appears to be a common problem based on my searches).
Just wondering if anybody knows of an addon (paid or free) that accomplishes this?
All version of SSMS since at least SQL Server 2008 R2 (and I think 2008) include a built-in ability to change the colour of the connection bar at the bottom of a query window - when setting up a new connection for a query, click the Options >> button, then set the colour by ticking use custom colour (then selecting your chosen colour) on the Connection Properties tab.
I've had SSMS Tools Pack connection colouring working but I prefer the built-in option.
EDIT
I just tried SSMS Tools pack colouring again, and I agree it appears not to be working in the current verion (2.1.0) in SSMS 2008 R2.