public void VerifySequences() { Sequence sequence = mssql.GetSequences()[0]; Assert.AreEqual(sequence.cycle, false); Assert.AreEqual(sequence.increment, 1); Assert.AreEqual(sequence.sequenceName, "testsequence"); Assert.AreEqual(sequence.startNumber, 1); Assert.AreEqual(sequence.minValue, long.MinValue); Assert.AreEqual(sequence.maxValue, long.MaxValue); Assert.AreEqual(sequence.cache, 0); }
public void testSequence() { DBStringBuilder mssqlconnecitonString = new DBStringBuilder(DBType.MSSQL, "84.115.153.150", "1433", "testdb", "SA", "Migrate01"); MSSQLConnection mssql = MSSQLConnection.getConnection(); mssql.connectionString = mssqlconnecitonString; mssql.OpenConnection(); Sequence sequence = mssql.GetSequences()[0]; Console.Out.WriteLine(sequence.ToString()); }
public void addSeq(MSSQLConnection ms, OracleSQLConnection os, CUBRIDConnection cs) { List <Sequence> seqs; List <String> seqsc; if (ms == null) { seqsc = os.getSequences(); for (int i = 0; i < seqsc.Count; i++) { String sql = seqsc[i]; try { CUBRIDCommand cc = new CUBRIDCommand(sql, cs); cc.ExecuteNonQuery(); } catch (Exception e) { // MessageBox.Show(e + ""); } } } else { seqs = ms.GetSequences(); for (int i = 0; i < seqs.Count; i++) { Sequence q = seqs[i]; String sql = "Create serial " + q.sequenceName + " start with " + q.startNumber + " increment by " + q.increment + " minvalue " + q.minValue + " maxvalue " + q.maxValue + " cache " + q.cache; try { CUBRIDCommand cc = new CUBRIDCommand(sql, cs); cc.ExecuteNonQuery(); } catch (Exception e) { // MessageBox.Show(e + ""); } } } }