From bf481d60431e2368cf27366c6ab4865e9c8ce9f2 Mon Sep 17 00:00:00 2001 From: rylek Date: Thu, 9 Oct 2008 18:41:31 +0000 Subject: [PATCH] git-svn-id: svn://ultimatepp.org/upp/trunk@513 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/TSql/util.cpp | 5 +++++ uppsrc/TSql/util.h | 1 + 2 files changed, 6 insertions(+) diff --git a/uppsrc/TSql/util.cpp b/uppsrc/TSql/util.cpp index bded3ebf9..a9657fc65 100644 --- a/uppsrc/TSql/util.cpp +++ b/uppsrc/TSql/util.cpp @@ -577,6 +577,11 @@ SqlVal SchemaAlias(const SqlVal& table) return SqlCol(~SchemaTable(table) + SqlCase(MSSQL, " as ")(" ") + ~table); } +SqlId SchemaId(SqlId table_id) +{ + return SqlId(SchemaTableName(~table_id) + SqlCase(MSSQL, " as ")(" ") + ~table_id); +} + VectorMap Describe(const SqlVal& table, Sql& cursor) { VectorMap map; diff --git a/uppsrc/TSql/util.h b/uppsrc/TSql/util.h index 2cddcf0f0..7e62eb08b 100644 --- a/uppsrc/TSql/util.h +++ b/uppsrc/TSql/util.h @@ -89,6 +89,7 @@ bool IsNotSchemaEmpty(const SqlVal& table, SqlId column, const SqlVal Alias(const SqlVal& value, const SqlVal& alias); SqlVal SchemaAlias(const SqlVal& table, const SqlVal& alias); SqlVal SchemaAlias(const SqlVal& table); +SqlId SchemaId(SqlId table); inline SqlInsert InsertSchema(SqlId table) { return SqlInsert(SqlId(SchemaTableName(~table))); } inline SqlUpdate UpdateSchema(SqlId table) { return SqlUpdate(SqlId(SchemaTableName(~table))); }