Example #1
0
        // sets val as TimeSpan into pqparam_buffer pb
        internal static void SetInterval(IntPtr pb, object val, PqsqlDbType oid)
        {
            TimeSpan ts = (TimeSpan)val;

            long offset;
            int  day;
            int  month;

            PqsqlBinaryFormat.GetInterval(ts, out offset, out day, out month);

            PqsqlBinaryFormat.pqbf_add_interval(pb, offset, day, month);
        }
Example #2
0
        // adds o as TimeSpan array element into PQExpBuffer a
        internal static void SetIntervalArray(IntPtr a, object o)
        {
            TimeSpan ts = (TimeSpan)o;

            long offset;
            int  day;
            int  month;

            PqsqlBinaryFormat.GetInterval(ts, out offset, out day, out month);

            PqsqlBinaryFormat.pqbf_set_array_itemlength(a, 16);
            PqsqlBinaryFormat.pqbf_set_interval(a, offset, day, month);
        }
Example #3
0
        public int WriteInterval(TimeSpan value)
        {
            long begin = LengthCheckReset();

            long offset;
            int  day;
            int  month;

            PqsqlBinaryFormat.GetInterval(value, out offset, out day, out month);

            PqsqlBinaryFormat.pqbf_set_interval(mExpBuf, offset, day, month);
            unsafe
            {
                sbyte *val = PqsqlBinaryFormat.pqbf_get_bufval(mExpBuf) + begin;
                return(PutColumn(val, 16));
            }
        }