Getting Warning Message when running SQL script on IBM DB2 - db2

I'm using IBM DB2 on cloud and selected Run SQL to create a script. After creating the script, I obtain the following warning message and I'm not able to see any results:
*Commands Running:
SQL commands are currently running. You can wait or cancel the current commands to run commands again.

You should only get that message when a query is running in the console from the Run SQL page.
If you can't see a query running in the console which you can cancel, then that might indicate an issue with the console (maybe clear your cookies and re-login, or raise a support case if you are on a paid plan).
You should also be able to open a new tab and run a 2nd query.

Related

postgreSQL online shell

I have installed postgreSQL multiple times because I did not know better in the past, and now I am having trouble running SQL shell (psql) on my desktop.
It would not let me log in, would not tell me all the versions that I have installed, would not let me change supervisor user.
However, I really need to find a way to run my SQL commands and output script style result (like the analog format you would get on SQL shell) in order to complete my homework.
I have already checked the results of my commands on pgadmin 4 on my browser, so I just have to run it and get script style output.
Do any of you know an online SQL shell that I can use?
Thank you.

ERROR: cannot execute SELECT in a read-only transaction when connecting to DB

When trying to connect to my Amazon PostgreSQL DB, I get the above error. With pgAdmin, I get "error saving properties".
I don't see why to connect to a server, I would do any write actions?
There are several reasons why you can get this error:
The PostgreSQL cluster is in recovery (or is a streaming replication standby). You can find out if that is the case by running
SELECT pg_is_in_recovery();
The parameter default_transaction_read_only is set to on. Diagnose with
SHOW default_transaction_read_only;
The current transaction has been started with
START TRANSACTION READ ONLY;
You can find out if that is the case using the undocumented parameter
SHOW transaction_read_only;
If you understand that, but still wonder why you are getting this error, since you are not aware that you attempted any data modifications, it would mean that the application that you use to connect tries to modify something (but pgAdmin shouldn't do that).
In that case, look into the log file to find out what statement causes the error.
This was a bug which is now fixed, Fix will be available in next release.
https://redmine.postgresql.org/issues/3973
If you want to try then you can use Nightly build and check: https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2019-02-17/

Stop script in MySQL Workbench after error

I just ran a script in MySQL Workbench 6.3 Community.
I've set it to 'Stop Script Execution on Errors'.
There were two queries that gave errors.
The errors say 'Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect.'
Ok, so I missed that. No big deal.
But after that, the script simply continued as if there were no error at all, or as if I never set 'Stop Script Execution on Errors'.
As a consequence I've lost some data. (This was a test database, so no worries there.)
The script continues after the errors:
Any idea how to make it stop executing the script?
A colleague pointed me to Edit->Preferences, SQL Editor, SQL Execution, Continue SQL script execution on errors (by default).
Continue SQL script execution on errors (by default)
This worked after restarting Workbench.

using executable in Liquibase changesets

I am using execute command tag from my liquibase changesets and this inturn is configured to run the sqls in oracle instant client sql plus.
when i run a liquibase update on my changelogxml everything works fine and the liquibase update is sucessfull.I can see the changes to the table also.
But when i try to fail the update process by giving a syntax error in my sql file refered in the changeset.Liquibase still returns liquibase update sucessfull.I expected it to throw sql errors.The sql when run seperately in toad throws syntax error.What should i do to get the error displayed out.?
Datical has created a custom Liquibase change tag that executes SQL using the sqlplus command line client. It was surprisingly much more complicated that you might think.
Some of the issues we had to deal with:
we had to do things to ensure that the sql files always had certain statements in place, and never had certain other statements. This might include things like setting the schema, ensuring that the only spool commands were ones we knew about, that the script had an 'EXIT' command, and ensuring that whenever there was a SQL error that the exit code was returned.
The sqlplus executable does not return an exit code (i.e. a non-zero exit code form the native process) in all cases, and instead will write errors to an error table in the database. The table where sqlplus writes errors is called sperrorlog, and this may be what you will need to look into.
I can't really go into all the details, but just know that what you are attempting to do is neither simple nor straightforward.

protocol adapter error with sqlplus

I am trying to connect my Oracle Database 10g Express Edition with sql*plus. when i start the sql*plus command window the following error occurs.
could you please show me the way of avoiding this error.
As per the 2nd result from a Google search on the error message:
Typically this will result from
not having ORACLE_SID properly set. Especially so on Windows.
not having the db service started. See the windows services applet, services.msc
https://community.oracle.com/thread/2425280