コード例 #1
0
        public void InsertDataStructure(string dsd_ID, string dsd_Agency, string dsd_Version, List <LocalizedValue> dsd_names, List <ValueDomainInfoInDataStructure> dsd_componentList)
        {
            try
            {
                List <string[]> parameters = new List <string[]>();
                parameters.Add(new string[] { "datastructure_seq_id", "NUMBER" });
                parameters.Add(new string[] { "valueDomain_seq_id", "NUMBER" });
                parameters.Add(new string[] { "main_value_domain_seq_id", "NUMBER" });
                parameters.Add(new string[] { "item_seq_id", "NUMBER" });
                List <string> SQLStatement = VTLSqlStatement.seq_id_declare_begin(parameters);
                //List<string> SQLStatement = VTLSqlStatement.seq_id_storeProcedure_begin(parameters);

                SQLStatement.AddRange(VTLSqlStatement.getDataStructureSQLStatement(dsd_ID, dsd_Agency, dsd_Version, dsd_names, "datastructure_seq_id"));

                foreach (ValueDomainInfoInDataStructure bs in dsd_componentList)
                {
                    SQLStatement.AddRange(VTLSqlStatement.getValueDomainInsertSQLStatement(bs.vd_id, bs.vd_agency, bs.vd_version, bs.names, ArtefactInfo.VTL.VTL_Model.VTL_DATATYPE.String, bs.values, "valueDomain_seq_id", "main_value_domain_seq_id"));
                    SQLStatement.AddRange(VTLSqlStatement.getDataStructureComponentSQLStatement(bs.names, bs.role, bs.vd_id, "datastructure_seq_id", "main_value_domain_seq_id", "item_seq_id"));
                }

                SQLStatement.Add(VTLSqlStatement.closeProcedure);
                //SQLStatement.Add(VTLSqlStatement.closeProcedureInsert);

                string tm1p = String.Join("\n ", SQLStatement);
                OnLineCountEvent(new LineCountEventArgs(tm1p.Count()));

                _provider.ExecuteNonQueryMultiple(tm1p);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
コード例 #2
0
        public string GetTransformation(string transformationID)
        {
            try
            {
                string      queryString = VTLSqlStatement.getSingleTransformationSQLStatement(transformationID);
                IDataReader reader      = _provider.ExecuteReader(queryString);

                if (reader == null)
                {
                    throw new Exception("Database connection failed");
                }

                reader.Read();
                return(reader.GetString(reader.GetOrdinal("TRANSFORMATION_SCHEME_TEXT")).Trim());
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }