sqlparser/informix.cpp
// RETURNS or RETURNING in Informix procedure
RETURNS or RETURNING in Informix procedure
RETURNS or RETURNING in Informix procedure
bool SqlParser::ParseInformixReturns(Token *returns)	
{
	if(returns == NULL)
		return false;
	int num = 0;
	while(true)
	{
		Token *datatype = GetNextToken();
		if(datatype == NULL)
			break;
		_spl_returning_datatypes.Add(datatype);
		ParseDataType(datatype);
		num++;
		Token *as = GetNextWordToken("AS", L"AS", 2);
		if(as != NULL)
		{
			Token *name = GetNextToken();
			_spl_returning_out_names.Add(name, NULL);
			if(_target != SQL_INFORMIX)
				Token::Remove(as, name);
		}
		Token *comma = GetNextCharToken(',', L',');
		if(comma == NULL)
			break;
	}
	Token *semi = GetNextCharToken(';', L';');
	_spl_returning_end = Nvl(semi, GetLastToken());
	return true;
}
bool SqlParser :: ParseInformixReturns ( Token * returns ) { if ( returns == NULL ) return false ; int num = 0 ; while ( true ) { Token * datatype = GetNextToken ( ) ; if ( datatype == NULL ) break ; _spl_returning_datatypes . Add ( datatype ) ; ParseDataType ( datatype ) ; num ++ ; Token * as = GetNextWordToken ( " " , L" " , 2 ) ; if ( as != NULL ) { Token * name = GetNextToken ( ) ; _spl_returning_out_names . Add ( name , NULL ) ; if ( _target != SQL_INFORMIX ) Token :: Remove ( as , name ) ; } Token * comma = GetNextCharToken ( ' ' , L' ' ) ; if ( comma == NULL ) break ; } Token * semi = GetNextCharToken ( ' ' , L' ' ) ; _spl_returning_end = Nvl ( semi , GetLastToken ( ) ) ; return true ; }
RETURNS or RETURNING in Informix procedure
RETURNS or RETURNING in Informix procedure
// List of comma-separated data types // For Oracle it is unknown yet whether data type will be used as OUT parameter and length must be removed // or OBJECT and length must be preserved; so parse as columns and preserve sizes // For other databases parameters and columns both preserve sizes, so it is not important how to parse data type // Optional AS name can follow // Use it OUT parameters name // Alias will be specified before name at any case, so remove it // The clause terminates with ; as a statement