srsf/sisrscontrollerplugin/src/sicommondb.cpp
branchRCL_3
changeset 11 6347473a7bb2
parent 0 bf1d17376201
equal deleted inserted replaced
9:fc313e1df071 11:6347473a7bb2
   226 	const TDesC& aIdTable,
   226 	const TDesC& aIdTable,
   227 	const TDesC& aIdColumn,
   227 	const TDesC& aIdColumn,
   228 	TUid aClientUid,
   228 	TUid aClientUid,
   229 	RArray<TUint32>& aIDs )
   229 	RArray<TUint32>& aIDs )
   230 	{
   230 	{
       
   231 	CleanupClosePushL( aIDs ); 
       
   232 	
   231 	TBuf<100> KSQLStatement;
   233 	TBuf<100> KSQLStatement;
   232 	// Declare a literal string to hold the SQL statement
   234 	// Declare a literal string to hold the SQL statement
   233 	// SELECT aIdColumn, KUsedColumn FROM aIdTable WHERE KClientUidColumn = uid
   235 	// SELECT aIdColumn, KUsedColumn FROM aIdTable WHERE KClientUidColumn = uid
   234 	// ORDER BY aIdColumn
   236 	// ORDER BY aIdColumn
   235 	_LIT(KSQLSelect1, "SELECT ");
   237 	_LIT(KSQLSelect1, "SELECT ");
   277 			}
   279 			}
   278 		}
   280 		}
   279 
   281 
   280 	// Cleanup view
   282 	// Cleanup view
   281     CleanupStack::PopAndDestroy();
   283     CleanupStack::PopAndDestroy();
       
   284     CleanupStack::Pop();
   282 	}
   285 	}
   283 
   286 
   284 // -----------------------------------------------------------------------------
   287 // -----------------------------------------------------------------------------
   285 // CSICommonDB::GetAllIDsL
   288 // CSICommonDB::GetAllIDsL
   286 // This function returns all Ids in the specified table.
   289 // This function returns all Ids in the specified table.
   289 void CSICommonDB::GetAllIDsL(
   292 void CSICommonDB::GetAllIDsL(
   290 	const TDesC& aIdTable,
   293 	const TDesC& aIdTable,
   291 	const TDesC& aIdColumn,
   294 	const TDesC& aIdColumn,
   292 	RArray<TUint32>& aIDs )
   295 	RArray<TUint32>& aIDs )
   293 	{
   296 	{
       
   297 	CleanupClosePushL( aIDs ); 
       
   298 	
   294 	TBuf<100> KSQLStatement;
   299 	TBuf<100> KSQLStatement;
   295 	// Declare a literal string to hold the SQL statement
   300 	// Declare a literal string to hold the SQL statement
   296 	// SELECT aIdColumn FROM aIdTable WHERE KUsedColumn = KUsed
   301 	// SELECT aIdColumn FROM aIdTable WHERE KUsedColumn = KUsed
   297 	// ORDER BY aIdColumn
   302 	// ORDER BY aIdColumn
   298 	_LIT(KSQLSelect1, "SELECT ");
   303 	_LIT(KSQLSelect1, "SELECT ");
   331 		User::LeaveIfError(aIDs.Append(id));
   336 		User::LeaveIfError(aIDs.Append(id));
   332 		}
   337 		}
   333 
   338 
   334 	// Cleanup view
   339 	// Cleanup view
   335     CleanupStack::PopAndDestroy();
   340     CleanupStack::PopAndDestroy();
       
   341     CleanupStack::Pop(); 
   336 	}
   342 	}
   337 
   343 
   338 // -----------------------------------------------------------------------------
   344 // -----------------------------------------------------------------------------
   339 // CSICommonDB::IsValidL
   345 // CSICommonDB::IsValidL
   340 // Checks to see if aKey exists in the table and that it's set to "used".
   346 // Checks to see if aKey exists in the table and that it's set to "used".