Navicat Merge Command, terminator dropped - sql

Using Navicat, I am running an SQL Merge Command, Navicat seems to drop off the ; from the end of the command, causing it to fail.
I can't find a way to change the terminator character to something like #.

well, I kinda gave up on it. :-) I just put it in a Stored Procedure - works fine, but I was hoping to find a "query" fix.

Related

SQL command works only after manual change

I'm not a DB person but something weird is happening in Access:
I'm trying to run this SQL command: UPDATE tbl_DirectorySet SET TempRootDir='D';
on this table:
It doesn't do anything! I mean the field is empty as before.
If I manually set the field with some value like "aaaaa", then after I run the SQL command I can see that the command worked as expected.
If you don't have any record in a cell, the UPDATE command won't work. Use INSERT instead. That's why it works when you first introduce "aaaaa" and then you UPDATE.
EDIT: this link may make you understand better the principles behind the basic SQL commands: https://en.wikipedia.org/wiki/Create,_read,_update_and_delete

Oracle SQL Developer - Ctrl+Enter runs whole worksheet instead of current line

I am using Oracle SQL Developer 4.0.3.16, and since a few weeks, the shortcut Ctrl+Enter doesn't execute the current line or statement anymore, except for when I highlight it, but instead does run my whole worksheet. Using the green button on the top, which is supposed to only run the current line results in the same behaviour (except for when the line is highlighted). Hovering over the button still reveals the tooltip "Run Statement (Ctrl+Enter)". A colleague of mine does get this problem too.
I also looked into the Preferences->Shortcut Keys menu, but the shortcut set for running a statement is still Ctrl+Enter.
Anyone knows what's wrong with my SQL Developer?
Every SQL statement in SQL Developer should have semicolon ; otherwise ctrl+Enter would execute will execute entire worksheet.
Suppose for example I have two SQL statements:
1.select * from emp without semicolon ;
2.UPDATE EMP SET DEPT_ID=10; WITH SEMICOLON ;
Then it will execute both statement simultaneously for that you should have semicolon after each SQL statement.
I faced it too. Usually you'll have PL/SQL block above the SQL code you are trying to execute. Comment out the PL/SQL block which is DECLARE, BEGIN without ending in semicolon creating this issue. So commenting the PL/SQL block in worksheet should solve your issue.
Thanks to the answer here: if it doesn't work even with a semicolon after the line like it didn't for me (Oracle SQL Developer 3.2.20.10), you need to put a '/' after each command if you want to execute them all independently, e.g.:
blahblah;
/
blahblah;
/
Think of the '/' as the real terminator/separator here.
I think I kinda solved it.
Since I'm not an administrator on the computers at work I couldn't install a new client, so I downloaded the SQL Developer in version 4.0.3.16 a while ago and just ran it locally from my user directory.
Meanwhile the client 4.0.3.16 is installed on the OS and when using this client I don't get this bug.
Thanks for the help though.

I can connect on Postgresql Database but queries give no results

I've a Postgresql database on my server and I would like to use it for a simple web-app on localhost. I've set the Database to allow my connections ecc.. In fact, my web-app can connect to the DB... But all the queries give no result in local. (That's funny because all the queries work great on the server.
Can you help me?
The first thing to do is this:
Login via psql, and run the following query (note the terminating semicolon):
SELECT version();
If that works, check to make sure you are terminating the queries with semicolons.
If that doesn't work, please copy/paste the complete output of psql (including prompts and greetings) here.
As a note, the psql prompt is very informative. The most important character for this purpose is the second from the right. That starts out as =, but changes to - if it is a continuation of a new line, ' if there is an unterminated single quote, " if there is an unterminated double quote, etc.

sp_notify_operator: The specified #operator_name does not exist (but it does!)

OK, so I think I'm going mad here! Here's where I am.
SQL Server 2008: I've set up Database Mail, and I've sent myself a test email. Simple, works fine.
I've created an operator, called 'Tom'. I've given it an email address (but nothing else).
However, when I run this command:
EXECUTE msdb.dbo.sp_notify_operator #name=N'Tom',#subject=N'Test Database Message',#body=N'Testy Test Test'
...I get this:
Msg 14262, Level 16, State 1, Procedure sp_verify_operator_identifiers, Line 51
The specified #operator_name ('Tom') does not exist.
Is that error message masking something else which I should be looking at? There's definately an operator shown in SSMS, but if there's a sproc which lists operators I'll happily run that to see if it's actually there.
I'm just kinda stuck as to where to go next. SQL Server seems convinced I don't exist!
Ignore this! There's a possibility that I was trying to execute sp_notify_operator whilst connected to the wrong server...the one without any operators....
Apologies!

Export MySQL Data as Insert Statements

I'm working in Ubuntu with MySql and I also have Query Browser and Administrator installed, I'm not afraid of the command line either if it helps.
I want simply to be able to run a query and see a result set but then convert that result set into a series of commands that could be used to create the same rows in a table of an identical schema.
I hope the question makes sense, it's quite a simple problem and one that must have been solved but I can't for the life of me work out where this kind of conversion is made available.
Thanks in advance,
Gav
I think you need to use a command line utility mysqldump http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
if you want to dump one or more tables.
If you need to dump a result of an arbitrary query and restore it later, take a look on SELECT ... INTO OUTFILE and LOAD DATA INFILE( http://dev.mysql.com/doc/refman/5.0/en/load-data.html)
I do not know if I understood you at all but you can use a SELECT INTO statement.
SELECT *
INTO new_table_name
FROM old_tablename
WHERE ...