Home  >  Article  >  Database  >  What are the default rules used by the parser when parsing built-in function names?

What are the default rules used by the parser when parsing built-in function names?

WBOY
WBOYforward
2023-09-17 15:45:22847browse

What are the default rules used by the parser when parsing built-in function names?

In fact, when the parser encounters a word that is the name of a built-in function, it must determine whether the name represents a function call or a non-expression reference to an identifier. For example Table or column name. Consider the following query -

1. Select sum(salary) from employee;
2. Create table sum (i int);

In the first query, SUM is a reference to the function call and in the second query, it is a reference to the table name.

The parser follows the following rules to distinguish whether their names are used as identifiers in a function call or non-reference context -

  • Rule1 - The names When used as a function call in an expression, there must be no spaces between the name and the following characters (bracket characters).
  • Rule2 - Instead, use the function name as the identifier, which cannot be followed by parentheses.

The above is the detailed content of What are the default rules used by the parser when parsing built-in function names?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete