In MySQL, the ICU_VERSION()
function returns the version of the International Components for Unicode (ICU) library used to support regular expression operations.
The ICU_VERSION()
function is primarily intended for use in test cases.
In MySQL, the ICU_VERSION()
function returns the version of the International Components for Unicode (ICU) library used to support regular expression operations.
The ICU_VERSION()
function is primarily intended for use in test cases.
If you get an error that reads “WRONGTYPE Operation against a key holding the wrong kind of value” when using the ZREM
command in Redis, it’s because you’re passing a key with the wrong data type.
To fix this issue, make sure that you pass a sorted set to the ZREM
command.
By default, SQL Server sets its own minimum and maximum values for sequence objects based on the data type of the sequence object. Assuming we don’t set the data type for the sequence, these min/max values are based on the bigint data type (because that’s the default data type for sequence objects in SQL Server).
However, we can also set our own minimum and maximum values for our sequences. We can do this either explicitly (by setting the MAXVALUE
and MINVALUE
properties) or implicitly (by setting the data type).
If you’re getting an error that reads something like “START value (0) cannot be less than MINVALUE (1)” in PostgreSQL when you’re trying to create a sequence, it’s because your sequence’s start value is lower than its minimum value, when it should be at least the same or higher.
To fix this issue, be sure that the sequence’s start value is at least the same or greater than the minimum value.
Continue readingIn MySQL, CURRENT_ROLE()
is a built-in function that returns the current active roles for the current session, separated by commas, or NONE
if there are none. The current role determines our access privileges.
In Redis, we can update multiple fields in just the same way that we can update a single field. The HSET
command allows us to set one or more fields in a hash.
The ability of the HSET
command to update multiple fields was introduced in Redis 4.0.0. Prior to that, we needed to use the (now deprecated) HMSET
command if we wanted to add more than one field at once.
In MySQL, the COERCIBILITY()
returns the collation coercibility value of its string argument.
The COERCIBILITY()
function defines how collations will be converted in the case of collation conflict. In such conflicts, an expression with a higher coercibility is converted to the collation of an expression with a lower coercibility.
If you’re getting error msg 6825 that reads “ELEMENTS option is only allowed in RAW, AUTO, and PATH modes of FOR XML“, it’s probably because you’re trying to use the ELEMENTS
directive while using EXPLICIT
mode of the FOR XML
clause.
As the message alludes to, this option is not available when using the EXPLICIT
mode (it’s only allowed with the RAW
, AUTO
, and PATH
modes).
However, SQL Server does provide us with an equivalent that provides the same result. When using EXPLICIT
mode, we can use the ELEMENT
directive instead. We apply this to the column names, instead of the end of the query. We can alternatively use the ELEMENTXSINIL
directive to ensure that elements are generated even if the column contains a NULL value.
The MySQL CONNECTION_ID()
function returns the connection ID (thread ID) for the connection.
In MySQL, every connection has an ID that is unique among the set of currently connected clients. We can use the CONNECTION_ID()
function to return that ID.
If you’re getting an error that reads “Argument ‘AS’ cannot be used in an ALTER SEQUENCE statement.” in SQL Server, it’s probably because you’re trying to change the data type of a sequence object.
We can’t actually change the data type of a sequence object, so this error is to be expected.
If you need to change the data type of a sequence object, you’ll need to drop the sequence and recreate it with the correct data type.
Continue reading