Gerald Venzl πŸš€ (@geraldvenzl) 's Twitter Profile
Gerald Venzl πŸš€

@geraldvenzl

Defender of Common Sense, Performance Enthusiast, #Database and #SQL guy, Creator of #csv2db. β€œWrite code to solve problems, not to create them!” πŸ‡¦πŸ‡Ή

ID: 2673923562

linkhttps://geraldonit.com calendar_today23-07-2014 14:03:01

8,8K Tweet

4,4K Followers

612 Following

SQL Daily (@sqldaily) 's Twitter Profile Photo

Define identity columns with col INT GENERATED AS IDENTITY This autogenerates numbers for col GENERATED ALWAYS => you can't insert your own values GENERATED BY DEFAULT => the database will assign values if you don't provide one Each table can only have one identity column

Define identity columns with

col INT GENERATED AS IDENTITY

This autogenerates numbers for col

GENERATED ALWAYS => you can't insert your own values
GENERATED BY DEFAULT => the database will assign values if you don't provide one

Each table can only have one identity column
Gerald Venzl πŸš€ (@geraldvenzl) 's Twitter Profile Photo

Two more weeks to go until #KubeCon EU. Looking forward to networking and sharing knowledge about #Kubernetes, #CloudNative, #OpenSource, #Database and more πŸ‘‰ bit.ly/kceu25amb Make sure to stop by the #Oracle booth S200! See you there!

Two more weeks to go until #KubeCon EU. Looking forward to  networking and sharing knowledge about #Kubernetes, #CloudNative, #OpenSource, #Database and more πŸ‘‰ bit.ly/kceu25amb

Make sure to stop by the #Oracle booth S200! See you there!
SQL Daily (@sqldaily) 's Twitter Profile Photo

Change the next value for a sequence in Oracle Database from 18c with ALTER SEQUENCE ... RESTART This resets it back to the sequence's MINVALUE (1 by default) Use the START WITH clause to set it to any next value

SQL Daily (@sqldaily) 's Twitter Profile Photo

Want to remove duplicate rows using Oracle #SQL? Use: DELETE ... WHERE ROWID NOT IN ( SELECT MIN ( ROWID ) FROM ... GROUP BY co1, col2, ... ) List the columns with duplicates in the GROUP BY clause This keeps one row for each set of values in this list and removes extras

Gerald Venzl πŸš€ (@geraldvenzl) 's Twitter Profile Photo

1 week to go for #KubeCon EU with #Oracle front and center πŸ‘‰Visit us at booth S200 πŸ‘‰Race Verstappen in our Red Bull Racing Simulator πŸ‘‰Learn from our Experts in our booth Lighting Sessions πŸ‘‰Check out the CNCF Projects Station and see how we contribute bit.ly/kceu25amb

SQL Daily (@sqldaily) 's Twitter Profile Photo

Turn the output of Oracle #SQL queries into #JSON with JSON_OBJECT JSON_OBJECT_AGG JSON_ARRAY JSON_ARRAY_AGG e.g. SELECT JSON_OBJECT ( 'key' VALUE JSON_ARRAYAGG ( ... ) ) FROM ... These return JSON objects and arrays; the _AGG versions group rows into one document

Turn the output of Oracle #SQL queries into #JSON with

JSON_OBJECT
JSON_OBJECT_AGG
JSON_ARRAY
JSON_ARRAY_AGG

e.g.

SELECT JSON_OBJECT ( 'key' VALUE JSON_ARRAYAGG ( ... ) ) FROM ...

These return JSON objects and arrays; the _AGG versions group rows into one document
SQL Daily (@sqldaily) 's Twitter Profile Photo

Group rows on consecutive dates with #SQL pattern matching SELECT ... FROM ... MATCH_RECOGNIZE ( ORDER BY dt MEASURES ... PATTERN ( init consecutive* ) DEFINE consecutive AS dt = PREV ( dt ) + 1 ) The pattern is a regular expression over the defined variables

Gerald Venzl πŸš€ (@geraldvenzl) 's Twitter Profile Photo

If you happen to come early for #KubeCon EU next week, make sure to check out Lori Lorusso's and my lightning talk kccnceu2025.sched.com/event/1tcvr

If you happen to come  early for #KubeCon EU next week, make sure to check out Lori Lorusso's and my lightning talk

kccnceu2025.sched.com/event/1tcvr
SQL Daily (@sqldaily) 's Twitter Profile Photo

Test if you can convert an expression to a data type in Oracle #SQL with VALIDATE_CONVERSION ( <expr> AS <datatype>, <fmt> ) This tries to convert <expr> using the <fmt> supplied; omit <fmt> & it defaults to the session's NLS settings This returns 1 on success, 0 on failure

Test if you can convert an expression to a data type in Oracle #SQL with

VALIDATE_CONVERSION ( &lt;expr&gt; AS &lt;datatype&gt;, &lt;fmt&gt; )

This tries to convert &lt;expr&gt; using the &lt;fmt&gt; supplied; omit &lt;fmt&gt; &amp; it defaults to the session's NLS settings

This returns 1 on success, 0 on failure
SQL Daily (@sqldaily) 's Twitter Profile Photo

External tables in Oracle Database are a great way to read server-side files with #SQL But what if you want to change which file you're accessing? Use EXTERNAL MODIFY ( LOCATION ( 'new_file' ) ) You can also use this to change the direction, reject limit and access parameters

External tables in Oracle Database are a great way to read server-side files with #SQL

But what if you want to change which file you're accessing?

Use

EXTERNAL MODIFY ( LOCATION ( 'new_file' ) )

You can also use this to change the direction, reject limit and access parameters
SQL Daily (@sqldaily) 's Twitter Profile Photo

AWR reports are a great way to get a summary of all activity in Oracle Database in a period You can now manage them using SQLcl e.g. take a snapshot & get a report from the last 2 snaps with: awr create snap awr create text Gerald Venzl πŸš€ explains geraldonit.com/2025/04/07/cre…