If you need to replace a substring with another string in MariaDB, here are two approaches that you can use.
Continue readingCategory: DBMS
Database Management Systems
JSON_QUERY() Function in Oracle
In Oracle Database, the JSON_QUERY()
function selects and returns one or more values from JSON data and returns those values.
You can use the function to retrieve fragments of a JSON document.
Continue readingHow to Export Query Results to a CSV File in SQL Developer (Oracle)
You can do this to export your query results to a CSV file when using SQL Developer to query Oracle Database.
Continue readingDifference Between SYSDATE() and NOW() in MariaDB
In MariaDB, the SYSDATE()
and NOW()
functions are similar in that they return the current date and time.
However, there is an important difference: SYSDATE()
returns the time that it executes, whereas NOW()
returns the time that the statement started executing.
And when run within a stored procedure or trigger, SYSDATE()
will return the time that it executes, whereas NOW()
will return the time that the stored procedure or trigger started executing.
Return the Short Month 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 month name.
The short month name is also referred to as the abbreviated month name. Examples of returning the short month name are below.
Continue readingUID – Return the ID of the Current Session in Oracle
In Oracle Database, the UID
function returns an integer that uniquely identifies the session user (the user who logged on).
How to Export Query Results to a CSV File in SQLcl (Oracle)
If you’re using SQLcl to run queries against Oracle Database, then you can use the SPOOL
command to export your query results to a CSV file.
USER Function in Oracle
In Oracle Database, the USER
function returns the name of the session user (the user who logged on).
4 Ways to Separate Hours, Minutes, and Seconds from a Time Value in MariaDB
MariaDB has several functions that enable you to extract various date and time parts from date/time values. You can use these to separate each date/time component into its own column if required.
Below are four ways to extract the hours, minutes, and seconds from a time value in MariaDB. As a bonus, we’ll also include microseconds.
Continue readingSYS_GUID() Function in Oracle
In Oracle Database, the SYS_GUID()
function generates and returns a globally unique identifier (RAW
value) made up of 16 bytes.
On most platforms, the generated identifier consists of a host identifier, a process or thread identifier of the process or thread invoking the function, and a nonrepeating value (sequence of bytes) for that process or thread.
Continue reading