When using SQLcl with Oracle Database, you can set SQLFORMAT
to insert
in order to output the query results as INSERT
statements.
Category: DBMS
Database Management Systems
Fix: “BACKUP LOG cannot be performed because there is no current database backup.” in SQL Server/SQL Edge
If you’re trying to back up the transaction logs in a SQL Server or SQL Edge database, but you get an error that states BACKUP LOG cannot be performed because there is no current database backup, you’ll need to perform at least one full backup of the database before you attempt to back up the transaction logs.
Continue reading2 Ways to Get the Size of a Database in PostgreSQL
Below are two ways to return the size of a specific database in PostgreSQL.
Continue readingSubtract Microseconds from a Datetime Value in MariaDB
Here are some options for subtracting one or more microseconds from a datetime expression in MariaDB.
Continue readingJSON_VALUE() in MySQL
In MySQL, the JSON_VALUE()
function extracts a value from a JSON document at the specified path.
The function was introduced in MySQL 8.0.21.
Continue readingHow to Format Negative Numbers with Angle Brackets in Oracle
When using the TO_CHAR()
function to format a number in Oracle Database, you can use the PR
format element to return negative values inside angle brackets (<>
).
3 Ways to Format a Number as a Percentage in PostgreSQL
We have several options if we want to display numbers with a percentage sign in PostgreSQL.
We can use the TO_CHAR()
function to format the number along with the percentage sign. Or we can simply concatenate the number with the percentage sign, either with the CONCAT()
function or with the concatenation operator.
Add a Percent Sign to a Number in MariaDB
Below is a quick example of formatting a number as a percentage in MariaDB.
Continue readingAdd Leading Zeros in SQL
Below are examples of adding a leading zero to a number in SQL, using various DBMSs.
Continue readingFormat a Number as a Percentage in Oracle
Even though Oracle Database has a TO_CHAR(number)
function that allows us to format numbers, it doesn’t provide a format element for the percentage sign.
Therefore, if we want to format a number as a percentage in Oracle Database, we need to concatenate the percentage sign and the number.
Continue reading