sqlparser/language.cpp
// Convert table, view, procedure, function etc. name
Convert table, view, procedure, function etc. name
Convert table view procedure function etc . name
void SqlParser::ConvertObjectIdentifier(Token *token, int scope)
{
	if(token == NULL)
		return;
	if(ConvertTableVariable(token) == true)
		return;
	if(ConvertSessionTemporaryTable(token) == true)
		return;
	if(MapObjectName(token) == true)
		return;
	TokenStr ident;
	size_t len = 0;
	if(_spl_package != NULL && _target != SQL_ORACLE && (scope == SQL_SCOPE_FUNC || scope == SQL_SCOPE_PROC))
		PrefixPackageName(ident);
	int parts = GetIdentPartsCount(token);
	if(parts > 1)
		ConvertSchemaName(token, ident, &len);
	else
	if(!_option_set_explicit_schema.empty())
	{
		TokenStr schema;
		schema.Append(_option_set_explicit_schema.c_str(), L"", _option_set_explicit_schema.length());
		schema.Append(".", L".", 1);
		schema.Append(ident);
		ident.Set(schema);
	}
	ConvertObjectName(token, ident, &len);
	if(Token::Compare(token, &ident) == false)
		Token::ChangeNoFormat(token, ident);
}
void SqlParser :: ConvertObjectIdentifier ( Token * token , int scope ) { if ( token == NULL ) return ; if ( ConvertTableVariable ( token ) == true ) return ; if ( ConvertSessionTemporaryTable ( token ) == true ) return ; if ( MapObjectName ( token ) == true ) return ; TokenStr ident ; size_t len = 0 ; if ( _spl_package != NULL && _target != SQL_ORACLE && ( scope == SQL_SCOPE_FUNC || scope == SQL_SCOPE_PROC ) ) PrefixPackageName ( ident ) ; int parts = GetIdentPartsCount ( token ) ; if ( parts > 1 ) ConvertSchemaName ( token , ident , & len ) ; else if ( ! _option_set_explicit_schema . empty ( ) ) { TokenStr schema ; schema . Append ( _option_set_explicit_schema . c_str ( ) , L" " , _option_set_explicit_schema . length ( ) ) ; schema . Append ( " " , L" " , 1 ) ; schema . Append ( ident ) ; ident . Set ( schema ) ; } ConvertObjectName ( token , ident , & len ) ; if ( Token :: Compare ( token , & ident ) == false ) Token :: ChangeNoFormat ( token , ident ) ; }
Convert table, view, procedure, function etc.
Convert table view procedure function etc .
// Check for local table variable // Check for session temporary table // Check if object name mapping is set // Package function or procedure, add a prefix // Get the number of parts in quailified identifier // Object contains a schema // Set explicit schema if defined by the option // If identifier was modified set the target value