Fix “WRONGTYPE Operation against a key holding the wrong kind of value” when using SMEMBERS in Redis

If you get an error that reads “WRONGTYPE Operation against a key holding the wrong kind of value” when using the SMEMBERS command in Redis, it’s probably because you’re passing a key with the wrong data type to the command.

The SMEMBERS command is a “set” command, and so it is intended to be used on keys that contain a set. If the key holds a different data type, you’ll likely get the above error.

Continue reading

7 Ways to Insert Multiple Rows in SQL

We can use the SQL INSERT statement to insert a row into a table. We can also use it to insert more than one row.

Below are seven ways to insert multiple rows into a table in SQL. Most of these examples should work in the major RDBMSs, with the possible exception of Oracle. But no worries, I’ve included an example just for Oracle.

Continue reading

Fix “One or more scores can’t be converted into double” when using SORT or SORT_RO in Redis

If you’re getting an error that reads “One or more scores can’t be converted into double” when using either the SORT or SORT_RO commands in Redis, it could be because you omitted the ALPHA modifier when trying to sort string values.

If you want to sort string values lexicographically, you need to use the ALPHA modifier when using the SORT or SORT_RO command.

Continue reading