当前位置: 首页>>代码示例>>C++>>正文


C++ SqlStatement::Get方法代码示例

本文整理汇总了C++中SqlStatement::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ SqlStatement::Get方法的具体用法?C++ SqlStatement::Get怎么用?C++ SqlStatement::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SqlStatement的用法示例。


在下文中一共展示了SqlStatement::Get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Exp

void Exp(const char *s, SqlStatement sql)
{
	DDUMP(s);
	DDUMP(sql.Get(PGSQL));

	qtf << "\n:: ";
	Put(s, ".From;.Where;.OrderBy");
	qtf << "\n:: ";
	Put(SqlCompile(PGSQL, sql.Get(PGSQL)), " from; where; order by");
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:10,代码来源:SqlExp.cpp

示例2: SaveTest

//==============================================================================================
// Save the new test row data to the database.
void TestGrid::SaveTest(bool prompt) {
	ASSERT(connection);
	ASSERT(connection->session->IsOpen());
	ASSERT(IsCursor());
	int row = GetCursor();
	SqlStatement sts; 
	
	// Inserting a new test
	
	if (IsNewRow()) {
		Set(PROCESSORDER, GetNextProcessOrder());
		sts = SqlStatement(SqlInsert(TESTS)(THISBACK(FieldLayout), true /*nokey, let database generate from sequence */));
		if (WhenToolBarNeedsUpdating) WhenToolBarNeedsUpdating(UrpGrid::USERADDEDROW);

	// Updating an existing test
			
	} else {
		sts = SqlStatement(SqlUpdate(TESTS)(THISBACK(FieldLayout)).Where(TESTID == Get(TESTID)));
		if (WhenToolBarNeedsUpdating) WhenToolBarNeedsUpdating(UrpGrid::USERCHANGEDDATA);
	}
	
	// Wrap in a SqlStatement object, which will somehow either call the SqlUpdate or
	// SqlInsert operator SqlStatement() const, which then constructs a string and forms
	// the constructor "explicit SqlStatement(const String& s) : text(s) {}", and so
	// sets the text member.  I don't know what the explicit command means.
	
	
	// Transform to proper Sql; Sql will not be properly formed until the dialect of the 
	// connection is determined, in this case PGSQL.  Do not use GetText().
	// This calls SqlCompile(dialect, text) to finalize the "text" member contents.
	String controlScript = sts.Get(connection->GetDialect());

	LOG(controlScript);
	int rsp = 1;
	
	if (prompt) {		
		rsp = PromptOKCancel(CAT << "Script being applied: " << controlScript);
	}		
	
	if (rsp == 1) {
		if (!connection->SendAddDataScript(controlScript)) {
			// Beep
			return;
		}
		
		if (IsNewRow()) {
			if (connection->GetRowsProcessed() > 0) {		
				int testid = connection->GetInsertedId("tests", "testid");
				if (testid >= 0) {
					SetTestId(row, testid);
				}
			}
		}
	}
}
开发者ID:radtek,项目名称:lister,代码行数:57,代码来源:TestGrid.cpp

示例3: Compile

String Sql::Compile(const SqlStatement& s)
{
	byte dialect = GetDialect();
	ASSERT(dialect);
	return s.Get(dialect);
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:6,代码来源:Sql.cpp


注:本文中的SqlStatement::Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。