
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can we pass an empty string as a parameter to BIT_LENGTH() function and what would be returned by MySQL?
Whenever we want to pass an empty string as a parameter to BIT_LENGTH() function then we must have to pass blank quotes (even without any space). It cannot pass without quotes because MySQL then resembles it as the function without any argument and returns an error. But, when we pass an empty string with blank quotes then MySQL will return 0 as output. It can be understood with the following example as well −
Example
mysql> Select BIT_LENGTH(); ERROR 1582 (42000): Incorrect parameter count in the call to native function 'BIT_LENGTH' mysql> Select BIT_LENGTH(''); +----------------+ | BIT_LENGTH('') | +----------------+ | 0 | +----------------+ 1 row in set (0.00 sec)
- Related Articles
- How to pass an object as a parameter in JavaScript function?
- How to pass a function as a parameter in Java
- How to pass a json object as a parameter to a python function?
- How to pass an array as a URL parameter in Laravel?
- What is the range of date time value that we can pass as an argument to MySQL UNIX_TIMESTAMP function?
- How can we specify the number of records to be returned in MySQL output?
- How can we divide the result set returned by MySQL into groups?
- How can I pass a parameter to a setTimeout() callback?
- How to pass a 2D array as a parameter in C?
- How can we check that by default MySQL CHAR() function returns a binary string?
- Can we pass objects as an argument in Java?
- How to pass a jQuery event as a parameter in a method?
- How to pass a lambda expression as a method parameter in Java?
- How can we use a JavaScript function as an object?
- How can we retrieve the length of a specified string in MySQL?

Advertisements