コード例 #1
0
        /// <summary>
        /// Set the default stored procedures names
        /// </summary>
        private void SetDefaultNames()
        {
            (var tableName, var trackingName) = OracleBuilder.GetParsers(this.TableDescription);

            var schema = string.IsNullOrEmpty(tableName.SchemaName) ? "" : tableName.SchemaName + ".";

            this.AddName(DbCommandType.SelectChanges, string.Format(selectChangesProcName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.SelectChangesWitFilters, string.Format(selectChangesProcNameWithFilters, schema, tableName.ObjectName, "{0}"));
            this.AddName(DbCommandType.SelectRow, string.Format(selectRowProcName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.InsertRow, string.Format(insertProcName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.UpdateRow, string.Format(updateProcName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.DeleteRow, string.Format(deleteProcName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.InsertMetadata, string.Format(insertMetadataProcName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.UpdateMetadata, string.Format(updateMetadataProcName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.DeleteMetadata, string.Format(deleteMetadataProcName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.Reset, string.Format(resetMetadataProcName, schema, tableName.ObjectName));

            this.AddName(DbCommandType.InsertTrigger, string.Format(insertTriggerName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.UpdateTrigger, string.Format(updateTriggerName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.DeleteTrigger, string.Format(deleteTriggerName, schema, tableName.ObjectName));

            this.AddName(DbCommandType.BulkTableType, string.Format(bulkTableTypeName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.BulkTemporyTable, string.Format(bulkTemporyTableName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.BulkTable, string.Format(bulkTableName, schema, tableName.ObjectName));

            this.AddName(DbCommandType.BulkInsertRows, string.Format(bulkInsertProcName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.BulkUpdateRows, string.Format(bulkUpdateProcName, schema, tableName.ObjectName));
            this.AddName(DbCommandType.BulkDeleteRows, string.Format(bulkDeleteProcName, schema, tableName.ObjectName));
        }
コード例 #2
0
        public OracleBuilderTrackingTable(DmTable tableDescription, DbConnection connection, DbTransaction transaction)
        {
            this.tableDescription = tableDescription;
            this.connection       = connection as OracleConnection;
            this.transaction      = transaction as OracleTransaction;

            (this.tableName, this.trackingName) = OracleBuilder.GetParsers(this.tableDescription);
            this.oracleDbMetadata = new OracleDbMetadata();
        }
コード例 #3
0
        public OracleBuilderTrigger(DmTable tableDescription, DbConnection connection, DbTransaction transaction)
        {
            this.tableDescription = tableDescription;
            this.connection       = connection as OracleConnection;
            this.transaction      = transaction as OracleTransaction;

            (this.tableName, this.trackingName) = OracleBuilder.GetParsers(this.tableDescription);
            this.oracleObjectNames = new OracleObjectNames(this.tableDescription);
        }
コード例 #4
0
        public string AlterDeleteTriggerScriptText()
        {
            (var tableName, var trackingName) = OracleBuilder.GetParsers(this.tableDescription);
            var           delTriggerName = this.oracleObjectNames.GetCommandName(DbCommandType.DeleteTrigger);
            StringBuilder createTrigger  = new StringBuilder($"CREATE OR REPLACE TRIGGER {delTriggerName} AFTER DELETE ON {tableName.QuotedString} FOR EACH ROW ");

            createTrigger.AppendLine();
            createTrigger.AppendLine(this.InsertTriggerBodyText());

            string str = $"ALTER Trigger Delete for table {tableName.QuotedString}";

            return(OracleBuilder.WrapScriptTextWithComments(createTrigger.ToString(), str));
        }