📄 ociap.h
字号:
1 if date1 > date2DESCRIPTION:The function OCIDateCompare compares two dates. It returns -1 if date1 is smaller than date2, 0 if they are equal, and 1 if date1 is greater than date2.RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if invalid date input dates are not mutually comparable------------------------------OCIDateTimeConvert----------------------sword OCIDateTimeConvert(dvoid *hndl, OCIError *err, OCIDateTime *indate, OCIDateTime *outdate);NAME: OCIDateTimeConvert - Conversion between different DATETIME typesPARAMETERS:hndl (IN) - Session/Env handle. err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet().indate (IN) - pointer to input dateoutdate (OUT) - pointer to output datetime DESCRIPTION: Converts one datetime type to another. The result type is the type of the 'outdate' descriptor.RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if conversion not possible. ---------------------------- OCIDateTimeFromText-----------------------sword OCIDateTimeFromText(dvoid *hndl, OCIError *err, CONST OraText *date_str, size_t d_str_length, CONST OraText *fmt, ub1 fmt_length, CONST OraText *lang_name, size_t lang_length, OCIDateTime *date );NAME: OCIDateTimeFromText - OCIDateTime convert String FROM DatePARAMETERS:hndl (IN) - Session/Env handle. If Session Handle is passed, the conversion takes place in session NLS_LANGUAGE and session NLS_CALENDAR, otherwise the default is used.err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet().date_str (IN) - input string to be converted to Oracle dated_str_length (IN) - size of the input string, if the length is -1 then 'date_str' is treated as a null terminated stringfmt (IN) - conversion format; if 'fmt' is a null pointer, then the string is expected to be in the default format for the datetime type.fmt_length (IN) - length of the 'fmt' parameterlang_name (IN) - language in which the names and abbreviations of days and months are specified, if null i.e. (OraText *)0, the default language of session is used, lang_length (IN) - length of the 'lang_name' parameterdate (OUT) - given string converted to dateDESCRIPTION: Converts the given string to Oracle datetime type set in the OCIDateTime descriptor according to the specified format. Refer to "TO_DATE" conversion function described in "Oracle SQL Language Reference Manual" for a description of format.RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if invalid format unknown language invalid input string--------------------------- OCIDateTimeGetDate-------------------------sword OCIDateTimeGetDate(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, sb2 *year, ub1 *month, ub1 *day );NAME: OCIDateTimeGetDate - OCIDateTime Get Date (year, month, day) portion of DATETIME. PARAMETERS:hndl (IN) - Session/Env handle. err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet().datetime (IN) - Pointer to OCIDateTime year (OUT) - year valuemonth (OUT) - month valueday (OUT) - day value--------------------------- OCIDateTimeGetTime ------------------------sword OCIDateTimeGetTime(dvoid *hndl, OCIError *err, OCIDateTime *datetime, ub1 *hour, ub1 *minute, ub1 *sec, ub4 *fsec);NAME: OCIDateTimeGetTime - OCIDateTime Get Time (hour, min, second, fractional second) of DATETIME. PARAMETERS:hndl (IN) - Session/Env handle. err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet().datetime (IN) - Pointer to OCIDateTime hour (OUT) - hour valueminute (OUT) - minute valuesec (OUT) - second valuefsec (OUT) - Fractional Second value--------------------------- OCIDateTimeGetTimeZoneOffset ----------------------sword OCIDateTimeGetTimeZoneOffset(dvoid *hndl,OCIError *err,CONST OCIDateTime *datetime,sb1 *hour,sb1 *minute);NAME: OCIDateTimeGetTimeZoneOffset - OCIDateTime Get TimeZone (hour, minute) portion of DATETIME. PARAMETERS:hndl (IN) - Session/Env handle. err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet().datetime (IN) - Pointer to OCIDateTime hour (OUT) - TimeZone Hour valueminute (OUT) - TimeZone Minute value--------------------------- OCIDateTimeSysTimeStamp---------------------sword OCIDateTimeSysTimeStamp(dvoid *hndl, OCIError *err, OCIDateTime *sys_date ); NAME: OCIDateTimeSysTimeStamp - Returns system date/time as a TimeStamp with timezonePARAMETERS:hndl (IN) - Session/Env handle. err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet().sys_date (OUT) - Pointer to output timestamp DESCRIPTION: Gets the system current date and time as a timestamp with timezoneRETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL.------------------------------OCIDateTimeIntervalAdd----------------------sword OCIDateTimeIntervalAdd(dvoid *hndl, OCIError *err, OCIDateTime *datetime, OCIInterval *inter, OCIDateTime *outdatetime);NAME: OCIDateTimeIntervalAdd - Adds an interval to datetimePARAMETERS:hndl (IN) - Session/Env handle.err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet().datetime (IN) - pointer to input datetimeinter (IN) - pointer to interval outdatetime (IN) - pointer to output datetime. The output datetime will be of same type as input datetimeDESCRIPTION: Adds an interval to a datetime to produce a resulting datetimeRETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if: resulting date is before Jan 1, -4713 resulting date is after Dec 31, 9999------------------------------OCIDateTimeIntervalSub----------------------sword OCIDateTimeIntervalSub(dvoid *hndl, OCIError *err, OCIDateTime *datetime, OCIInterval *inter, OCIDateTime *outdatetime);NAME: OCIDateTimeIntervalSub - Subtracts an interval from a datetimePARAMETERS:hndl (IN) - Session/Env handle. err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet().datetime (IN) - pointer to input datetimeinter (IN) - pointer to interval outdatetime (IN) - pointer to output datetime. The output datetime will be of same type as input datetimeDESCRIPTION: Subtracts an interval from a datetime and stores the result in a datetimeRETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if: resulting date is before Jan 1, -4713 resulting date is after Dec 31, 9999--------------------------- OCIDateTimeConstruct-------------------------sword OCIDateTimeConstruct(dvoid *hndl,OCIError *err,OCIDateTime *datetime, sb2 year,ub1 month,ub1 day,ub1 hour,ub1 min,ub1 sec,ub4 fsec, OraText *timezone,size_t timezone_length);NAME: OCIDateTimeConstruct - Construct an OCIDateTime. Only the relevant fields for the OCIDateTime descriptor types are used.PARAMETERS: hndl (IN) - Session/Env handle. err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet(). datetime (IN) - Pointer to OCIDateTime year (IN) - year value month (IN) - month value day (IN) - day value hour (IN) - hour value min (IN) - minute value sec (IN) - second value fsec (IN) - Fractional Second value timezone (IN) - Timezone string timezone_length(IN) - Length of timezone stringDESCRIPTION: Constructs a DateTime descriptor. The type of the datetime is the type of the OCIDateTime descriptor. Only the relevant fields based on the type are used. For Types with timezone, the date and time fields are assumed to be in the local time of the specified timezone. If timezone is not specified, then session default timezone is assumed.RETURNS: OCI_SUCCESS if the function completes successfully. OCI_ERROR if datetime is not valid.------------------------------OCIDateTimeSubtract-----------------------sword OCIDateTimeSubtract(dvoid *hndl, OCIError *err, OCIDateTime *indate1, OCIDateTime *indate2, OCIInterval *inter);NAME: OCIDateTimeSubtract - subtracts two datetimes to return an intervalPARAMETERS:hndl (IN) - Session/Env handle. err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet().indate1(IN) - pointer to subtrahendindate2(IN) - pointer to minuendinter (OUT) - pointer to output intervalDESCRIPTION: Takes two datetimes as input and stores their difference in an interval. The type of the interval is the type of the 'inter' descriptor.RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if datetimes are not comparable.--------------------------- OCIDateTimeToText--------------------------sword OCIDateTimeToText(dvoid *hndl, OCIError *err, CONST OCIDateTime *date, CONST OraText *fmt, ub1 fmt_length, ub1 fsprec, CONST OraText *lang_name, size_t lang_length, size_t *buf_size, OraText *buf );NAME: OCIDateTimeToText - OCIDateTime convert date TO String PARAMETERS:hndl (IN) - Session/Env handle. If Session Handle is passed, the conversion takes place in session NLS_LANGUAGE and session NLS_CALENDAR, otherwise the default is used.err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet().date (IN) - Oracle datetime to be convertedfmt (IN) - conversion format, if null string pointer (OraText*)0, then the date is converted to a character string in the default format for that type.fmt_length (IN) - length of the 'fmt' parameterfsprec (IN) - specifies the fractional second precision in which the fractional seconds is returned.lang_name (IN) - specifies the language in which the names and abbreviations of months and days are returned; default language of session is used if 'lang_name' is null i.e. (OraText *)0lang_length (IN) - length of the 'nls_params' parameterbuf_size (IN/OUT) - size of the buffer; size of the resulting string is returned via this parameterbuf (OUT) - buffer into which the converted string is placedDESCRIPTION: Converts the given date to a string according to the specified format. Refer to "TO_DATE" conversion function described in
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -