• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ qtDbString函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中qtDbString函数的典型用法代码示例。如果您正苦于以下问题:C++ qtDbString函数的具体用法?C++ qtDbString怎么用?C++ qtDbString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: wxT

wxString dlgRepSequence::GetSql()
{
	wxString sql;

	if (sequence)
	{
		// edit mode
	}
	else
	{
		// create mode

		sql = wxT("SELECT ") + cluster->GetSchemaPrefix() + wxT("setaddsequence(")
		      + NumToStr(set->GetSlId()) + wxT(", ");

		if (StrToLong(txtID->GetValue()) > 0)
			sql += txtID->GetValue();
		else
			sql += wxT("(SELECT COALESCE(MAX(seq_id), 0) + 1 FROM ") + cluster->GetSchemaPrefix() + wxT("sl_sequence)");

		sql += wxT(", ") + qtDbString(cbSequence->GetGuessedStringSelection())
		       +  wxT(", ") + qtDbString(txtComment->GetValue())
		       + wxT(")\n");
	}

	return sql;
}
开发者ID:SokilV,项目名称:pgadmin3,代码行数:27,代码来源:dlgRepSequence.cpp


示例2: wxT

/*
 * Execute default privileges statement
 *
 * - Hacked to execute the default privileges statement (sql) for dlgDatabse against this database,
 *   because connection for this database object is getting disconnected, and replaced by the server
 *   connection, before execution of any statements (sqls) in dlgPropery::apply function called
 *   from dlgPropery::OnOK event handler.
 *
 *  NOTE: This will work only if the database object exists.
 */
bool dlgDatabase::executeDDLSql(const wxString &strSql)
{
	pgConn *myConn = connection;

	if (!strSql.IsEmpty())
	{
		wxString tmp;
		if (cbClusterSet && cbClusterSet->GetSelection() > 0)
		{
			replClientData *data = (replClientData *)cbClusterSet->wxItemContainer::GetClientData(cbClusterSet->GetSelection());

			if (data->majorVer > 1 || (data->majorVer == 1 && data->minorVer >= 2))
			{
				tmp = wxT("SELECT ") + qtIdent(data->cluster)
				      + wxT(".ddlscript_prepare(") + NumToStr(data->setId) + wxT(", 0);\n")
				      + wxT("SELECT ") + qtIdent(data->cluster)
				      + wxT(".ddlscript_complete(") + NumToStr(data->setId) + wxT(", ")
				      + qtDbString(strSql) + wxT(", 0);\n");
			}
			else
			{
				tmp = wxT("SELECT ") + qtIdent(data->cluster)
				      + wxT(".ddlscript(") + NumToStr(data->setId) + wxT(", ")
				      + qtDbString(strSql) + wxT(", 0);\n");
			}
		}
		else
			tmp = strSql;

		if (!myConn->ExecuteVoid(tmp))
			// error message is displayed inside ExecuteVoid
			return false;
	}
	return true;
}
开发者ID:Joe-xXx,项目名称:pgadmin3,代码行数:45,代码来源:dlgDatabase.cpp


示例3: AppendNameChange

wxString dlgForeignServer::GetSql()
{
	wxString sql, name;
	name = txtName->GetValue();

	if (foreignserver)
	{
		// edit mode
		AppendNameChange(sql, wxT("SERVER ") + qtIdent(foreignserver->GetName()));

		if (txtVersion->GetValue() != foreignserver->GetVersion())
		{
			sql = wxT("ALTER SERVER ") + qtIdent(name)
			      + wxT("\n  VERSION ") + qtDbString(txtVersion->GetValue()) + wxT(";\n");
		}

		wxString sqloptions = GetOptionsSql();
		if (sqloptions.Length() > 0)
		{
			sql += wxT("ALTER SERVER ") + name
			       + wxT("\n  OPTIONS (") + sqloptions + wxT(");\n");
		}

		AppendOwnerChange(sql, wxT("SERVER ") + qtIdent(name));
	}
	else
	{
		// create mode
		sql = wxT("CREATE SERVER ") + qtIdent(name);
		if (!(txtType->GetValue()).IsEmpty())
			sql += wxT("\n   TYPE ") + qtDbString(txtType->GetValue());
		if (!(txtVersion->GetValue()).IsEmpty())
			sql += wxT("\n   VERSION ") + qtDbString(txtVersion->GetValue());
		sql += wxT("\n   FOREIGN DATA WRAPPER ") + qtIdent(foreigndatawrapper->GetName());

		// check for options
		if (lstOptions->GetItemCount() > 0)
		{
			wxString options = wxEmptyString;
			for (int pos = 0 ; pos < lstOptions->GetItemCount() ; pos++)
			{
				if (options.Length() > 0)
					options += wxT(", ");

				options += lstOptions->GetText(pos, 0)
				           + wxT(" '") + lstOptions->GetText(pos, 1) + wxT("' ");
			}
			sql += wxT("\n  OPTIONS (") + options + wxT(")");
		}

		sql += wxT(";\n");
		AppendOwnerNew(sql, wxT("SERVER ") + qtIdent(name));
	}

	sql += GetGrant(wxT("U"), wxT("SERVER ") + qtIdent(name));
	AppendComment(sql, wxT("SERVER"), 0, foreignserver);

	return sql;
}
开发者ID:xiul,项目名称:pgadmin3,代码行数:59,代码来源:dlgForeignServer.cpp


示例4: ExecuteScalar

bool pgConn::HasPrivilege(const wxString &objTyp, const wxString &objName, const wxString &priv)
{
	wxString res = ExecuteScalar(
	                   wxT("SELECT has_") + objTyp.Lower()
	                   + wxT("_privilege(") + qtDbString(objName)
	                   + wxT(", ") + qtDbString(priv) + wxT(")"));

	return StrToBool(res);
}
开发者ID:AnnaSkawinska,项目名称:pgadmin3,代码行数:9,代码来源:pgConn.cpp


示例5: qtIdent

void dlgRepCluster::OnChangeCluster(wxCommandEvent &ev)
{
	clusterBackup = wxEmptyString;
	remoteVersion = wxEmptyString;

	cbAdminNode->Clear();
	cbAdminNode->Append(_("<none>"), (void *) - 1);

	int sel = cbClusterName->GetCurrentSelection();
	if (remoteConn && sel >= 0)
	{
		wxString schemaPrefix = qtIdent(wxT("_") + cbClusterName->GetValue()) + wxT(".");
		long adminNodeID = settings->Read(wxT("Replication/") + cbClusterName->GetValue() + wxT("/AdminNode"), -1L);

		remoteVersion = remoteConn->ExecuteScalar(wxT("SELECT ") + schemaPrefix + wxT("slonyVersion();"));

		wxString sql =
		    wxT("SELECT no_id, no_comment\n")
		    wxT("  FROM ") + schemaPrefix + wxT("sl_node\n")
		    wxT("  JOIN ") + schemaPrefix + wxT("sl_path ON no_id = pa_client\n")
		    wxT(" WHERE pa_server = (SELECT last_value FROM ") + schemaPrefix + wxT("sl_local_node_id)\n")
		    wxT("   AND pa_conninfo ILIKE ") + qtDbString(wxT("%host=") + remoteServer->GetName() + wxT("%")) + wxT("\n")
		    wxT("   AND pa_conninfo LIKE ") + qtDbString(wxT("%dbname=") + cbDatabase->GetValue() + wxT("%")) + wxT("\n");

		if (remoteServer->GetPort() != 5432)
			sql += wxT("   AND pa_conninfo LIKE ") + qtDbString(wxT("%port=") + NumToStr((long)remoteServer->GetPort()) + wxT("%"));

		pgSet *set = remoteConn->ExecuteSet(sql);
		if (set)
		{
			if (!set->Eof())
			{
				long id = set->GetLong(wxT("no_id"));
				cbAdminNode->Append(IdAndName(id, set->GetVal(wxT("no_comment"))), (void *)id);
				if (adminNodeID == id)
					cbAdminNode->SetSelection(cbAdminNode->GetCount() - 1);
			}
		}


		usedNodes.Clear();
		set = remoteConn->ExecuteSet(
		          wxT("SELECT no_id FROM ") + schemaPrefix + wxT("sl_node"));

		if (set)
		{
			while (!set->Eof())
			{
				usedNodes.Add(set->GetLong(wxT("no_id")));
				set->MoveNext();
			}
			delete set;
		}
	}
	OnChange(ev);
}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:56,代码来源:dlgRepCluster.cpp


示例6: wxT

pgObject *dlgColumn::CreateObject(pgCollection *collection)
{
	pgObject *obj;
	obj = columnFactory.CreateObjects(collection, 0,
	                                  wxT("\n   AND attname=") + qtDbString(GetName()) +
	                                  wxT("\n   AND cl.relname=") + qtDbString(table->GetName()) +
	                                  wxT("\n   AND cl.relnamespace=") + table->GetSchema()->GetOidStr() +
	                                  wxT("\n"));
	return obj;
}
开发者ID:GHnubsST,项目名称:pgadmin3,代码行数:10,代码来源:dlgColumn.cpp


示例7: wxT

pgObject *dlgPackage::CreateObject(pgCollection *collection)
{
	pgObject *obj;

	if (collection->GetConnection()->EdbMinimumVersion(8, 2))
		obj = packageFactory.CreateObjects(collection, 0,
		                                   wxT("   AND nspname = ") + qtDbString(GetName()));
	else
		obj = packageFactory.CreateObjects(collection, 0,
		                                   wxT("   AND pkgname = ") + qtDbString(GetName()));

	return obj;
}
开发者ID:Joe-xXx,项目名称:pgadmin3,代码行数:13,代码来源:dlgPackage.cpp


示例8: wxT

pgObject *dlgSynonym::CreateObject(pgCollection *collection)
{
	pgObject *obj = NULL;
	if (!synonymSchema)
		obj = synonymFactory.CreateObjects(collection, 0,
		                                   wxT(" WHERE synname = ") + qtDbString(GetName()));
	else
		obj = edbPrivFactory.CreateObjects(collection, 0,
		                                   wxT(" WHERE s.synname=") + qtDbString(GetName()) +
		                                   wxT(" AND s.synnamespace=") + collection->GetSchema()->GetOidStr() + wxT(" \n"));

	return obj;
}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:13,代码来源:dlgSynonym.cpp


示例9: wxT

wxString slSequence::GetSql(ctlTree *browser)
{
	if (sql.IsNull())
	{
		sql = wxT("-- Register sequence ") + GetName() + wxT(" for replication.\n\n")
		      wxT("SELECT ") + GetCluster()->GetSchemaPrefix() + wxT("setaddsequence(")
		      + NumToStr(GetSet()->GetSlId()) + wxT(", ")
		      + NumToStr(GetSlId()) + wxT(", ")
		      + qtDbString(GetName()) + wxT(", ")
		      + qtDbString(GetComment()) + wxT(");\n");
	}
	return sql;
}
开发者ID:Joe-xXx,项目名称:pgadmin3,代码行数:13,代码来源:slSequence.cpp


示例10: wxT

wxString dlgJob::GetInsertSql()
{
	wxString sql;

	if (!job)
	{
		sql = wxT("INSERT INTO pgagent.pga_job (jobid, jobjclid, jobname, jobdesc, jobenabled, jobhostagent)\n")
		      wxT("SELECT <JobId>, jcl.jclid, ") + qtDbString(GetName()) +
		      wxT(", ") + qtDbString(txtComment->GetValue()) + wxT(", ") + BoolToStr(chkEnabled->GetValue()) +
		      wxT(", ") + qtDbString(txtHostAgent->GetValue()) + wxT("\n")
		      wxT("  FROM pgagent.pga_jobclass jcl WHERE jclname=") + qtDbString(cbJobclass->GetValue()) + wxT(";\n");
	}
	return sql;
}
开发者ID:GHnubsST,项目名称:pgadmin3,代码行数:14,代码来源:dlgJob.cpp


示例11: wxT

/*
 * Execute default privileges statement
 *
 * - Hacked to execute the default privileges statement (sql) for dlgDatabse against this database,
 *   because connection for this database object is getting disconnected, and replaced by the server
 *   connection, before execution of any statements (sqls) in dlgPropery::apply function called
 *   from dlgPropery::OnOK event handler.
 *
 *  NOTE: This will work only if the database object exists.
 */
bool dlgDatabase::executeDDLSql(const wxString &strSql)
{
	pgConn *myConn = connection;

	if (!strSql.IsEmpty())
	{
		wxString tmp;
		if (cbClusterSet && cbClusterSet->GetSelection() > 0)
		{
			replClientData *data = (replClientData *)cbClusterSet->wxItemContainer::GetClientData(cbClusterSet->GetSelection());

			if (data->majorVer > 1 || (data->majorVer == 1 && data->minorVer >= 2))
			{
				// From slony version 2.2.0 onwards ddlscript_prepare() method is removed and
				// ddlscript_complete() method arguments got changed so we have to use ddlcapture() method
				// instead of ddlscript_prepare() and changed the argument of ddlscript_complete() method
				if ((data->majorVer == 2 && data->minorVer >= 2) || (data->majorVer > 2))
				{
					tmp = wxT("SELECT ") + qtIdent(data->cluster)
					      + wxT(".ddlcapture(") + qtDbString(strSql) + wxT(", ") + wxT("NULL::text") + wxT(");\n")
					      + wxT("SELECT ") + qtIdent(data->cluster)
					      + wxT(".ddlscript_complete(") + wxT("NULL::text") + wxT(");\n");
				}
				else
				{
					tmp = wxT("SELECT ") + qtIdent(data->cluster)
					      + wxT(".ddlscript_prepare(") + NumToStr(data->setId) + wxT(", -1);\n")
					      + strSql + wxT(";\n")
					      + wxT("SELECT ") + qtIdent(data->cluster)
					      + wxT(".ddlscript_complete(") + NumToStr(data->setId) + wxT(", ")
					      + qtDbString(strSql) + wxT(", -1);\n");
				}
			}
			else
			{
				tmp = wxT("SELECT ") + qtIdent(data->cluster)
				      + wxT(".ddlscript(") + NumToStr(data->setId) + wxT(", ")
				      + qtDbString(strSql) + wxT(", 0);\n");
			}
		}
		else
			tmp = strSql;

		if (!myConn->ExecuteVoid(tmp))
			// error message is displayed inside ExecuteVoid
			return false;
	}
	return true;
}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:59,代码来源:dlgDatabase.cpp


示例12: wxT

pgObject *edbPackage::Refresh(ctlTree *browser, const wxTreeItemId item)
{
    pgObject *package=0;

    pgCollection *coll=browser->GetParentCollection(item);
    if (coll)
    {
        if (coll->GetConnection()->EdbMinimumVersion(8, 2))
            package = packageFactory.CreateObjects(coll, 0, wxT(" AND nspname=") + qtDbString(GetName()));
        else
            package = packageFactory.CreateObjects(coll, 0, wxT(" AND pkgname=") + qtDbString(GetName()));
    }

    return package;
}
开发者ID:lhcezar,项目名称:pgadmin3,代码行数:15,代码来源:edbPackage.cpp


示例13: wxT

pgObject *dlgView::CreateObject(pgCollection *collection)
{
	pgObject *obj = viewFactory.CreateObjects(collection, 0,
	                wxT("\n   AND c.relname=") + qtDbString(txtName->GetValue()) +
	                wxT("\n   AND c.relnamespace=") + schema->GetOidStr());
	return obj;
}
开发者ID:GHnubsST,项目名称:pgadmin3,代码行数:7,代码来源:dlgView.cpp


示例14: wxT

pgObject *dlgRepCluster::CreateObject(pgCollection *collection)
{
	pgObject *obj = slClusterFactory.CreateObjects(collection, 0,
	                wxT(" WHERE nspname = ") + qtDbString(wxT("_") + GetName()));

	return obj;
}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:7,代码来源:dlgRepCluster.cpp


示例15: wxT

void dlgRepTable::LoadTrigger(OID relid)
{
    wxString sql = wxT("SELECT tgname FROM pg_trigger\n")
        wxT("  JOIN pg_proc pr ON pr.oid=tgfoid\n")
        wxT("  JOIN pg_namespace ns ON ns.oid=pronamespace\n")
        wxT(" WHERE tgrelid=") + NumToStr(relid);
    if (connection->BackendMinimumVersion(8, 5))
        sql += wxT("   AND tgconstraint=0\n");
    else
        sql += wxT("   AND NOT tgisconstraint\n");
    sql += wxT("   AND nspname <> ") + qtDbString(wxT("_") + set->GetCluster()->GetName()) + wxT("\n")
        wxT(" ORDER BY tgname");

    pgSet *trg=connection->ExecuteSet(sql);

    if (trg)
    {
        while (!trg->Eof())
        {
            chkTrigger->Append(trg->GetVal(wxT("tgname")));
            trg->MoveNext();
        }
        delete trg;
    }
}
开发者ID:lhcezar,项目名称:pgadmin3,代码行数:25,代码来源:dlgRepTable.cpp


示例16: wxT

pgObject *dlgRule::CreateObject(pgCollection *collection)
{
    pgObject *obj = ruleFactory.CreateObjects(collection, 0,
                    wxT("\n   AND rulename=") + qtDbString(GetName()) +
                    wxT("\n   AND rw.ev_class=") + table->GetOidStr());
    return obj;
}
开发者ID:douglasresende,项目名称:pgadmin3,代码行数:7,代码来源:dlgRule.cpp


示例17: wxT

wxString pgTablespace::GetSql(ctlTree *browser)
{
	if (sql.IsNull())
	{
		sql = wxT("-- Tablespace: ") + GetName() + wxT("\n\n");
		if (location.IsEmpty())
			sql += wxT("-- System Tablespace\n");
		else
			sql += wxT("-- DROP TABLESPACE ") + GetQuotedIdentifier()
			       +  wxT("\n\nCREATE TABLESPACE ") + GetQuotedIdentifier()
			       +  wxT("\n  OWNER ") + qtIdent(GetOwner())
			       +  wxT("\n  LOCATION ") + qtDbString(location)
			       +  wxT(";\n");
		sql += GetCommentSql();

		size_t i;
		for (i = 0 ; i < variables.GetCount() ; i++)
			sql += wxT("ALTER TABLESPACE ") + GetQuotedFullIdentifier()
			       +  wxT(" SET (") + variables.Item(i) + wxT(");\n");

		if (GetConnection()->BackendMinimumVersion(9, 2))
			sql += GetSeqLabelsSql();
	}
	return sql;
}
开发者ID:Joe-xXx,项目名称:pgadmin3,代码行数:25,代码来源:pgTablespace.cpp


示例18: GetName

pgObject *dlgSchema::CreateObject(pgCollection *collection)
{
	wxString name = GetName();

	pgObject *obj = schemaFactory.CreateObjects(collection, 0, wxT(" WHERE nspname=") + qtDbString(name) + wxT("\n"));
	return obj;
}
开发者ID:xiul,项目名称:pgadmin3,代码行数:7,代码来源:dlgSchema.cpp


示例19: wxT

wxString pgConn::SystemNamespaceRestriction(const wxString &nsp)
{
	if (reservedNamespaces.IsEmpty())
	{
		reservedNamespaces = wxT("'information_schema'");

		if (GetIsEdb())
			reservedNamespaces += wxT(", 'sys'");

		pgSet *set = ExecuteSet(
		                 wxT("SELECT nspname FROM pg_namespace nsp\n")
		                 wxT("  JOIN pg_proc pr ON pronamespace=nsp.oid\n")
		                 wxT(" WHERE proname IN ('slonyversion')"));
		if (set)
		{
			while (!set->Eof())
			{
				reservedNamespaces += wxT(", ") + qtDbString(set->GetVal(wxT("nspname")));
				set->MoveNext();
			}
			delete set;
		}
	}

	if (BackendMinimumVersion(8, 1))
		return wxT("(") + nsp + wxT(" NOT LIKE E'pg\\_%' AND ") + nsp + wxT(" NOT in (") + reservedNamespaces + wxT("))");
	else
		return wxT("(") + nsp + wxT(" NOT LIKE 'pg\\_%' AND ") + nsp + wxT(" NOT in (") + reservedNamespaces + wxT("))");
}
开发者ID:AnnaSkawinska,项目名称:pgadmin3,代码行数:29,代码来源:pgConn.cpp


示例20: wxT

wxString pgOperator::GetSql(ctlTree *browser)
{
	if (sql.IsNull())
	{
		sql = wxT("-- Operator: ") + GetQuotedFullIdentifier() + wxT("(") + GetOperands() + wxT(")\n\n")
		      + wxT("-- DROP OPERATOR ") + GetQuotedFullIdentifier()
		      + wxT("(") + GetOperands() + wxT(");\n\n")
		      wxT("CREATE OPERATOR ") + GetQuotedFullIdentifier()
		      + wxT("(\n  PROCEDURE = ") + GetOperatorFunction();
		AppendIfFilled(sql, wxT(",\n  LEFTARG = "), qtTypeIdent(GetLeftType()));
		AppendIfFilled(sql, wxT(",\n  RIGHTARG = "), qtTypeIdent(GetRightType()));
		AppendIfFilled(sql, wxT(",\n  COMMUTATOR = "), GetCommutator());
		AppendIfFilled(sql, wxT(",\n  RESTRICT = "), GetRestrictFunction());
		AppendIfFilled(sql, wxT(",\n  JOIN = "), GetJoinFunction());
		if (GetHashJoins()) sql += wxT(",\n  HASHES");
		if (GetMergeJoins()) sql += wxT(",\n  MERGES");

		if (!GetDatabase()->BackendMinimumVersion(8, 3))
		{
			AppendIfFilled(sql, wxT(",\n  SORT1 = "), GetLeftSortOperator());
			AppendIfFilled(sql, wxT(",\n  SORT2 = "), GetRightSortOperator());
			AppendIfFilled(sql, wxT(",\n  LTCMP = "), GetLessOperator());
			AppendIfFilled(sql, wxT(",\n  GTCMP = "), GetGreaterOperator());
		}

		sql += wxT(");\n");

		if (!GetComment().IsNull())
			sql += wxT("COMMENT ON OPERATOR ") + GetQuotedFullIdentifier()
			       + wxT("(") + GetOperands() + wxT(") IS ")
			       + qtDbString(GetComment()) + wxT(";\n");
	}

	return sql;
}
开发者ID:GHnubsST,项目名称:pgadmin3,代码行数:35,代码来源:pgOperator.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ qtIdent函数代码示例发布时间:2022-05-30
下一篇:
C++ qstrncpy函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap