Exemple #1
0
        /// <summary>
        /// Creates a new NextID (NextValue) function for the specified owner.sequence
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="sequence"></param>
        /// <returns></returns>
        public static DBFunction NextID(string owner, string sequence)
        {
            DBSequenceFunctionRef func = new DBSequenceFunctionRef();

            func.Owner         = owner;
            func.SequenceName  = sequence;
            func.KnownFunction = Data.Function.NextID;
            return(func);
        }
Exemple #2
0
        /// <summary>
        /// Creates a new LastID function for the specified sequence
        /// to be executed on the database server
        /// </summary>
        /// <param name="sequence"></param>
        /// <returns></returns>
        /// <remarks>Some database implementations require the use of a sequence name to return the
        /// last id for (Oracle)</remarks>
        public static DBFunction LastID(string sequence)
        {
            DBSequenceFunctionRef func = new DBSequenceFunctionRef();

            func.Owner         = string.Empty;
            func.SequenceName  = sequence;
            func.KnownFunction = Data.Function.LastID;
            return(func);
        }