Return a value if no rows are found SQL

SQL

What actually happens when you run a SQL query that doesn’t return any rows? For example, think of a WHERE clause with the condition 1=2, which can never be fulfilled and therefore rows can never be returned. First, let’s look at a few examples that should show you what you can expect as a return … Read more

SQL Developer Memory Settings

SQL

Your SQL Developer is behaving slowly when starting and executing queries? Then I have the right tips for you here. Two blog articles already deal with the optimization of SQL Developer. On the one hand how you can optimize the SQL Developer and on the other hand how you can make the SQL Developer faster. … Read more

SQL Developer Slow

SQL

Is your SQL developer slow? Then here are a few tips and tricks to make it a little faster. Note that you use the Always optimize SQL Developerand you should also download the latest updates. First of all, this is mandatory. You can already find the optimization guide in the blog article Tune SQL Developer. … Read more

Differences between NVL, NVL2 and COALESCE

SQL

NVL and NVL2 are Oracle specific and where introduced before the ANSI-92 standard (which includes COALESCE) was created. NVL and COALESCE are nearly identical, even there are some differenced I would like to point out: NVL always executes both arguments NVL always evaluates the first and second arguments and is therefore a bit slower than … Read more

Autonomous Transactions

SQL

PL/SQL normally treads the whole modification as a single transaction. If you want to have some part of the code as seperate transaction, you can use the functionallity of autonomous transactions. The statement PRAGMA AUTONOMOUS_TRANSACTION has to be part of the declarative section. Cause the transaction is seperate you have to seperate specify a COMMIT … Read more

SQL Aggregation

SQL

Aggregation Cube If you have dimensions, you can use the cube function. Imagine you have the dimensions time, state and product. When you use the cube function, you can get an insight of these values (you get all possible subtotals). Also a partial cube query is possible. Grouping Rollup – SQL Aggregation The rollup clause … Read more

Write protection of tables

Schreibschutz von Tabellen 1

Write protection can be applied to tables. This prevents DDL (Data Definition Language) and DML (Data Manipulation Language) changes during maintenance mode. The statement: ALTER TABLE tablename READ ONLY; — nur mehr lesbar ALTER TABLE tablename READ WRITE; — Read and write possible VIEWs can be equipped with a WITH READ ONLY option. This ensures … Read more

SQL Developer – Difference Snippet VS Code Template

Snippet Code Vorlagen 1

In principle, Snippet and Code Template serve the same purpose: Previously created code is inserted at the desired location. The only difference between the two tools is the paste option. Snippets require the Snippets window first. This can be dragged to any location in the SQL Developer. In addition, the snippets are divided into different … Read more