PHPSQLParser\PHPSQLParser::addCustomFunction PHP Method

addCustomFunction() public method

Add a custom function to the parser. no return value
public addCustomFunction ( String $token ) : null
$token String The name of the function to add
return null
    public function addCustomFunction($token)
    {
        PHPSQLParserConstants::getInstance()->addCustomFunction($token);
    }

Usage Example

 public function testIssueGit183()
 {
     $query = "SELECT *\nFROM SC_CATALOG_DETAIL_REG CD\nINNER JOIN MASTER_ITEM_LOOKUP IL\nON to_number( CD.STYLE ) = to_number( IL.SKU_NUM )\n\t\t\t\t";
     $parser = new PHPSQLParser();
     $parser->addCustomFunction("to_number");
     $p = $parser->parse($query, true);
     $expected = getExpectedValue(dirname(__FILE__), 'issue_git183.serialized');
     $this->assertEquals($expected, $p, "Oracle\\'s to_number");
 }
All Usage Examples Of PHPSQLParser\PHPSQLParser::addCustomFunction