'Default value for a parameter in bigquery procedure
In SQL Server, we can specify a default value for a parameter. For eg:
This procedure pattern matches the parameters passed or, if not supplied, uses the preset default (last names that start with the letter D).
CREATE PROCEDURE HumanResources.uspGetEmployees2
@LastName NVARCHAR(50) = N'D%',
@FirstName NVARCHAR(50) = N'%'
AS
SET NOCOUNT ON;
SELECT FirstName, LastName, JobTitle, Department
FROM HumanResources.vEmployeeDepartment
WHERE FirstName LIKE @FirstName AND LastName LIKE @LastName;
I couldn't find anything related to default value for stored procedure's parameters. Is there no concept of default value for a parameter in Bigquery?
Solution 1:[1]
You can pass NULL value and then use COALESCE(Param, 'default_value')
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Guy Gross |
