Skip Headers

Oracle Call Interface Programmer's Guide
Release 2 (9.2)

Part Number A96584-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

OCI Datatype Mapping and Manipulation Functions, 32 of 134


OCIDateTimeCheck()

Purpose

Checks if the given date is valid.

Syntax

sword OCIDateTimeCheck ( dvoid               *hndl,
                         OCIError            *err, 
                         CONST OCIDateTime   *date, 
                         ub4                 *valid );

Parameters

hndl (IN)

The OCI user session handle or environment handle. If a user session handle is passed, the conversion takes place in the session's NLS_LANGUAGE and the session's NLS_CALENDAR, otherwise the default is used.

err (IN/OUT)

The OCI error handle. If there is an error, it is recorded in err and this function returns OCI_ERROR. Obtain diagnostic information by calling OCIErrorGet().

date (IN)

The date to be checked.

valid (OUT)

Returns zero for a valid date, otherwise it returns the ORed combination of all the error bits specified below:

Macro Name Bit Number Error

OCI_DT_INVALID_DAY

0x1

Bad day

OCI_DT_DAY_BELOW_VALID

0x2

Bad day low/high bit (1=low)

OCI_DT_INVALID_MONTH

0x4

Bad month

OCI_DT_MONTH_BELOW_VALID

0x8

Bad month low/high bit (1=low)

OCI_DT_INVALID_YEAR

0x10

Bad year

OCI_DT_YEAR_BELOW_VALID

0x20

Bad year low/high bit (1=low)

OCI_DT_INVALID_HOUR

0x40

Bad hour

OCI_DT_HOUR_BELOW_VALID

0x80

Bad hour low/high bit (1=low)

OCI_DT_INVALID_MINUTE

0x100

Bad minute

OCI_DT_MINUTE_BELOW_VALID

0x200

Bad minute low/high bit (1=low)

OCI_DT_INVALID_SECOND

0x400

Bad second

OCI_DT_SECOND_BELOW_VALID

0x800

Bad second low/high bit (1=low)

OCI_DT_DAY_MISSING_FROM_1582

0x1000

Day is one of those missing from 1582

OCI_DT_YEAR_ZERO

0x2000

Year may not equal zero

OCI_DT_INVALID_TIMEZONE

0x4000

Bad time zone

OCI_DT_INVALID_FORMAT

0x8000

Bad date format input

So, for example, if the date passed in was 2/0/1990 25:61:10 in (month/day/year hours:minutes:seconds format), the error returned would be:

 OCI_DT_INVALID_DAY | OCI_DT_DAY_BELOW_VALID | 
     OCI_DT_INVALID_HOUR | OCI_DT_INVALID_MINUTE.

Returns

OCI_SUCCESS,

OCI_INVALID_HANDLE, if err is a null pointer,

OCI_ERROR, if date or valid is a null pointer.

Related Functions

OCIDateTimeAssign()


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback