Ejemplo n.º 1
0
        public void PostgreSQLSequence(string tableName, string fieldName, ref int value)
        {
            JCursor cursor = new JCursor(this);

            cursor.Format(string.Format("select nextval('{0}_{1}_seq')::int", tableName.ToLower(), fieldName.ToLower()), 0);
            cursor.Run();
            cursor.Read();
            value = cursor.GetInt(0);
        }
Ejemplo n.º 2
0
        public void SqliteSequence(string tableName, string fieldName, ref int value)
        {
            JCursor cursor = new JCursor(this);

            cursor.Format(string.Format("select seq from sqlite_sequence where name = '{0}'", tableName), 0);
            cursor.Run();
            cursor.Read();
            value = cursor.GetInt(0) + 1;
        }
Ejemplo n.º 3
0
        public void OracleSequence(string tableName, string fieldName, ref int value)
        {
            JCursor cursor = new JCursor(this);

            cursor.Format(string.Format("select {0}Seq.NextVal from dual)", tableName), 0);
            cursor.Run();
            cursor.Read();
            value = cursor.GetInt(0);
        }