In Oracle Database, the RM format element allows you to return the month in roman numerals when using the TO_CHAR() function.
You can also use the fm modifier to suppress any padding.
With Oracle Database, we can use the TO_CHAR(datetime) function to return the century from a datetime value.
To do this, we can use either the CC format element, or the SCC format element. We can combine these with other format elements to do things like, display the ordinal number, spell out the century, etc.
In Oracle Database, there are a number of views that we can query to find out whether a table exists.
Here are three ways to get information about a table’s columns in Oracle, including their data types.
Most of the major RDBMSs have functions that enable us to format numbers with commas as either the group separator, or the decimal separator.
Some RDBMSs also output certain numeric data types with commas in the relevant place.
Below are examples of formatting numbers with commas in some of the more popular DBMSs.
The very useful DROP TABLE IF EXISTS syntax was finally introduced in Oracle Database – Oracle Database 23c to be precise. This syntax allows us to run a DROP TABLE statement without getting an error if the table doesn’t exist.
Earlier versions of Oracle don’t support the IF EXISTS clause. Therefore, if we want to avoid any nasty errors resulting from trying to drop a non-existent table, we need to do a bit of extra work.
Below are three options for dropping a table if it exists in Oracle.
If you use SQLcl to query Oracle Database, you might be aware of the SET SQLFORMAT json option, that makes query results come back as JSON documents.
But there’s also a json-formatted option, which returns the results in a more human readable format.