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, 37 of 134


OCIDateTimeFromText()

Purpose

Converts the given string to Oracle datetime type in the OCIDateTime descriptor, according to the specified format.

Syntax

sword OCIDateTimeFromText ( dvoid              *hndl,
                            OCIError           *err, 
                            CONST OraText      *date_str,
                            size_t             dstr_length,
                            CONST OraText      *fmt,
                            ub1                fmt_length, 
                            CONST OraText      *lang_name,
                            size_t             lang_length, 
                            OCIDateTime        *datetime );

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_str (IN)

The input string to be converted to an Oracle datetime.

dstr_length (IN)

The size of the input string. If the length is -1 then date_str is treated as a NULL-terminated string.

fmt (IN)

The 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)

The length of the fmt parameter.

lang_name (IN)

Specifies the language in which the names and abbreviations of months and days are specified. The default language of the session is used if lang_name is null (lang_name = (text *)0).

lang_length (IN)

The length of the lang_name parameter.

datetime (OUT)

The given string converted to a date.

Comments

Refer to the description of the TO_DATE conversion function in the Oracle8i or later SQL Reference for a description of the format argument.

Returns

OCI_SUCCESS,

OCI_INVALID_HANDLE if err is null,

OCI_ERROR, if any of the following is true:

Related Functions

OCIDateTimeToText(), OCIDateTimeFromArray().


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