示例#1
0
        // sets val as TimeSpan with Oid oid PqsqlDbType.Time into pqparam_buffer pb
        internal static void SetTime(IntPtr pb, object val, PqsqlDbType oid)
        {
            TimeSpan ts = (TimeSpan)val;

            int hour;
            int min;
            int sec;
            int fsec;

            PqsqlBinaryFormat.GetTime(ts, out hour, out min, out sec, out fsec);

            PqsqlBinaryFormat.pqbf_add_time(pb, hour, min, sec, fsec);
        }
示例#2
0
        // adds o as TimeSpan array element into PQExpBuffer a
        internal static void SetTimeArray(IntPtr a, object o)
        {
            TimeSpan ts = (TimeSpan)o;

            int hour;
            int min;
            int sec;
            int fsec;

            PqsqlBinaryFormat.GetTime(ts, out hour, out min, out sec, out fsec);

            PqsqlBinaryFormat.pqbf_set_array_itemlength(a, 8);
            PqsqlBinaryFormat.pqbf_set_time(a, hour, min, sec, fsec);
        }
示例#3
0
        public int WriteTime(TimeSpan value)
        {
            long begin = LengthCheckReset();

            int hour;
            int min;
            int sec;
            int fsec;

            PqsqlBinaryFormat.GetTime(value, out hour, out min, out sec, out fsec);

            PqsqlBinaryFormat.pqbf_set_time(mExpBuf, hour, min, sec, fsec);
            unsafe
            {
                sbyte *val = PqsqlBinaryFormat.pqbf_get_bufval(mExpBuf) + begin;
                return(PutColumn(val, 8));
            }
        }