예제 #1
0
        private string CreateConstraintSQL(IndexDefInfo indexInfo, bool addComma, bool addNewLine)
        {
            if (indexInfo == null)
            {
                return(DBConstants.EMPTY_STRING);
            }

            string sqlCommand = DBConstants.EMPTY_STRING;

            string sqlFieldsList = CreateConstraintFiledList(indexInfo.IndexFields(), indexInfo.m_bPrimary);

            sqlCommand = PlatformCreateContraintSQL(sqlFieldsList, indexInfo.m_strName, indexInfo.m_bPrimary);

            if (sqlCommand != DBConstants.EMPTY_STRING)
            {
                if (addComma)
                {
                    sqlCommand += ",";
                }
                if (addNewLine)
                {
                    sqlCommand += DBConstants.NEW_LINE_STR;
                }
            }
            return(sqlCommand);
        }