void CRURefreshSQLComposer::AddPipeLineClause()
{
	CRUMVList &mvList = GetRefreshTask().GetMVList();
	RUASSERT(mvList.GetCount() > 1);

	DSListPosition pos = mvList.GetHeadPosition();
	mvList.GetNext(pos);	// Skip the root MV
	
	// Generate root clause
	CRUMV *pTopMV = mvList.GetNext(pos);

	sql_ += " PIPELINE " ;
	sql_ += "(" + pTopMV->GetFullName() + ")";

	// Continue with the upper mv's
	while (NULL != pos)
	{
		sql_ += pTopMV->GetFullName();
		
		// Retrieve the next MV from the list
		pTopMV = mvList.GetNext(pos);

		sql_ += " PIPELINE " ;
		sql_ += "(" + pTopMV->GetFullName() + ")";

		if (NULL != pos)
		{
			sql_ += ",";
		}
		else
		{
			return;
		}
	}
}
Exemplo n.º 2
0
//------------------------------------------------------------------------//
//	CRUTbl::Dump()
//------------------------------------------------------------------------//
// LCOV_EXCL_START :dpb
void CRUTbl::Dump(CDSString &to, BOOL isExtended) 
{
	char statusStr[10];

	to += "\nUSED OBJECT " + GetFullName() + " (";
	if (TRUE == IsRegularTable())
	{
		to += "regular table)\n";
	}
	else 
	{
		to += "materialized view)\n";
	}

	sprintf(statusStr, "%d", GetStatus()); 
	to += "Status = ";
	to += statusStr;
	if (0 != GetStatus()) 
		to += "(error)";

	to += "\nMVs using me:\n";
	DSListPosition pos = GetMVsUsingMe().GetHeadPosition();
	while (NULL != pos) 
	{
		CRUMV *pMV = GetMVsUsingMe().GetNext(pos);
		to += "\t" + (pMV->GetFullName()) + "\n";
	}
}