Is there any way/Extension to enable the feature where a cursor is pointed to some column in a insert query it highlights the corresponding value in the VALUES fields? its available in PL/SQL Developer(attached image). Wonder if its there in SQL Developer
Related
The command line shell for SQLite3 has the edit() SQL function which opens an editor of your choice in order to INSERT or UPDATE fields. You can directly use this inside a SQL statement.
Is there an equivalent function for PostgreSQL's psql? Or what would be the canonical way to update/insert only the value of a column in an external editor? I do not want to edit the compound SQL statement in the editor but concentrate on the field content only.
I know that in Oracle we can do something like select * from TABLE(DBMS_XPLAN.DISPLAY_CURSOR('$$SQL_ID')). But there is no sql id field in pg_cursors catalog. We have only declaration text. And in general it's not Oracle. So, are there any ways to get a table name of an opened cursor in postgreSQL, besides parsing a sql statement(pg_cursors.statement)?
In an table myTable in Oracle. I got many rows and I simply wanna create a duplicate of just one row nROW? Is there a way to to it graphically through SQLDeveloper GUI?
Highlight the row in SQL Developer, right click, and select "Duplicate Row"
I am using SQL Developer version 17.2.0.188. I believe this has been available for some time in older versions.
In SQL Server 2005, I built a trigger that contains a SQL statement that unpivot's some data. Somewhat similar to the following simple example: http://sqlfiddle.com/#!3/cdc1b/1/0. Let's say that the table the trigger is built on is "table1" and it's set run after updates.
Within SSMS whenever I update "table1" everything works fine. Unfortunately, whenever I update "table1" in a proprietary application (which I don't have the source code to), it fails with the message "The type of column conflit with the type of other columns specified in the UNPIVOT list".
After doing a bit of searching I added COLLATE DATABASE_DEFAULT to my cast's in the view without any luck. It was a bit of a long shot because the collation all matched whenever I queried INFORMATION_SCHEMA.COLUMNS.
I then changed the casts from VARCHAR to CHAR and it worked without issue. For obvious reasons, I'd rather use VARCHAR. What is different between a SSMS and application connection? I assume the application isn't using a connection property that SSMS uses.
PS: The database is a bit funky because it does not use NULLs and uses CHAR instead of VARCHAR.
This question is about the gui application (DB2 Control Center), not about sql statements
At my work, we develop an application that supports sql server, oracle and db2. Therefore we use the gui applications of all three of them at varying capacity.
The problem is when I edit a record and I want to insert a null value. For sql server (sql management studio), ctrl+0 does the trick. For oracle (sqldeveloper) it doesn't matter because empty strings are essentially nulls.
Does anyone know how I can do that with the Control Center for db2? currently I resort to executing statements via the command editor as a workaround, but it is such a waste of time.
If you leave the field blank, it'll insert a NULL.
In more depth, if I double-click the table name, I get a window containing the first 100 records in that table. Then, I click the 'Add Row' button, and a new empty row shows up at the bottom of the listing. I fill in the mandatory fields, leaving the nullable fields blank, then click the 'Commit' button to commit that insert. Fields that are left blank are inserted as nulls.