Here are two ways you can use SQLcl or SQL*Plus to check your Oracle Database compatibility level.
Object-Relational
How to Show the Current Setting for Null Output in PostgreSQL (psql)
When using psql, null values are returned as an empty string by default.
This can easily be changed with the \pset command, so it could be a value other than the default empty string.
If you’re not sure what your current value is, you can use the show \pset null command to show the current value.
List All Functions in Oracle Database
Here are several ways to get a list of functions in Oracle Database.
Add the Ordinal Indicator to a Date in Oracle
In Oracle Database, we can use the TH format element to add the ordinal number suffix to the result of a TO_CHAR() operation when formatting dates.
For example, instead of outputting 10 Feb we could output 10th Feb. Or, instead of outputting 21 century, we can output 21st century. The same applies for spelled date components. For example, instead of Twenty One, we can output Twenty First.
Find Out Which Currency Symbol your Session Uses in Oracle
In Oracle Database, the following NLS parameters can be used to determine how currencies are displayed for the current session:
NLS_CURRENCYspecifies the string to use as the local currency symbol for theLnumber format element.NLS_ISO_CURRENCYdetermines what to use for theCformat element.NLS_DUAL_CURRENCYspecifies what to use for theUformat element.
The default value for these is determined by the NLS_TERRITORY parameter.
The L, C, and U number format elements can be used in functions like TO_CHAR() to format a number as a currency.
How to Spell Out the Year when Formatting a Date in Oracle
Oracle Database includes a good selection of datetime format elements. that enable us to format dates and times when using the TO_CHAR(datetime) function.
One of these (the YEAR format element) allows us to format a date with the year spelled out. For example, instead of 1972, we’d get NINETEEN SEVENTY-TWO.
We can also use SYEAR so that BC dates are prefixed with a minus sign (-).
DROP TABLE IF EXISTS Example in PostgreSQL
In PostgreSQL, we can use the IF EXISTS clause of the DROP TABLE statement to check whether the table exists or not before dropping it.
3 Ways to Return the Time Zone from a Datetime Value in Oracle
Below are three ways to return time zone information from a datetime value in Oracle Database.
How to Check a Column’s Data Type in SQL
In SQL, the columns information schema view, which returns information about columns, is an ISO standard view that is supported by most of the major RDBMSs. You can use this view to get information about a column’s data type.
Most of the major RDBMs also provide other methods for getting column information.
Here are examples of getting the data type of a column in various SQL databases.