Пример #1
0
        // no statement building
#else
        //
        // build method(s)
        //

        #region public override bool BuildStatement(DBStatementBuilder builder)

        /// <summary>
        /// Generates the INSERT statement using the provider specific statement builder
        /// </summary>
        /// <param name="builder">The builder that outputs provider specific statements</param>
        /// <returns>true</returns>
        public override bool BuildStatement(DBStatementBuilder builder)
        {
            builder.BeginInsertStatement();
            if (_into == null)
            {
                throw new NullReferenceException("No table defined to insert into");
            }

            _into.BuildStatement(builder);
            if (this._fields != null && this._fields.Results.Count > 0)
            {
                builder.BeginInsertFieldList();
                _fields.BuildStatement(builder);
                builder.EndInsertFieldList();
            }
            if (_values != null && _values.HasClauses)
            {
                builder.BeginInsertValueList();
                _values.BuildStatement(builder);
                builder.EndInsertValueList();
            }
            else if (_innerselect != null)
            {
                _innerselect.BuildStatement(builder);
            }
            builder.EndInsertStatement();

            return(true);
        }