In Oracle Database, we can concatenate strings and numbers with the CONCAT()
function or the pipe concatenation operator (||
).
Category: DBMS
Database Management Systems
The Difference Between INSTR() vs LOCATE() in MariaDB
MariaDB has an INSTR()
function and also a LOCATE()
function. Both functions appear to do exactly the same thing – return the position of a substring within a string.
However, there is a difference.
Continue readingHow to Change the Recovery Model of a Database in Azure SQL Edge using T-SQL
By default, databases created with Azure SQL Edge use the simple recovery model. This means that you can’t perform log backups on these databases.
If you need to perform log backups on a database created with SQL Edge, you’ll need to change the recovery model of the database to either full or bulk logged.
This can be done with T-SQL with the ALTER DATABASE
statement.
About the DATE_BUCKET() Function in Azure SQL Edge
T-SQL includes a DATE_BUCKET()
function that allows you to arrange data into groups that represent fixed intervals of time. It returns the datetime value that corresponds to the start of each datetime bucket, as defined by the arguments passed to the function.
As far as I’m aware, the DATE_BUCKET()
function is only available in Azure SQL Edge at the time of this writing.
Update: DATE_BUCKET()
was introduced in SQL Server 2022.
How to Format Numbers in Oracle
In Oracle Database, you can format numbers in many ways.
For example, you can format a number as a currency, with commas and decimal points in the right place. You can specify leading zeros, you can add a fractional part – or remove it, if that’s what’s required.
Continue readingHow to Install SQL Server on an M1 Mac (ARM64)
I previously explained how to install SQL Server on a Mac using the SQL Server for Linux Docker image.
Since then, Apple has released its M1 chip, which uses ARM architecture. This can cause a problem when trying to install SQL Server. The problem is, at the time of writing, SQL Server isn’t supported on the ARM architecture.
Fortunately, there’s an alternative.
Continue readingReturn the Short Day Name from a Date in Oracle
In Oracle Database, we can use the TO_CHAR(datetime)
function to return the various date parts from a datetime value, including the short day name.
The short day name is also referred to as the abbreviated day name. In any case, below are examples of returning the short day name from a date value in Oracle.
Continue readingList of Territories Supported by Oracle Database
Below is a list of territories that are supported by Oracle Database. These can be used when setting the NLS_TERRITORY
initialization parameter.
Change a Login’s Default Language in SQL Server
In SQL Server, you can use the ALTER LOGIN
statement to change the default language for a specific login.
Doing this will ensure that whenever that login connects to SQL Server, all date/time formats and system messages are presented in the correct format and language.
Continue readingHow to Convert Decimal to Hexadecimal using TO_CHAR() in Oracle
In Oracle Database, you can use the TO_CHAR()
function to convert a number to its hexadecimal equivalent. To do this, use the X
format element.