10.12.2012 Views

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Date Class<br />

Date Class<br />

The Date class specifies the abstraction for a SQL DATE data item. The Date class<br />

also adds formatting and parsing operations to support the OCCI escape syntax for<br />

date values.<br />

Since SQL92 DATE is a subset of <strong>Oracle</strong> Date, this class can be used to support both.<br />

To create a null Date object, use the syntax:<br />

Date();<br />

To create a copy of a Date object, use the syntax:<br />

Date(const Date &a);<br />

To create a Date object using integer parameters, where:<br />

Variable Value<br />

year -4712 to 9999, except 0<br />

month 1 to 12<br />

day 1 to 31<br />

minutes 0 to 59<br />

seconds 0 to 59<br />

use the syntax:<br />

Date(const Environment *envp,<br />

int year = 1,<br />

unsigned int month = 1,<br />

unsigned int day = 1,<br />

unsigned int hour = 0,<br />

unsigned int minute = 0,<br />

unsigned int seconds = 0);<br />

Objects from the Date class can be used as standalone class objects in client side<br />

numerical computations and also used to fetch from and set to the database.<br />

OCCI Classes and Methods 8-49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!