diff --git a/sources/Framework/org.ohdsi.cdm.framework/Desktop/DbLayer/DbSource.cs b/sources/Framework/org.ohdsi.cdm.framework/Desktop/DbLayer/DbSource.cs index 8de8b170..30cc64a2 100644 --- a/sources/Framework/org.ohdsi.cdm.framework/Desktop/DbLayer/DbSource.cs +++ b/sources/Framework/org.ohdsi.cdm.framework/Desktop/DbLayer/DbSource.cs @@ -30,7 +30,7 @@ private void CreateChunkSchema(string name) } } - private string GetQuery(string name) + private string GetQuery(string name, string schema) { string[] resourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames(); var resource = resourceNames.First(a => a.EndsWith(name) && a.Contains(_dbType, StringComparison.OrdinalIgnoreCase)); @@ -39,7 +39,7 @@ private string GetQuery(string name) using var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resource); using var reader = new StreamReader(stream, Encoding.Default); var query = reader.ReadToEnd(); - query = query.Replace("{sc}", schemaName); + query = query.Replace("{sc}", schema); return query; } @@ -49,7 +49,10 @@ public void CreateChunkTable(string schemaName) CreateChunkSchema(schemaName); DropChunkTable(schemaName); - var query = GetQuery("CreateChunkTable.sql"); + var query = GetQuery("CreateChunkTable.sql", schemaName); + + Console.WriteLine("CreateChunkTable:" + query); + using var connection = SqlConnectionHelper.OpenOdbcConnection(_connectionString); using var cmd = new OdbcCommand(query, connection); cmd.ExecuteNonQuery(); @@ -59,8 +62,9 @@ public void DropChunkTable(string schemaName) { CreateChunkSchema(schemaName); - var query = GetQuery("DropChunkTable.sql"); + var query = GetQuery("DropChunkTable.sql", schemaName); + Console.WriteLine("DropChunkTable:" + query); using var connection = SqlConnectionHelper.OpenOdbcConnection(_connectionString); using var cmd = new OdbcCommand(query, connection); cmd.ExecuteNonQuery(); @@ -80,7 +84,7 @@ public IEnumerable GetPersonIds(int chunkId, string schemaName) public void CreateIndexesChunkTable(string schemaName) { - var query = GetQuery("CreateIndexesChunkTable.sql"); + var query = GetQuery("CreateIndexesChunkTable.sql", schemaName); if (string.IsNullOrEmpty(query.Trim())) return; diff --git a/sources/Presentation/org.ohdsi.cdm.presentation.etl2/Program.cs b/sources/Presentation/org.ohdsi.cdm.presentation.etl2/Program.cs index 0129b206..8160bc75 100644 --- a/sources/Presentation/org.ohdsi.cdm.presentation.etl2/Program.cs +++ b/sources/Presentation/org.ohdsi.cdm.presentation.etl2/Program.cs @@ -233,6 +233,9 @@ static int Main(string[] arguments) var sourceReleaseDate = dbSource.GetSourceReleaseDate(); var vocabularyVersion = DbBuildingSettings.GetVocabularyVersion(vocabularyConnectionString, vocabularySchema); + Console.WriteLine("SourceReleaseDate:" + sourceReleaseDate); + Console.WriteLine("VocabularyVersion:" + vocabularyVersion); + if (Settings.Current.Building.Cdm == CdmVersions.V54) { var reader = new CdmSourceDataReader54(DateTime.Parse(sourceReleaseDate), vocabularyVersion);