US20020046201A1 - Defining object classes to match corresponding specialized data types in a relational database - Google Patents

Defining object classes to match corresponding specialized data types in a relational database Download PDF

Info

Publication number
US20020046201A1
US20020046201A1 US09/163,505 US16350598A US2002046201A1 US 20020046201 A1 US20020046201 A1 US 20020046201A1 US 16350598 A US16350598 A US 16350598A US 2002046201 A1 US2002046201 A1 US 2002046201A1
Authority
US
United States
Prior art keywords
value
class
string
icbcdecimal
date
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
US09/163,505
Other versions
US6397203B1 (en
Inventor
Douglas Michael Hembry
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by International Business Machines Corp filed Critical International Business Machines Corp
Priority to US09/163,505 priority Critical patent/US6397203B1/en
Assigned to INTERNATIONAL BUSINESS MACHINES CORPORATION reassignment INTERNATIONAL BUSINESS MACHINES CORPORATION ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: HEMBRY, DOUGLAS MICHAEL
Publication of US20020046201A1 publication Critical patent/US20020046201A1/en
Application granted granted Critical
Publication of US6397203B1 publication Critical patent/US6397203B1/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/289Object oriented databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99931Database or file accessing
    • Y10S707/99932Access augmentation or optimizing

Definitions

  • the present invention relates generally to computerized methods for accessing databases, and in particular, to a method for defining object classes to match corresponding specialized data types stored in a relational database.
  • Object-oriented programming has become increasingly popular among software developers, because it offers the benefits of increased application program portability, interoperability, and interchangeability. Object-oriented programming techniques also reduce development risk and software development costs, and can extend the life cycle of the final product to prevent premature obsolescence.
  • CORBA Common Object Request Broker Architecture
  • a central component of CORBA is an Object Request Broker (ORB), which functions as a communications infrastructure, transparently transceiving object requests across distributed heterogeneous computing environments. This is accomplished through a well-defined interface called the Interface Definition Language (IDL). Further details regarding CORBA and IDL are set forth in “The Essential CORBA, Systems Integration Using Distributed Objects,” by Thomas W. Mobray and Ron Zahavi, 1995, which publication is incorporated by reference herein.
  • ORB Object Request Broker
  • IDL Interface Definition Language
  • Class libraries are available to support object-oriented programming environments such as CORBA. These class libraries allow users to generate application programs using previously-defined classes.
  • class libraries include classes for manipulating specialized data types such as date, decimal, duration, time, and timestamp data types.
  • these class libraries do not specifically match the semantics of specialized data types retrieved from relational databases.
  • the semantics of these specialized data types are available only through calls to a relational database management system.
  • object-oriented application programs cannot access and manipulate specialized type data values from relational databases according to the object-oriented programming paradigm.
  • the present invention discloses a method, apparatus, and article of manufacture for defining object classes to match corresponding specialized data types stored in a relational database.
  • An object-oriented application program may create an instance of a class for the purpose of representing data in a relational table that comprise a specialized data type.
  • the attributes and behavior of the specialized data type in the database are preserved, where appropriate, in the corresponding class, and are available to the application program.
  • FIG. 1 is a block diagram illustrating an exemplary hardware environment used to implement the preferred embodiment of the present invention
  • FIG. 2 is a block diagram that further illustrates the structure of a Component Broker according to the present invention.
  • FIG. 3 is a flowchart illustrating the logic performed by an Application Program, Component Broker, and Relational Database Management System according to the preferred embodiment of the present invention.
  • the present invention provides a method for accessing a relational database using object-oriented techniques by modeling specialized data types within the database using specific object classes.
  • the present invention allows an object-oriented application program to create an instance of a class for the purpose of representing data in a relational table that comprise a specialized data type.
  • the attributes and behavior of the specialized data type in the database are preserved, where appropriate, in the corresponding class, and are available to the application program.
  • FIG. 1 is a block diagram illustrating an exemplary hardware environment used to implement the preferred embodiment of the invention.
  • a client computer 100 communicates with a server computer 102 .
  • Both the client computer 100 and the server computer 102 are typically comprised of one or more processors, random access memory (RAM), read-only memory (ROM), and other components such data storage devices and data communications devices.
  • RAM random access memory
  • ROM read-only memory
  • the client computer 100 executes one or more computer programs 104 operating under the control of an operating system. These computer programs 104 transmit requests to the server computer 102 for performing various functions and receive data from the server computer 102 in response to the requests.
  • the server computer 102 also operates under the control of an operating system, and executes one or more computer programs 106 , 108 , and 110 . These computer programs 106 , 108 , and 110 receive requests from the client computer 100 for performing various functions and transmit data to the client computers 100 in response to the requests.
  • the server computer 102 manages one or more databases 112 stored on one or more data storage devices (such as a fixed or hard disk drive, a floppy disk drive, a CD-ROM drive, a tape drive, or other device).
  • the database 112 is managed by the DB2TM relational database management system (RDBMS) offered by IBM Corporation.
  • RDBMS relational database management system
  • the preferred embodiment of the present invention is generally implemented using five major components executed by client computers 100 and server computers 102 , including a Client Program 104 , Application Program 106 , Component Broker 108 (which comprises a variant of an Object Request Broker), relational database management system (RDBMS) 110 , and database 112 , wherein each of these components comprise instructions and/or data.
  • the Client Program 104 provides a user interface
  • the Application Program 106 performs application functions
  • the Component Broker 108 materializes data retrieved from the database 112 as objects
  • the database management system 110 controls access to the database 112 .
  • these instructions and/or data 104 - 112 are all tangibly embodied in or retrievable from a computer-readable device, medium, or carrier, e.g., a memory, a data storage device, a remote device coupled to the computer via a data communications device, etc.
  • a computer-readable device, medium, or carrier e.g., a memory, a data storage device, a remote device coupled to the computer via a data communications device, etc.
  • these instructions and/or data when read, executed, and/or interpreted by the client computer 100 and/or server computer 102 , causes the client computer 100 and/or server computer 102 to perform the steps necessary to implement and/or use the present invention.
  • the present invention may be implemented as a method, apparatus, or article of manufacture using standard programming and/or engineering techniques to produce software, firmware, hardware, or any combination thereof
  • article of manufacture (or alternatively, “computer program product”) as used herein is intended to encompass logic and/or data embodied in any device, medium, or carrier.
  • FIG. 2 is a block diagram that further illustrates the structure of the Component Broker 112 according to the present invention.
  • the Component Broker 112 provides a suite of tools that allows the user to write computer programs in an object-oriented programming context.
  • the Component Broker 112 interacts with the Application Program 106 .
  • the Component Broker 112 could interact with the Client Program 104 as well.
  • the Component Broker 112 is used to create and work with components 200 , wherein a component 200 is a distributed set of objects that an Application Program 106 can access as a single entity and which work together to represent the logic and data relationships that perform a desired function for the Application Program 106 .
  • the component 200 generally comprises a business object 202 and a data object 204 , although other elements may be present as well.
  • Business objects 202 include one or more methods and one or more attributes that are used directly by the Application Program 106 .
  • Data objects 204 also include one or more methods and one or more attributes that are used directly by the business objects 202 (and this indirectly by the Application Program 106 ).
  • Business objects 202 and data objects 204 are independent of any individual Application Program 106 and can be used in any combination to perform a desired task.
  • a business object 202 may also have relationships with other business objects 202 and can cooperate with these other business objects 202 to perform a desired task.
  • Data objects 204 have direct access to data stored in the relational database 112 and are responsible for managing the persistence of state data for the component 200 .
  • the data object 204 isolates the business object 202 from the details of the RDBMS 110 and relieves it from having to keep track of how to access and manage the data while maintaining persistency.
  • An Application Program 106 may access the data stored in the relational database 112 by interacting with business objects 202 , which in turn interact with data objects 204 , which in turn transmit requests to the RDBMS 110 using SQL functionality.
  • the data object 204 will generally have member functions that generate the appropriate SQL statements, package the statements, and forward them to the RDBMS 110 for execution, receive and process the results, and then return the results to the business objects 202 , which ultimately provides access to the results to the Application Program 106 .
  • each column of a relational table 112 has a respective data type.
  • Traditional data types include integer, floating point, logical, fixed length character, and variable length character data types.
  • Some specialized data types include date, decimal, duration, time, and timestamp.
  • SQL statements include expressions or functions, that permit manipulation of the specialized data types. A description of specialized data types and their associated expressions or functions can be found in the publication by IBM Corporation entitled DB 2 Universal Database SQL Reference V. 5, S1OJ-8165-00, pp. 143-156, Copyright 1993, 1997.
  • the Component Broker 108 provides helper classes 206 , 208 , 210 , 212 , and 214 that emulate the semantics of the corresponding specialized data types for use in various operations, such as comparison operations, arithmetic operations, etc.
  • these classes 206 , 208 , 210 , 212 , and 214 include:
  • ICBCDate Class 206 (representing the Date type).
  • ICBCDecimal Class 208 (representing the Decimal type).
  • ICBCDuration Class 210 (representing the Date Duration, Time Duration,
  • Timestamp duration and Labeled Duration types.
  • the Duration data type is complementary to the Date, Time, and Timestamp classes, but is not, itself, stored in tables in the relational database 112 .
  • ICBCTime Class 212 (representing the Time type).
  • ICBCTimestamp Class 214 (representing the Timestamp type).
  • ICBC IBM Component Broker Class
  • Each helper class 206 , 208 , 210 , 212 , and 214 provides a public interface (i.e., IDL) for accessing the attributes and for invoking the methods or member functions of the class.
  • the public interface of the class is designed to match the characteristics and usage of the particular specialized data type in the RDBMS 110 .
  • methods or member functions performed by these classes 206 , 208 , 210 , 212 , and 214 produce the same results as equivalent SQL expressions evaluated by the RDBMS 110 .
  • the Application Program 106 uses the helper class objects 206 , 208 , 210 , 212 , and 214 to manipulate Dates, Decimals, Durations, Times, or Timestamps whenever it is desirable that the results should be consistent with those that would be produced by the RDBMS 110 itself.
  • helper classes 206 , 208 , 210 , 212 , and 214 are implemented in accordance with specialized data types and associated expressions or functions found in the DB2TM RDBMS 110 sold by IBM Corporation.
  • the classes 206 , 208 , 210 , 212 , and 214 can be implemented to accommodate specialized data types from any RDBMS 110 , such as those offered by ORACLETM, SYBASETM, MICROSOFTTM, etc.
  • helper classes 206 , 208 , 210 , 212 , and 214 Descriptions of the helper classes 206 , 208 , 210 , 212 , and 214 , and a list of at least some of their methods or member functions are provided below.
  • Programming Language Appendix included below provides additional descriptions of the various attributes and methods associated with the helper classes 206 , 208 , 210 , 212 , and 214 .
  • the ICBCDate Class 206 stores the value of a calendar date between Jan. 01, 0001 and Dec. 31, 9999. All access and manipulation of this date is through a public functional interface. The actual date value and its format are stored in private attributes.
  • ICBCDate Class 206 assumes the proleptic Gregorian calendar.
  • the Gregorian calendar in use today is assumed to extend back to year 0001 and it is the responsibility of the application to apply any corrections that may be required for dates prior to the Gregorian calendar reform.
  • the ICBCDate Class 206 includes a number of different methods such as object initialization, comparisons, query functions, and manipulation functions.
  • the object initialization methods include initializeFromString, initializeFromNumber, initializeFromTimestamp, and initializeFromValues methods.
  • the comparison methods include equalTo, notEqualTo, lessThan, lessThanOrEqualTo, greaterThan, and greaterThanOrEqualTo.
  • the query functions methods include OutputFormat, formattedString, day, dayOfWeek, dayOfYear, julianDay, modifiedJulianDay, dayName, dayFromString, dayOfWeekFromString, dayOfYearFromString, julianDayFromString, modifiedJulianDayFromString, dayNameFromString, dayNameFromNumber, month, monthName, monthFromString, monthNameFromString, monthNameFromNumber, quarter, quarterFromstring, year, yearFromString, isLeapYear, daysInObject, daysInString, daysInMonth, daysInYear, isValidMonthDayYear, isValidYearDay, and isObjectChanged.
  • the manipulation methods include assignFromDate, increment, decrement, dateOverflow, intervalFromDate, intervalFromString, and intervalFromLong.
  • the ICBCDecimal Class 208 stores the value of a Decimal data type (from a DB2TM RDBMS 110 ) or number type (from an ORACLETM RDBMS 110 ) in which scale is less than or equal to precision, and positive with a specified maximum precision (e.g., 38 ). All access and manipulation of this value is through a public functional interface. The actual decimal value and its precision and scale are stored in private attributes.
  • the ICBCDecimal Class 208 includes a number of different methods such as object initialization, comparisons, query functions, and manipulation functions.
  • the object initialization methods include initializeFromString1, initializeFromString2, initializeFromDouble, initializeFromFloat, initializeFromLong, initializeFromShort, initializeFromDecimal1, initializeFromDecimal2, and initializeFromPackedDecimal.
  • the comparison methods include equalTo, notEqualTo, lessThan, lessThanOrEqualTo, greaterThan, and greaterThanOrEqualTo.
  • the query functions methods include getAsFormattedString1, getAsFormattedString2, getAsFormattedString3, getAsDouble, getAsFloat, getAsLong, getAsShort, getAsDigits, getAsPackedDecimal, getPrecision, getScale, isNegative, and isChanged.
  • the manipulation methods include assignFromDecimal, assignFromDouble, assignFromFloat, assignFromLong, assignFromShort, increment, decrement, multiplyThisObjectBy, divideThisObjectBy, remainderInThisObject, addWithNewObject, subtractWithNewObject, multiplyWithNewObject, divideWithNewObject, remainderWithNewObject, getPrecedingRemainder, swapSign, and decimalOverflow.
  • the ICBCDuration Class 210 represents the “Labeled Duration”, “Date Duration”, “Time Duration”, and “Timestamp Duration” constructs of Duration. Duration is complementary data type to Date, Time, and Timestamp, and participates in expressions in SQL statements. However, it is not, itself, stored in tables in the relation database 112 .
  • the Class 210 holds the value of a duration, and a record of whether this duration value is in units of years, months, days, hours, minutes seconds, or microseconds.
  • the value can also be of a composite type defining a “Date Duration” of the form yyyymmdd, a “Time Duration” of the form hhmmss, or a “Timestamp Duration” of the form yyyymmddhhmmsszzzzzzzz.
  • arithmetic between two ICBCDuration Class 210 objects is not supported (which is consistent with DB2TM support of Durations). However, they can be compared, and a unary minus operator (which swaps the sign) is provided.
  • the ICBCDuration Class 210 includes a number of different methods such as object initialization, comparisons, query functions, and manipulation functions
  • the object initialization methods include initializeLabeledDuration, initializeDateTimeDuration, and initializeTimestampDuration.
  • the comparison methods include equalTo, notEqualTo, lessThan, lessThanOrEqualTo, greaterThan, and greaterThanOrEqualTo.
  • the query functions methods include isNegative, microsecond, second, minute, hour, day, month, year, size, and formattedString.
  • the manipulation function methods include assignFromDuration, and swapSign.
  • the ICBCTime Class 212 stores the value of a time-of-day. All access and manipulation of this time is through a public functional interface. The actual time value and its format are stored in private attributes.
  • the ICBCTime Class 212 includes a number of different methods such as object initialization, comparisons, query functions, and manipulation functions.
  • the object initialization methods include initializeFromString, intializeFromTimestamp, and initializeFromValues.
  • the comparison methods include equalTo, notEqualTo, lessThan, lessThanOrEqualTo, greaterThan, and greaterThanOrEqualTo.
  • the query functions methods include second, minute, hour, and isObjectChanged.
  • the manipulation functions methods include assignFromTime, increment, decrement, timeOverflow, intervalFromTime, and intervalFromString.
  • the ICBCTimestamp Class 214 stores the value of a Timestamp type (from a DB2TM RDBMS 110 ) or a DATE type (from an ORACLETM RDBMS 110 ). All access and manipulation of this timestamp is through a public functional interface; the actual timestamp value is stored in private attributes.
  • a Timestamp attribute in a business object 204 that originates from the database 112 is represented by Component Broker 108 as a 26 character string of form yyyy-mm-dd-hh.mm.ss.mmmm. This string can be used to initialize an instance of the ICBCTimestamp Class 214 through the initializeFromString function.
  • a DATE attribute that originates from an ORACLETM database 112 is represented by Component Broker 108 in the same 26 character form yyyy-mm-dd-hh.mm.ss.mmmmmm but with the final six characters (the microseconds field) always set to zeros.
  • This string can be used to initialize an instance of the ICBCTimestamp Class 214 via initializeFromString function.
  • ORACLETM dates earlier than Jan. 01, 0001 are rejected.
  • ICBCTimestamp applies DB2TM semantics in its processing of the data.
  • the ICBCTimestamp Class 214 includes a number of different methods such as object initialization, comparisons, query functions, and manipulation functions.
  • the object initialization methods include initializeFromString, initializeFromDateTime, initializeFromDate, initializeFromTime, and initializeFromDatastoreFormat.
  • the comparison methods include equalTo, notEqualTo, lessThan, lessThanOrEqualTo, greaterThan, and greaterThanOrEqualTo.
  • the query functions methods include formattedString, getAsDateFormattedString, getAsTimeFormattedString, getAsDatstoreFormat, microsecond, second, minute, hour, day, month, year, dayOfWeek, dayOfYear, julianDay, modifiedJulianDay, dayName, dayFromString, dayOfWeekFromString, dayOfYearFromString, julianDayFromString, modifiedJulianDayFromString, dayNameFromString, dayNameFromNumber, monthName, monthFromString, monthNameFromString, monthNameFromNumber, quarter, quarterFromString, yearFromString, isLeapYear, daysInObject, daysInString, daysInMonth, daysInYear, and isObjectChanged.
  • the manipulation functions methods include assignFromTimestamp, increment, decrement, timestampOverflow, intervalFromTimestamp, and intervalFromString.
  • FIG. 3 is a flowchart illustrating the logic performed by the Application Program 106 , Component Broker 108 , and RDBMS 110 according to the preferred embodiment of the present invention.
  • Block 300 represents the Component Broker 108 instantiating one or more of the helper classes 206 , 208 , 210 , 212 , and 214 as objects. Generally, this step is performed in response to a request from the Application Program 106 , although other events may trigger this step as well.
  • Block 302 represents the Component Broker 108 retrieving one or more tuples comprised of at least a Date, Decimal, Duration, Time, or Timestamp column or attribute from a table in the relational database 112 .
  • This retrieval step is performed via the data object 204 within the Component Broker 108 , wherein the data object 204 has member functions that generate appropriate SQL statements, package the statements, and forward them to the RDBMS 110 for execution.
  • Block 304 represents the Component Broker 108 storing the requested data retrieved from the table in the relational database 112 as a string attribute in a business object 202 .
  • This storage step is also performed via the data object 204 within the Component Broker 108 , wherein the data object 204 has member functions that receive and process the results from the execution of the SQL statements by the RDBMS 110 , and then return the results to the business objects 202 .
  • Block 306 represents the Application Program 106 retrieving the string attribute from the business object 202 in the Component Broker 108 .
  • Block 308 represents the Application Program 106 using the retrieved string attribute to initialize one or more of the helper class objects 206 , 208 , 210 , 212 , or 214 in the Component Broker 108 .
  • Block 310 represents the Application Program 106 performing one or more various operations, such as object initialization, comparisons, query functions, manipulation functions, arithmetic operations, etc., on the helper class objects 206 , 208 , 210 , 212 , or 214 .
  • Block 312 represents the Application Program 106 extracting the string attribute from the helper class objects 206 , 208 , 210 , 212 , or 214 in the Component Broker 108 .
  • Block 314 represents the Application Program 106 updating the attribute in the business object 202 using the extracted string attribute.
  • Block 316 represents the Component Broker 108 storing the updated string attribute from the business object 202 into the relational database 112 . This storing step is performed via the data object 204 within the Component Broker 108 , wherein the data object 204 has member functions that generate appropriate SQL statements, package the statements, and forward them to the RDBMS 110 for execution.
  • the present invention discloses a method, apparatus, and article of manufacture for defining object classes to match corresponding specialized data types stored in a relational database.
  • An object-oriented application program may create an instance of a class for the purpose of representing data in a relational table that comprise a specialized data type.
  • the attributes and behavior of the specialized data type in the database are preserved, where appropriate, in the corresponding class, and are available to the application program.
  • the class stores the value of a calendar date between Jan. 01, 0001 and Dec. 31, 9999. All access and manipulation of this date is through a public functional interface. The actual date value and its format are stored in private attributes.
  • ICBCDate assumes the proleptic Gregorian calendar.
  • the Gregorian calendar in use today is assumed to extend back to year 0001 and it is the responsibility of the application to apply any corrections that may be required for dates prior to the Gregorian calendar reform.
  • ICBCDate IManagedLocal::ILocalOnly ⁇ // Object initialization boolean initializeFromString(in string aDate); boolean initializeFromNumber(in long aDate); boolean initializeFromTimestamp(in ICBCTimestamp aTimestamp); boolean initializeFromValues(in long aYear, in long aMonth, in long aDay); // Comparisons boolean equalTo(in ICBCDate aDate); boolean notEqualTo(in ICBCDate aDate); boolean lessThan(in ICBCDate aDate); boolean lessThanOrEqualTo(in ICBCDate aDate); boolean greaterThan(in ICBCDate aDate); boolean greaterThanOrEqualTo(in ICBCDate aDate); // Query functions enum OutputFormat ⁇
  • ICBCDate assignFromDate (in ICBCDate aDate);
  • the input string parameter must conform to a format recognizable as a date. Refer to IBCDate::initializeFromString( ) for a description of supported formats. If the input parameter is not recognizable, a value of ⁇ 1 is returned.
  • [0165] Returns a string containing the name of the day of the week for the day number within a week provided in the input parameter.
  • the input parameter must be a number between 1 and 7. Sunday is day number 1.
  • the input string parameter must conform to a format recognizable as a date. Refer to ICBCDate::initializeFromString for a description of supported formats. If the input parameter is not recognizable, a value of ⁇ 1 is returned.
  • the input string parameter must conform to a format recognizable as a date. Refer to ICBCDate::initializeFromString for a description of supported formats. If the input parameter is not recognizable, a value of ⁇ 1 is returned.
  • Month number must be between 1 and 12.
  • the string must be one of the following:
  • This operation is performed essentially as the inverse of ICBCDate::increment.
  • the date is decremented by the specified number of days, months, and years (in this order). If the years value of the result of an decrement operation is less than 0001 years, the years value of the result is set to 0001 and the number of underflow years can be retrieved as a negative number using ICBCDate::dateOverflow. The number of overflow years is cleared by the next assignFromDate or arithmetic operation on the object.
  • the application must supply a non-const pointer to a target storage area long enough to receive the formatted date.
  • the function returns a reference to this area
  • years value of the result of an increment operation is greater than 9999 years, then the years value of the result is set to 9999, and the number of overflow years can be retrieved using the dateOverflow( ) function. The number of overflow years is cleared by the next assignFromDate of arithmetic operation on the object.
  • the yyyyddd string must consist of entirely numeric characters with padding zeros where necessary—embedded signs or blanks are not allowed. However leading and trailing blanks are acceptable provided the string length is less than 20 characters. Only SBCS characters may be present in the string.
  • the yyyymmdd string must consist of entirely numeric characters with padding zeros where necessary—embedded signs or blanks are not allowed. However leading and trailing blanks around the string are acceptable provided the string length is less than 20 characters. Only SBCS characters may be present in the string.
  • a valid punctuated string representation of a date in one of the following valid forms:
  • JIS Japanese Industrial Standard Christian Era
  • Leading and trailing blanks are acceptable provided the string length is less than 20 characters. Leading zeros may be omitted from the month and day portions. Only SBCS characters may be present in the string.
  • a punctuated string yyyy-mm-dd-hh.mm.ss.nnnnnn.
  • a 14 byte string without puctuation of the form: yyyymmddhhmmss.
  • DAY(RESULT) DAY(DATE1)-DAY(DATE2).
  • DAY(RESULT) N+(DAY(DATE1) ⁇ DAY(DATE2)
  • ICBCDate :isValidMonthDayYear
  • MJD Modified Julian day number
  • MJD Modified Julian day number
  • the input string parameter must conform to a format recognizable as a date. Refer to ICBCDate::initializeFromString for a description of supported formats. If the input parameter is not recognizable, a value of ⁇ 1 is returned.
  • the class stores the value of a DB2 Decimal data type, or Oracle number type in which scale is less than or equal to precision, and positive with a maximum precision of 38. All access and manipulation of this value is through a public functional interface.
  • the actual decimal value and its precision and scale are stored in private attributes. Important Throughout the description of ICBCDecimal, precision is the total number of digits in the decimal number; scale is the number of digits in the fractional part of the number - - - the number of digits that lie to the right of the decimal point.
  • ICBCDecimal create
  • the scale is: max(s1, s2)
  • the scale of the source object is reduced to fit the scale of the receiving object, if necessary, by truncating digits from the right.
  • the change flag of the receiving object is set to TRUE.
  • the operand is converted to a temporary decimal object of precision 38. Numbers less than 0.5E-38 will be rounded to zero. The temporary decimal number is then converted to the precision and scale of the receiving ICBCDecimal object.
  • the operand is converted to a temporary decimal object of precision 38. Numbers less than 0.5E-38 will be rounded to zero. The temporary decimal number is then converted to the precision and scale of the receiving ICBCDecimal object.
  • the operand is converted to a temporary decimal number, of precision 11 which is then converted to the precision and scale of the receiving object.
  • decimalOverflow( ) function If the non-zero digits to the left of the decimal point in the source object exceed (p1 ⁇ s1) of the receiving object (i.e., the whole number portion of the source object will not fit in the receiving object), the receiving object is unchanged, and a following invocation of decimalOverflow( ) function will return the value TRUE on the receiving object.
  • the operand is converted to a temporary decimal number, of precision 5 which is then converted to the precision and scale of the receiving object.
  • this function indicates whether an overflow did, in fact, take place. If the most recent initialization, assignment, or arithmetic operation caused an overflow, this function will return TRUE. Otherwise it returns FALSE. Intervening query or comparison operations will not affect the returned value.
  • the change flag of the receiving object is set to TRUE.
  • decimalOverflow( ) is used to warn of zeroDivide situations, returning TRUE if a zeroDivide occured in the preceding divideThisObjectBy( ) function, and FALSE if it did not.
  • the change flag of the receiving object is set to TRUE. For example, 200.00 (precision 5, scale 2) divided by 3.00 (precision 3, scale 2) returns a quotient of precision 38 and scale 33:
  • ICBCDecimal divideThisObjectBy(in ICBCDecimal aDecimal);
  • the scale is: 38 ⁇ p1+s1 ⁇ s2
  • This function does not cause any overflow conditions, but may encounter a zeroDivide situation. If so, or if other errors occured that prevented the creation of the new object, an ICBCDecimal pointer with value ⁇ 1 is returned.
  • the application must supply a non-const pointer to a target storage area long enough to receive the formatted decimal number.
  • the function returns a reference to this area.
  • aDecimalCharacter must be a single character to be used as the “decimal point” character in the output. The characters plus (+) and minus ( ⁇ ) are not permitted, and blanks are not permitted.
  • the length of the output string is always precision +2, where precision is the current precision of the object.
  • One of the additional character positions is always used for the decimal point. If required, the the additional character position is used for a leading sign. If a sign is not required, the output string will have a trailing blank. Leading and trailing padding zeros are provided if necessary to fill the current precision and scale of the object.
  • ADecimalCharacter must be a single character to be used as the “decimal point” character in the output.
  • the characters plus (+) and minus ( ⁇ ) are not permitted, and blanks are not permitted.
  • the length of the output string is always precision +2, where precision is the current precision of the object.
  • the leftmost character position is reserved for the sign, if necessary.
  • the following positions contain the the number, with an embedded decimal point, which is always present, even if the scale of the number is zero.
  • the digits in the number are padded with leading blanks and trailing zeros to fill the full current precision and scale of the object. Finally, if leading blanks are present, the sign moves to a position immediately adjacent to the first digit (or decimal point).
  • the application must supply a non-const pointer to a target storage area long enough to receive the formatted decimal number.
  • the function returns a reference to this area.
  • aDecimalCharacter must be a single character to be used as the “decimal point” character in the output. The characters plus (+) and minus ( ⁇ ) are not permitted, and blanks are not permitted.
  • the length of the output string is variable, containing only enough characters to hold the significant digits plus a sign and a decimal point if required. The precision and scale of the object are not reflected in the length output string.
  • This format is suitable for providing to the Oracle TO_NUMBER function without the need for an associated “NUMBER format element” parameter.
  • null terminated string of length equal to the precision of the object, containing the digits in the value of the object, left justified, and without either decimal point or sign. Leading zeros are provided if necessary.For example, an object of precision and scale of 6 and 2 respectively, containing a value of ⁇ 6.28 would return a string containing ‘000628’.
  • the application must supply a non-const pointer to a target storage area long enough to receive the digits and null terminator.
  • the function returns a reference to this area.
  • [0585] where [ ] denotes a single byte containing two 4-bit nibbles, d is a four-bit binary digit, 0 is a 4-bit binary zero, and s is a 4-bit sign representation.
  • a hexadecimal value “C” denotes the positive sign, and “D” the negative sign.
  • a sign is always present in the lower order four bits of the rightmost byte.
  • this function is a more efficient way of obtaining the remainder than issuing a remainderInThisObject( ) or remainderWithNewObject( ).
  • This function retrieves the remainder that was cached in the object as a by-product of the preceding divide operation, whereas the latter two functions perform an implicit divide to calculate the remainder.
  • Precision the maximum number of digits that make up the value of the object.
  • Precision is conceptually similar to the precision of a DB2 column. For example, an object with precision and scale of 5 and 2 respectively can store numbers up to value 999.99, but could not store numbers 1000.00, nor 999.991, nor 99.991. Precision is set by an ICBCDecimal::initialize..( ) function, and is generally retained by the object through its lifetime unless changed by arithmetic functions.
  • precision must be a number between zero and 38. If zero, a default value of 15 is assumed, scale must be a number between C and the value of precision. If precision is zero, the value of scale is ignored and the scale of the object is taken to be zero.
  • the value of precision—scale must be sufficient to contain the digits to the left of the decimal point in the source ICBCDecimal object. If scale is insufficient to contain the digits to the right of the decimal point, those digits will be truncated from the right.
  • This function has no explicit parameters for precision and scale.
  • the precision and scale of the receiving object are set to the same values as the source Decimal object.
  • Precision must be a number between zero and 38. A zero value implies that the application is not supplying values for precision or scale. In this case, a default value of 15 is assumed.
  • Scale must be a number between 0 and the value of precision. If precision is zero, the value of scale is ignored and a value of zero is assumed.
  • TRUE is returned and any existing value in the object is replaced. If the initialization cannot be performed, FALSE is returned and the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE.
  • Precision and scale must be such that (precision—scale) is sufficient to contain the digits to the left of the decimal point in the numeric operand. If scale is insufficient to contain the digits to the right of the decimal point, those digits will be truncated from the right.
  • Precision must be a number between zero and 38. A zero value implies that the Precision application is not supplying values for precision or scale. In this case, a default value of 15 is assumed.
  • Scale must be a number between 0 and the value of precision. If precision is zero, the value of scale is ignored and a value of zero is assumed.
  • TRUE is returned and any existing value in the object is replaced. If the initialization cannot be performed, FALSE is returned and the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE.
  • Precision and scale must be such that (precision—scale) is sufficient to contain the digits to the left of the decimal point in the numeric operand. If scale is insufficient to contain the digits to the right of the decimal point, those digits will be truncated from the right.
  • Precision must be a number between zero and 38. A zero value implies that the Precision application is not supplying values for precision or scale. In this case, a default value of 11 is assumed.
  • Scale must be a number between 0 and the value of precision. If precision is zero, the value of scale is ignored and a value of zero is assumed.
  • TRUE is returned and any existing value in the object is replaced. If the initialization cannot be performed, FALSE is returned and the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE.
  • Precision and scale must be such that (precision—scale) is sufficient to contain the digits in the numeric operand.
  • [0692] Where [ ] denotes a byte containing two 4-bit “nibbles”, d is a four-bit binary digit, 0 is a 4-bit binary zero, and s is a 4-bit sign representation.
  • the hexadecimal value “C” is interpreted as the positive sign, and “D” as the negative sign. There is no embedded decimal point.
  • the scale of the object is defined by the scale input argument aScale.
  • the number of digits unpacked from aString is defined by the aPrecision argument.
  • the sign is always present in the lower order four bits of the rightmost byte. Because of the presence of the sign, and the packing of two digits per byte, strings with an even number of bytes will have a leading zero padding character.
  • This parameter must be a number between 0 and the value of precision. It indicates the number of digits that lie to the right of the decimal point. It must always be present.
  • Precision must be a number between zero and 38. A zero value implies that the application is not supplying values for precision or scale. In this case, a default value of 5 is assumed.
  • Scale must be a number between 0 and the value of precision. If precision is zero, the value of scale is ignored and a value of zero is assumed.
  • TRUE is returned and any existing value in the object is replaced. If the initialization cannot be performed, FALSE is returned and the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE.
  • Precision and scale must be such that (precision—scale) is sufficient to contain the digits in the numeric operand.
  • decimalChar must be a single character that is used in aString to represent the decimal point. The characters plus (+) and minus ( ⁇ ) are not permitted, and blanks are not permitted.
  • Precision must be a number between zero and 38. If the value is zero, a default precision of 15 and a default scale of zero are used (the parameter for scale is ignored in this case). Otherwise the parameter values for precision and scale are used.
  • Scale must be a number between 0 and the value of precision. It indicates the number of digits that lie to the right of the decimal point. Note that if the parameter precision is zero, the value of scale is ignored and a default scale of zero is used.
  • Precision and scale must be such that (precision—scale) is sufficient to contain the non-zero characters to the left of the decimal point in aString. If scale is insufficient to contain the characters to the right of the decimal point, those characters will be truncated from the right.
  • the precision and scale of the object are set to the actual precision and scale of the string parameter.
  • the precision is the total number of digits, including leading and trailing zeros.
  • the scale is the number of digits to the right of the decimal point, including trailing zeros. In other respects, this function behaves the same as ICBCDecimal::initializeFromString1( ).
  • the change flag of the receiving object is set to TRUE.
  • ICBCDecimal multiplyThisObjectBy(in ICBCDecimal aDecimal);
  • the change flag of the receiving object is set to TRUE.
  • the precision is: 38.
  • the scale is: 38 ⁇ p1+s1
  • the scale is: 38 ⁇ p1+s1
  • This function does not cause any overflow conditions, but may encounter a zeroDivide situation. If so, or if errors occur that prevent the recreation of the new object, a ICBCDecimal pointer with value ⁇ 1 is returned.
  • the scale is: max(s1, s2)
  • This function is effectively a unary minus operator which reverses the sign of this ICBCDecimal object.
  • the class ICBCDuration represents the “Labeled Duration”, “Date Duration”, “Time Duration”, and “Timestamp Duration” constructs of DB2. Duration is a complementary data type to Date, Time, and Timestamp, and participates in SQL expressions. However, it is not, itself, stored in DB2 tables.
  • the class holds the value of a duration, and a record of whether this duration value is in units of years, months, days, hours, minutes seconds, or microseconds.
  • the value can also be of a composite type defining a “Date Duration” of the form yyyymmdd, a “Time Duration” of the form hhmmss, or a “Timestamp Duration” of the form yyyymmddhhmmsszzzzzzzz.
  • the application must supply a non-const pointer to a target storage area long enough to receive the formatted date.
  • the function returns a reference to this area, enabling the function to be nested in stream operations.
  • [0870] Accepts three numeric values, an indicator of the sign of the duration (positive or negative) and an indicator of the duration type.
  • aValue1 aValue2, aValue3 must supply valid values for years, months, and days, respectively. Each value must be a positive number, or zero. If the supplied parameters are valid, returns TRUE, else returns FALSE.
  • type indicator is TIME, then aValue1, aValue2, aValue3 must supply valid values for hours, minutes, and seconds, respectively.
  • Each value must be a positive number, or zero. If the supplied parameters are valid, returns TRUE, else returns FALSE.
  • the type indicator can be: YEARS, MONTHS, DAYS, HOURS, MINUTES, SECONDS, MICROSECONDS.
  • the supplied values must be a positive number or zero. If the numeric value is valid, returns TRUE, otherwise returns FALSE. If the values are valid, any existing value in the object is replaced.
  • numeric values represent the years, months, days, hours, minutes, seconds, and microseconds portions of the timestamp duration. They must be positive numbers or zeros. If the supplied parameters are valid, returns TRUE, else returns FALSE.
  • This function is effectively a unary minus operator which reverses the sign of this ICBCDuration object.
  • the class stores the value of a time-of-day. All access and manipulation of this time is through a public functional interface. The actual time value and its format are stored in private attributes.
  • the application must supply a non-const pointer to a target storage area long enough to receive the formatted time.
  • the function returns a reference to this area.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method, apparatus, and article of manufacture for defining object classes to match corresponding specialized data types stored in a relational database. An object-oriented application program may create an instance of a class for the purpose of representing data in a relational table that comprise a specialized data type. The attributes and behavior of the specialized data type in the database are preserved, where appropriate, in the corresponding class, and are available to the application program.

Description

    BACKGROUND OF THE INVENTION
  • 1. Field of the Invention [0001]
  • The present invention relates generally to computerized methods for accessing databases, and in particular, to a method for defining object classes to match corresponding specialized data types stored in a relational database. [0002]
  • 2. Description of Related Art [0003]
  • It is well known in the art to use database management systems, such as IBM's DB2™ relational database management system (RDBMS), to manage computerized databases. Currently, there is a need to access such databases using object-oriented application programs. [0004]
  • Object-oriented programming has become increasingly popular among software developers, because it offers the benefits of increased application program portability, interoperability, and interchangeability. Object-oriented programming techniques also reduce development risk and software development costs, and can extend the life cycle of the final product to prevent premature obsolescence. [0005]
  • An industry-consensus standard interface definition for interoperable object-oriented software, known as the Common Object Request Broker Architecture (CORBA), has been defined. CORBA simplifies the development and deployment of distributed systems software in several ways. First, CORBA defines a distributed environment using an object-oriented paradigm that hides differences between programming languages, operating systems, and object locations. Second, CORBA's object-oriented approach allows diverse types of implementations to inter-operate at the same level, hiding idiosyncrasies, and supporting reuse. [0006]
  • A central component of CORBA is an Object Request Broker (ORB), which functions as a communications infrastructure, transparently transceiving object requests across distributed heterogeneous computing environments. This is accomplished through a well-defined interface called the Interface Definition Language (IDL). Further details regarding CORBA and IDL are set forth in “The Essential CORBA, Systems Integration Using Distributed Objects,” by Thomas W. Mobray and Ron Zahavi, 1995, which publication is incorporated by reference herein. [0007]
  • Class libraries are available to support object-oriented programming environments such as CORBA. These class libraries allow users to generate application programs using previously-defined classes. [0008]
  • Some existing class libraries include classes for manipulating specialized data types such as date, decimal, duration, time, and timestamp data types. However, these class libraries do not specifically match the semantics of specialized data types retrieved from relational databases. The semantics of these specialized data types are available only through calls to a relational database management system. Thus, object-oriented application programs cannot access and manipulate specialized type data values from relational databases according to the object-oriented programming paradigm. [0009]
  • Therefore, there is a need in the art for technologies that access existing relational databases using object-oriented techniques. Moreover, such technologies should minimize the need for developing new application programs. [0010]
  • SUMMARY OF THE INVENTION
  • To overcome the limitations in the prior art described above, and to overcome other limitations that will become apparent upon reading and understanding the present specification, the present invention discloses a method, apparatus, and article of manufacture for defining object classes to match corresponding specialized data types stored in a relational database. An object-oriented application program may create an instance of a class for the purpose of representing data in a relational table that comprise a specialized data type. The attributes and behavior of the specialized data type in the database are preserved, where appropriate, in the corresponding class, and are available to the application program. [0011]
  • Various advantages and features of novelty, which characterize the invention, are pointed out with particularity in the claims annexed hereto and form a part hereof. However, for a better understanding of the invention, its advantages, and the objects obtained by its use, reference should be made to the drawings which form a further part hereof, and to accompanying descriptive matter, in which there is illustrated and described specific examples of an apparatus in accordance with the invention.[0012]
  • BRIEF DESCRIPTION OF THE DRAWINGS
  • Referring now to the drawings in which like reference numbers represent corresponding parts throughout: [0013]
  • FIG. 1 is a block diagram illustrating an exemplary hardware environment used to implement the preferred embodiment of the present invention; [0014]
  • FIG. 2 is a block diagram that further illustrates the structure of a Component Broker according to the present invention; and [0015]
  • FIG. 3 is a flowchart illustrating the logic performed by an Application Program, Component Broker, and Relational Database Management System according to the preferred embodiment of the present invention.[0016]
  • DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT
  • In the following description of the preferred embodiment, reference is made to the accompanying drawings, which form a part hereof, and in which is shown by way of illustration a specific embodiment in which the invention may be practiced. It is to be understood that other embodiments may be utilized and structural changes may be made without departing from the scope of the present invention. [0017]
  • Overview [0018]
  • The present invention provides a method for accessing a relational database using object-oriented techniques by modeling specialized data types within the database using specific object classes. The present invention allows an object-oriented application program to create an instance of a class for the purpose of representing data in a relational table that comprise a specialized data type. The attributes and behavior of the specialized data type in the database are preserved, where appropriate, in the corresponding class, and are available to the application program. [0019]
  • Hardware Environment [0020]
  • FIG. 1 is a block diagram illustrating an exemplary hardware environment used to implement the preferred embodiment of the invention. A [0021] client computer 100 communicates with a server computer 102. Both the client computer 100 and the server computer 102 are typically comprised of one or more processors, random access memory (RAM), read-only memory (ROM), and other components such data storage devices and data communications devices.
  • The [0022] client computer 100 executes one or more computer programs 104 operating under the control of an operating system. These computer programs 104 transmit requests to the server computer 102 for performing various functions and receive data from the server computer 102 in response to the requests.
  • The [0023] server computer 102 also operates under the control of an operating system, and executes one or more computer programs 106, 108, and 110. These computer programs 106, 108, and 110 receive requests from the client computer 100 for performing various functions and transmit data to the client computers 100 in response to the requests.
  • The [0024] server computer 102 manages one or more databases 112 stored on one or more data storage devices (such as a fixed or hard disk drive, a floppy disk drive, a CD-ROM drive, a tape drive, or other device). In a preferred embodiment, the database 112 is managed by the DB2™ relational database management system (RDBMS) offered by IBM Corporation. Those skilled in the art will recognize, however, that the present invention may be applied to any database and associated database management system.
  • The preferred embodiment of the present invention is generally implemented using five major components executed by [0025] client computers 100 and server computers 102, including a Client Program 104, Application Program 106, Component Broker 108 (which comprises a variant of an Object Request Broker), relational database management system (RDBMS) 110, and database 112, wherein each of these components comprise instructions and/or data. In the preferred embodiment, the Client Program 104 provides a user interface, the Application Program 106 performs application functions, the Component Broker 108 materializes data retrieved from the database 112 as objects, and the database management system 110 controls access to the database 112.
  • Generally, these instructions and/or data [0026] 104-112 are all tangibly embodied in or retrievable from a computer-readable device, medium, or carrier, e.g., a memory, a data storage device, a remote device coupled to the computer via a data communications device, etc. Moreover, these instructions and/or data, when read, executed, and/or interpreted by the client computer 100 and/or server computer 102, causes the client computer 100 and/or server computer 102 to perform the steps necessary to implement and/or use the present invention.
  • Thus, the present invention may be implemented as a method, apparatus, or article of manufacture using standard programming and/or engineering techniques to produce software, firmware, hardware, or any combination thereof The term “article of manufacture” (or alternatively, “computer program product”) as used herein is intended to encompass logic and/or data embodied in any device, medium, or carrier. [0027]
  • Of course, those skilled in the art will recognize many modifications may be made to this configuration without departing from the scope of the present invention. Those skilled in the art will also recognize that any combination of the above components, or any number of different components, including computer programs, peripherals, and other devices, may be used to implement the present invention, so long as similar functions are performed thereby. [0028]
  • Component Broker [0029]
  • FIG. 2 is a block diagram that further illustrates the structure of the [0030] Component Broker 112 according to the present invention. The Component Broker 112 provides a suite of tools that allows the user to write computer programs in an object-oriented programming context. In the preferred embodiment, the Component Broker 112 interacts with the Application Program 106. In alternative embodiments, the Component Broker 112 could interact with the Client Program 104 as well.
  • The [0031] Component Broker 112 is used to create and work with components 200, wherein a component 200 is a distributed set of objects that an Application Program 106 can access as a single entity and which work together to represent the logic and data relationships that perform a desired function for the Application Program 106.
  • In the present invention, the [0032] component 200 generally comprises a business object 202 and a data object 204, although other elements may be present as well. Business objects 202 include one or more methods and one or more attributes that are used directly by the Application Program 106. Data objects 204 also include one or more methods and one or more attributes that are used directly by the business objects 202 (and this indirectly by the Application Program 106).
  • Business objects [0033] 202 and data objects 204 are independent of any individual Application Program 106 and can be used in any combination to perform a desired task. A business object 202 may also have relationships with other business objects 202 and can cooperate with these other business objects 202 to perform a desired task.
  • Data objects [0034] 204 have direct access to data stored in the relational database 112 and are responsible for managing the persistence of state data for the component 200. By providing an interface between business objects 202 and the RDBMS 110, the data object 204 isolates the business object 202 from the details of the RDBMS 110 and relieves it from having to keep track of how to access and manage the data while maintaining persistency.
  • An [0035] Application Program 106 may access the data stored in the relational database 112 by interacting with business objects 202, which in turn interact with data objects 204, which in turn transmit requests to the RDBMS 110 using SQL functionality. For example, the data object 204 will generally have member functions that generate the appropriate SQL statements, package the statements, and forward them to the RDBMS 110 for execution, receive and process the results, and then return the results to the business objects 202, which ultimately provides access to the results to the Application Program 106.
  • As is well known, each column of a relational table [0036] 112 has a respective data type. Traditional data types include integer, floating point, logical, fixed length character, and variable length character data types. Some specialized data types include date, decimal, duration, time, and timestamp. Generally, SQL statements include expressions or functions, that permit manipulation of the specialized data types. A description of specialized data types and their associated expressions or functions can be found in the publication by IBM Corporation entitled DB2 Universal Database SQL Reference V.5, S1OJ-8165-00, pp. 143-156, Copyright 1993, 1997.
  • The direct use of such SQL expressions or functions is disadvantageous in that the specialized data type must be retrieved from the table in the [0037] relational database 112, the function must be performed by the RDBMS 110, and the result must then be provided back to the data object 204. There would be advantages, then, to performing these functions for specialized data types in an object, rather than the RDBMS 110. However, prior art class libraries do not support specialized data types.
  • In the present invention, the [0038] Component Broker 108 provides helper classes 206, 208, 210, 212, and 214 that emulate the semantics of the corresponding specialized data types for use in various operations, such as comparison operations, arithmetic operations, etc. In the preferred embodiment, these classes 206, 208, 210, 212, and 214 include:
  • ICBCDate Class [0039] 206 (representing the Date type).
  • ICBCDecimal Class [0040] 208 (representing the Decimal type).
  • ICBCDuration Class [0041] 210 (representing the Date Duration, Time Duration,
  • Timestamp duration, and Labeled Duration types). The Duration data type is complementary to the Date, Time, and Timestamp classes, but is not, itself, stored in tables in the [0042] relational database 112.
  • ICBCTime Class [0043] 212 (representing the Time type).
  • ICBCTimestamp Class [0044] 214 (representing the Timestamp type).
  • The abbreviation ICBC stands for IBM Component Broker Class.) [0045]
  • Each [0046] helper class 206, 208, 210, 212, and 214 provides a public interface (i.e., IDL) for accessing the attributes and for invoking the methods or member functions of the class. In each case, the public interface of the class is designed to match the characteristics and usage of the particular specialized data type in the RDBMS 110. As a result, methods or member functions performed by these classes 206, 208, 210, 212, and 214 produce the same results as equivalent SQL expressions evaluated by the RDBMS 110. Thus, the Application Program 106 uses the helper class objects 206, 208, 210, 212, and 214 to manipulate Dates, Decimals, Durations, Times, or Timestamps whenever it is desirable that the results should be consistent with those that would be produced by the RDBMS 110 itself.
  • In the preferred embodiment, the [0047] helper classes 206, 208, 210, 212, and 214 are implemented in accordance with specialized data types and associated expressions or functions found in the DB2™ RDBMS 110 sold by IBM Corporation. However, those skilled in the art will recognize that the classes 206, 208, 210, 212, and 214 can be implemented to accommodate specialized data types from any RDBMS 110, such as those offered by ORACLE™, SYBASE™, MICROSOFT™, etc.
  • Descriptions of the [0048] helper classes 206, 208, 210, 212, and 214, and a list of at least some of their methods or member functions are provided below. In addition, the Programming Language Appendix included below provides additional descriptions of the various attributes and methods associated with the helper classes 206, 208, 210, 212, and 214.
  • ICBC Date Class [0049]
  • The [0050] ICBCDate Class 206 stores the value of a calendar date between Jan. 01, 0001 and Dec. 31, 9999. All access and manipulation of this date is through a public functional interface. The actual date value and its format are stored in private attributes.
  • Note that [0051] ICBCDate Class 206 assumes the proleptic Gregorian calendar. The Gregorian calendar in use today is assumed to extend back to year 0001 and it is the responsibility of the application to apply any corrections that may be required for dates prior to the Gregorian calendar reform.
  • The [0052] ICBCDate Class 206 includes a number of different methods such as object initialization, comparisons, query functions, and manipulation functions. The object initialization methods include initializeFromString, initializeFromNumber, initializeFromTimestamp, and initializeFromValues methods. The comparison methods include equalTo, notEqualTo, lessThan, lessThanOrEqualTo, greaterThan, and greaterThanOrEqualTo. The query functions methods include OutputFormat, formattedString, day, dayOfWeek, dayOfYear, julianDay, modifiedJulianDay, dayName, dayFromString, dayOfWeekFromString, dayOfYearFromString, julianDayFromString, modifiedJulianDayFromString, dayNameFromString, dayNameFromNumber, month, monthName, monthFromString, monthNameFromString, monthNameFromNumber, quarter, quarterFromstring, year, yearFromString, isLeapYear, daysInObject, daysInString, daysInMonth, daysInYear, isValidMonthDayYear, isValidYearDay, and isObjectChanged. The manipulation methods include assignFromDate, increment, decrement, dateOverflow, intervalFromDate, intervalFromString, and intervalFromLong.
  • ICBCDecimal Class [0053]
  • The [0054] ICBCDecimal Class 208 stores the value of a Decimal data type (from a DB2™ RDBMS 110) or number type (from an ORACLE™ RDBMS 110) in which scale is less than or equal to precision, and positive with a specified maximum precision (e.g., 38). All access and manipulation of this value is through a public functional interface. The actual decimal value and its precision and scale are stored in private attributes.
  • The [0055] ICBCDecimal Class 208 includes a number of different methods such as object initialization, comparisons, query functions, and manipulation functions. The object initialization methods include initializeFromString1, initializeFromString2, initializeFromDouble, initializeFromFloat, initializeFromLong, initializeFromShort, initializeFromDecimal1, initializeFromDecimal2, and initializeFromPackedDecimal. The comparison methods include equalTo, notEqualTo, lessThan, lessThanOrEqualTo, greaterThan, and greaterThanOrEqualTo. The query functions methods include getAsFormattedString1, getAsFormattedString2, getAsFormattedString3, getAsDouble, getAsFloat, getAsLong, getAsShort, getAsDigits, getAsPackedDecimal, getPrecision, getScale, isNegative, and isChanged. The manipulation methods include assignFromDecimal, assignFromDouble, assignFromFloat, assignFromLong, assignFromShort, increment, decrement, multiplyThisObjectBy, divideThisObjectBy, remainderInThisObject, addWithNewObject, subtractWithNewObject, multiplyWithNewObject, divideWithNewObject, remainderWithNewObject, getPrecedingRemainder, swapSign, and decimalOverflow.
  • ICBCDuration Class [0056]
  • The [0057] ICBCDuration Class 210 represents the “Labeled Duration”, “Date Duration”, “Time Duration”, and “Timestamp Duration” constructs of Duration. Duration is complementary data type to Date, Time, and Timestamp, and participates in expressions in SQL statements. However, it is not, itself, stored in tables in the relation database 112.
  • The [0058] Class 210 holds the value of a duration, and a record of whether this duration value is in units of years, months, days, hours, minutes seconds, or microseconds. The value can also be of a composite type defining a “Date Duration” of the form yyyymmdd, a “Time Duration” of the form hhmmss, or a “Timestamp Duration” of the form yyyymmddhhmmsszzzzzz.
  • In the preferred embodiment, arithmetic between two [0059] ICBCDuration Class 210 objects is not supported (which is consistent with DB2™ support of Durations). However, they can be compared, and a unary minus operator (which swaps the sign) is provided.
  • The [0060] ICBCDuration Class 210 includes a number of different methods such as object initialization, comparisons, query functions, and manipulation functions, The object initialization methods include initializeLabeledDuration, initializeDateTimeDuration, and initializeTimestampDuration. The comparison methods include equalTo, notEqualTo, lessThan, lessThanOrEqualTo, greaterThan, and greaterThanOrEqualTo. The query functions methods include isNegative, microsecond, second, minute, hour, day, month, year, size, and formattedString. The manipulation function methods include assignFromDuration, and swapSign.
  • ICBCTime Class [0061]
  • The [0062] ICBCTime Class 212 stores the value of a time-of-day. All access and manipulation of this time is through a public functional interface. The actual time value and its format are stored in private attributes.
  • The [0063] ICBCTime Class 212 includes a number of different methods such as object initialization, comparisons, query functions, and manipulation functions. The object initialization methods include initializeFromString, intializeFromTimestamp, and initializeFromValues. The comparison methods include equalTo, notEqualTo, lessThan, lessThanOrEqualTo, greaterThan, and greaterThanOrEqualTo. The query functions methods include second, minute, hour, and isObjectChanged. The manipulation functions methods include assignFromTime, increment, decrement, timeOverflow, intervalFromTime, and intervalFromString.
  • ICBCTimestamp Class [0064]
  • The [0065] ICBCTimestamp Class 214 stores the value of a Timestamp type (from a DB2™ RDBMS 110) or a DATE type (from an ORACLE™ RDBMS 110). All access and manipulation of this timestamp is through a public functional interface; the actual timestamp value is stored in private attributes.
  • In the preferred embodiment, a Timestamp attribute in a [0066] business object 204 that originates from the database 112 is represented by Component Broker 108 as a 26 character string of form yyyy-mm-dd-hh.mm.ss.mmmmmm. This string can be used to initialize an instance of the ICBCTimestamp Class 214 through the initializeFromString function. A DATE attribute that originates from an ORACLE™ database 112 is represented by Component Broker 108 in the same 26 character form yyyy-mm-dd-hh.mm.ss.mmmmmm but with the final six characters (the microseconds field) always set to zeros. This string can be used to initialize an instance of the ICBCTimestamp Class 214 via initializeFromString function. However, ORACLE™ dates earlier than Jan. 01, 0001 are rejected. Whether the ICBCTimestamp object is initialized from data originating in a DB2™ or in ORACLE™ database 112, ICBCTimestamp applies DB2™ semantics in its processing of the data.
  • The [0067] ICBCTimestamp Class 214 includes a number of different methods such as object initialization, comparisons, query functions, and manipulation functions. The object initialization methods include initializeFromString, initializeFromDateTime, initializeFromDate, initializeFromTime, and initializeFromDatastoreFormat. The comparison methods include equalTo, notEqualTo, lessThan, lessThanOrEqualTo, greaterThan, and greaterThanOrEqualTo. The query functions methods include formattedString, getAsDateFormattedString, getAsTimeFormattedString, getAsDatstoreFormat, microsecond, second, minute, hour, day, month, year, dayOfWeek, dayOfYear, julianDay, modifiedJulianDay, dayName, dayFromString, dayOfWeekFromString, dayOfYearFromString, julianDayFromString, modifiedJulianDayFromString, dayNameFromString, dayNameFromNumber, monthName, monthFromString, monthNameFromString, monthNameFromNumber, quarter, quarterFromString, yearFromString, isLeapYear, daysInObject, daysInString, daysInMonth, daysInYear, and isObjectChanged. The manipulation functions methods include assignFromTimestamp, increment, decrement, timestampOverflow, intervalFromTimestamp, and intervalFromString.
  • Logic of the Invention [0068]
  • FIG. 3 is a flowchart illustrating the logic performed by the [0069] Application Program 106, Component Broker 108, and RDBMS 110 according to the preferred embodiment of the present invention.
  • [0070] Block 300 represents the Component Broker 108 instantiating one or more of the helper classes 206, 208, 210, 212, and 214 as objects. Generally, this step is performed in response to a request from the Application Program 106, although other events may trigger this step as well.
  • [0071] Block 302 represents the Component Broker 108 retrieving one or more tuples comprised of at least a Date, Decimal, Duration, Time, or Timestamp column or attribute from a table in the relational database 112. This retrieval step is performed via the data object 204 within the Component Broker 108, wherein the data object 204 has member functions that generate appropriate SQL statements, package the statements, and forward them to the RDBMS 110 for execution.
  • [0072] Block 304 represents the Component Broker 108 storing the requested data retrieved from the table in the relational database 112 as a string attribute in a business object 202. This storage step is also performed via the data object 204 within the Component Broker 108, wherein the data object 204 has member functions that receive and process the results from the execution of the SQL statements by the RDBMS 110, and then return the results to the business objects 202.
  • [0073] Block 306 represents the Application Program 106 retrieving the string attribute from the business object 202 in the Component Broker 108.
  • [0074] Block 308 represents the Application Program 106 using the retrieved string attribute to initialize one or more of the helper class objects 206, 208, 210, 212, or 214 in the Component Broker 108.
  • [0075] Block 310 represents the Application Program 106 performing one or more various operations, such as object initialization, comparisons, query functions, manipulation functions, arithmetic operations, etc., on the helper class objects 206, 208, 210, 212, or 214.
  • [0076] Block 312 represents the Application Program 106 extracting the string attribute from the helper class objects 206, 208, 210, 212, or 214 in the Component Broker 108.
  • [0077] Block 314 represents the Application Program 106 updating the attribute in the business object 202 using the extracted string attribute.
  • [0078] Block 316 represents the Component Broker 108 storing the updated string attribute from the business object 202 into the relational database 112. This storing step is performed via the data object 204 within the Component Broker 108, wherein the data object 204 has member functions that generate appropriate SQL statements, package the statements, and forward them to the RDBMS 110 for execution.
  • Conclusion [0079]
  • This concludes the description of the preferred embodiment of the invention. The following paragraphs describe some alternative methods of accomplishing the same objects. [0080]
  • In alternative embodiments of the present invention, other types and configurations of computers could be used. For example, the invention need not be restricted to client-server configurations. In addition, mainframes, minicomputers, or personal computers, could be used with the present invention. [0081]
  • In alternative embodiments of the present invention, other types and configurations of computer programs could be used. For example, the invention need not be restricted to COBRA environments, but could be used with COM, DCOM, or other object-oriented environments. [0082]
  • In alternative embodiments of the present invention, other database management systems could be used. For example, the invention need not be restricted to DB2™ relational database management systems. Instead, the present invention could be used to model other types of databases and datastores. [0083]
  • In summary, the present invention discloses a method, apparatus, and article of manufacture for defining object classes to match corresponding specialized data types stored in a relational database. An object-oriented application program may create an instance of a class for the purpose of representing data in a relational table that comprise a specialized data type. The attributes and behavior of the specialized data type in the database are preserved, where appropriate, in the corresponding class, and are available to the application program. [0084]
  • The foregoing description of the preferred embodiment of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. It is intended that the scope of the invention be limited not by this detailed description, but rather by the claims appended hereto. [0085]
  • Programming Reference Appendix [0086]
  • The following Programming Reference Appendix provides descriptions of the various attributes and methods associated with the [0087] helper classes 206, 208, 210, 212, and 214. These descriptions describe the implementation of the preferred embodiment of the present invention, and are not intended to be limiting in any way. Specifically, those skilled in the art will recognize that different methods, attributes, functionality or implementations may be made without departing from the scope of the present invention.
  • ICBCDate Class [0088]
  • The class stores the value of a calendar date between Jan. 01, 0001 and Dec. 31, 9999. All access and manipulation of this date is through a public functional interface. The actual date value and its format are stored in private attributes. [0089]
  • Note that ICBCDate assumes the proleptic Gregorian calendar. The Gregorian calendar in use today is assumed to extend back to year 0001 and it is the responsibility of the application to apply any corrections that may be required for dates prior to the Gregorian calendar reform. [0090]
  • IDL Interface Description [0091]
  • interface ICBCDate: IManagedLocal::ILocalOnly [0092]
    {
    // Object initialization
    boolean initializeFromString(in string aDate);
    boolean initializeFromNumber(in long aDate);
    boolean initializeFromTimestamp(in ICBCTimestamp aTimestamp);
    boolean initializeFromValues(in long aYear, in long aMonth,
       in long aDay);
    // Comparisons
    boolean equalTo(in ICBCDate aDate);
    boolean notEqualTo(in ICBCDate aDate);
    boolean lessThan(in ICBCDate aDate);
    boolean lessThanOrEqualTo(in ICBCDate aDate);
    boolean greaterThan(in ICBCDate aDate);
    boolean greaterThanOrEqualTo(in ICBCDate aDate);
    // Query functions
    enum OutputFormat {ISO, USA, EUR, JIS, LOC};
    string formattedString(inout string aTarget,
       in ICBCDate::OutputFormat aFormat);
    long day();
    long dayOfWeek();
    long dayOfYear();
    long julianDay();
    long modifiedJulianDay();
    string dayName();
    long dayFromString(in string aString);
    long dayOfWeekFromString(in string aDate);
    long dayOfYearFromString(in string aDate);
    long julianDayFromString(in string aDate);
    long modifiedJulianDayFromString(in string aDate);
    string dayNameFromString(in string aDate);
    string dayNameFromNumber(in long aDayIndex);
    long month();
    string monthName();
    long monthFromString(in string aDate);
    string monthNameFromString(in string aDate)
    string monthNameFromNumber(in long aMonthIndex);
    long quarter();
    long quarterFromstring(in string aDate);
    long year();
    long yearFromString(in string aString);
    boolean isLeapYear(in long aYear);
    long daysInObject();
    long daysInString(in string aDate);
    long daysInMonth(in long aYear, in long aMonth);
    long daysInYear(in long aYear);
    boolean is ValidMonthDayYear(in long aMonth, in long aDay,
       in long aYear);
    boolean isValidYearDay(in long aYear, in long aDay);
    boolean isObjectChanged();
    // Manipulation functions
    void assignFromDate(in ICBCDate aDate);
    void increment(in ICBCDuration aDuration);
    void decrement(in ICBCDuration aDuration);
    long dateOverflow();
    ICBCDuration intervalFronDate(in ICBCDate aDate);
    ICBCDuration intervalFromString(in string aDate);
    ICBCDurarion intervalFromLong(in long aDate);
    };
  • Supported Methods [0093]
  • ICBCDate::_create [0094]
  • ICBCDate::assignFromDate [0095]
  • ICBCDate::dateOverflow [0096]
  • ICBCDate::day [0097]
  • ICBCDate::dayFromString [0098]
  • ICBCDate::dayName [0099]
  • ICBCDate::dayNameFromNumber [0100]
  • ICBCDate::dayNameFromString [0101]
  • ICBCDate::dayOfWeek [0102]
  • ICBCDate::dayOfWeekFromString [0103]
  • ICBCDate::dayOfyear [0104]
  • ICBCDate::dayOfYearFromString [0105]
  • ICBCDate::daysInMonth [0106]
  • ICBCDate::daysInObject [0107]
  • ICBCDate::daysInString [0108]
  • ICBCDate::daysInYear [0109]
  • ICBCDate::decrement [0110]
  • ICBCDate::equalTo [0111]
  • ICBCDate::formattedString [0112]
  • ICBCDate::greaterThan [0113]
  • ICBCDate::greaterThanOrEqualTo [0114]
  • ICBCDate::increment [0115]
  • ICBCDate::initializeFromNumber [0116]
  • ICBCDate::initializeFromString [0117]
  • ICBCDate::intializeFromTimestamp [0118]
  • ICBCDate::initializeFromValues [0119]
  • ICBCDate::interval [0120]
  • ICBCDate::isObjectChanged [0121]
  • ICBCDate::isLeapYear [0122]
  • ICBCDate::isValidMonthDayYear [0123]
  • ICBCDate::isValidYearDay [0124]
  • ICBCDate::julianDay [0125]
  • ICBCDate::julianDayFromString [0126]
  • ICBCDate::lessThan [0127]
  • ICBCDate::lessThanOrEqualTo [0128]
  • ICBCDate::modifiedJulianDay [0129]
  • ICBCDate::modifiedJulianDayFromString [0130]
  • ICBCDate::month [0131]
  • ICBCDate::monthFromString [0132]
  • ICBCDate::monthName [0133]
  • ICBCDate::monthNameFromNumber [0134]
  • ICBCDate::monthNameFromString [0135]
  • ICBCDate::notEqualTo [0136]
  • ICBCDate::quarter [0137]
  • ICBCDate::quarterFromString [0138]
  • ICBCDate::year [0139]
  • ICBCDate::yearFromString [0140]
  • ICBCDate::_create [0141]
  • Returns a pointer to a new IDBCDate object. The object is intialized to the current system date. [0142]
  • ICBCDate::assignFromDate [0143]
  • Sets all state data in this ICBCData object equal to the second ICBCData object. The change flag of this object is set to TRUE. [0144]
  • IDL Syntax [0145]
  • ICBCDate assignFromDate (in ICBCDate aDate); [0146]
  • ICBCDate::dateOverflow [0147]
  • Returns the number of overflow or underflow years of a preceding increment or decrement operation. For an increment, returns the years in excess of year 9999; for decrement, the number of years less than year 0001. [0148]
  • IDL Syntax [0149]
  • long dateOverflow( ); [0150]
  • ICBCDate::day [0151]
  • Returns the day part of this object, as a number between 1 and 31. [0152]
  • IDL Syntax [0153]
  • long day( ); [0154]
  • ICBCDate::dayFromString [0155]
  • Returns the day part Returns the day part of the date encoded in the input string parameter. [0156]
  • The input string parameter must conform to a format recognizable as a date. Refer to IBCDate::initializeFromString( ) for a description of supported formats. If the input parameter is not recognizable, a value of −1 is returned. [0157]
  • IDL Syntax [0158]
  • long dayFromString(in string aString); [0159]
  • ICBCDate::dayName [0160]
  • Returns a string containing the name of the day of the week for this date object. [0161]
  • IDL Syntax [0162]
  • string dayName(); [0163]
  • ICBCDate::dayNameFromNumber [0164]
  • Returns a string containing the name of the day of the week for the day number within a week provided in the input parameter. The input parameter must be a number between 1 and 7. Sunday is day number 1. [0165]
  • If the input parameter is not recognizable, an empty string is returned. [0166]
  • IDL Syntax [0167]
  • string dayNameFromNumber(in long aDayIndex); [0168]
  • ICBCDate::dayNameFromString [0169]
  • Returns a string containing the name of the day of the week for the date encoded in the input string parameter. The input string parameter must conform to a format recognizable as a date. Refer to ICBCDate::initializeFromString for a description of supported formats. [0170]
  • If the input parameter is not recognizable, an empty string is returned. [0171]
  • IDL Syntax [0172]
  • long dayNameFromString(m string aDate); [0173]
  • ICBCDate::dayOfWeek [0174]
  • Returns a number between 1 and 7 representing the day of the week for this date object. Sunday is day number 1. [0175]
  • IDL Syntax [0176]
  • long dayOfWeek( ); [0177]
  • ICBCDate::dayOfWeekFromString [0178]
  • Returns a number between 1 and 7 representing the day of the week for the date encoded in the input string parameter. Sunday is day number 1. [0179]
  • The input string parameter must conform to a format recognizable as a date. Refer to ICBCDate::initializeFromString for a description of supported formats. If the input parameter is not recognizable, a value of −1 is returned. [0180]
  • IDL Syntax [0181]
  • long dayOfWeekFromString(in string aString); [0182]
  • ICBCDate::dayOfYear [0183]
  • Returns a number between 1 and 366 representing the day of the year for this date object. January 1 is day number 1. [0184]
  • IDL Syntax [0185]
  • long dayOfYear( ); [0186]
  • ICBCDate::dayOfYearFromString [0187]
  • Returns a number between 1 and 366 representing the day of the year for the date encoded in the input string parameter. January 1 is day number 1. [0188]
  • The input string parameter must conform to a format recognizable as a date. Refer to ICBCDate::initializeFromString for a description of supported formats. If the input parameter is not recognizable, a value of −1 is returned. [0189]
  • IDL Syntax [0190]
  • long dayOfYearFromString(in string aString); [0191]
  • ICBCDate::daysInMonth [0192]
  • Returns the number of days in the month of the year provided in the input parameters. Month number must be between 1 and 12. [0193]
  • If the input parameters are not valid, a value of −1 is returned. [0194]
  • IDL Syntax [0195]
  • long daysInMonth(in long aYear, in long aMonth); [0196]
  • ICBCDate::daysInObject [0197]
  • Returns the number of days from Jan. 1, 0001 to the date represented by this object, plus one day. For example, an object holding the date Jan. 2, 0001 returns the value 2. [0198]
  • IDL Syntax [0199]
  • long daysInObject( ); [0200]
  • ICBCDate::daysInString [0201]
  • Returns the number of days from Jan. 1, 0001 to the date represented by the string parameter, plus one day. For example, an object holding the date 00010102 returns the value 2. If the string is invalid, the value −1 is returned. [0202]
  • IDL Syntax [0203]
  • long daysInString(in string aDate); [0204]
  • Parameters [0205]
  • The string must be one of the following: [0206]
  • A string of length 7 of the form yyyynnn. [0207]
  • aDate [0208]
  • A string of length 6 of the form yyyymmdd. [0209]
  • A punctuated string representation of a date. [0210]
  • For additional details on the string parameter, see ICBCDate::initializeFromString. [0211]
  • ICBCDate::daysInYear [0212]
  • Returns the number of days in the year provided in the input parameter. If the input parameter is not valid, a value of −1 is returned. [0213]
  • IDL Syntax [0214]
  • long daysInYear in long aYear); [0215]
  • ICBCDate::decrement [0216]
  • Subtracts a ICBCDuration from the value of this ICBCDate object. [0217]
  • IDL Syntax [0218]
  • void decrement(in ICBCDuration aDuration); [0219]
  • Remarks [0220]
  • This operation is performed essentially as the inverse of ICBCDate::increment. When the duration of type DATE is subtracted from a date, the date is decremented by the specified number of days, months, and years (in this order). If the years value of the result of an decrement operation is less than 0001 years, the years value of the result is set to 0001 and the number of underflow years can be retrieved as a negative number using ICBCDate::dateOverflow. The number of overflow years is cleared by the next assignFromDate or arithmetic operation on the object. [0221]
  • The change flag of this object is set to TRUE. [0222]
  • ICBCDate::equalTo [0223]
  • Returns TRUE if the date in this ICBCDate object is equal to the other ICBCDate object. [0224]
  • IDL Syntax [0225]
  • boolean equalTo(in ICBCDate aDate); [0226]
  • ICBCDate::formattedString [0227]
  • Returns the date value of this object as a string in a specified format. The parameter OutputType must take one of the values: ISO, USA, EUR, JIS. Formats are as described for lCBCDate::initializeFromString. The LOC site-defined operation described in the DB2 manual is not supported by ICBCDate. [0228]
  • The application must supply a non-const pointer to a target storage area long enough to receive the formatted date. The function returns a reference to this area [0229]
  • IDL Syntax [0230]
  • string formattedString(inout string aOutput, [0231]
  • in ICBCDate::OutputFormat aFormat) [0232]
  • ICBCDate::greaterThan [0233]
  • Returns TRUE if the date stored in this ICBCDate object is greater than the other ICBCDate object. [0234]
  • IDL Syntax [0235]
  • boolean greaterThan(in ICBCDate aDate); [0236]
  • ICBCDate::greaterThanOrEqualTo [0237]
  • Returns TRUE if the date stored in this ICBCDate object is greater than or equal to the other ICBCDate object. [0238]
  • IDL Syntax [0239]
  • boolean greaterThanOrEqualTo(in ICBCDate aDate); [0240]
  • ICBCDate::increment [0241]
  • Adds a ICBCDuration to the value of this ICBCDate object. If the duration is negative, the operation is performed as a decrement. If a duration of type YEARS is added to the date, only the year portion of the date is affected. The month is unchanged, as is the day, unless the result would be February 29 of a non-leap-year. In this case, the day is changed to 28. [0242]
  • Similarly, if a duration of type MONTHS is added, only months and, if necessary, years are affected. Note that adding months to a Date is like turning the pages of a calendar, starting with the page on which the date appears. The day portion of the date is unchanged unless the result would be invalid (September 31, for example). In this case, the day is set to the last day of the month. If one or more months is added to a given date, and then the same number of months is subtracted from the result, the final date is not necessarily the same as the original date. [0243]
  • Adding a duration of type DAYS will, of course, affect the day portion of the date, and potentially the month and year. [0244]
  • When a duration of type DATE is added to a date, the date is incremented by the specified number of year, months, and days, in this order. [0245]
  • If the years value of the result of an increment operation is greater than 9999 years, then the years value of the result is set to 9999, and the number of overflow years can be retrieved using the dateOverflow( ) function. The number of overflow years is cleared by the next assignFromDate of arithmetic operation on the object. [0246]
  • The change flag of this object is set to TRUE. [0247]
  • IDL Syntax [0248]
  • void increment(in ICBCDuration aDuration); [0249]
  • ICBCDate::initializeFromNumber [0250]
  • Accepts a numerical value for the date. Any existing value in the object is replaced. The parameter aDate must be positive, non-zero, and less than 3652059. Creates a date that is (aDate-1) days beyond Jan. 1, 0001, i.e., Jan. 2, 0001 is day number 2. Returns TRUE if the number is a valid date representation, FALSE otherwise. If FALSE is returned the state of the object is unchanged. [0251]
  • IDL Syntax [0252]
  • boolean initializeFromNumber(in long aDate); [0253]
  • ICBCDate::initializeFromString [0254]
  • Accepts a value for the date in the form of a string. Returns TRUE if the string is a valid date representation and the object is successfully initialized. Any existing value in the object is replaced. Returns FALSE if the parameter is invalid. If FALSE is returned the state of the object is unchanged. [0255]
  • IDL Syntax [0256]
  • boolean initializeFromString(in string aDate); [0257]
  • Parameters [0258]
  • The string must be: [0259]
  • A string of length 7 of the form yyyynnn. [0260]
  • The yyyyddd string must consist of entirely numeric characters with padding zeros where necessary—embedded signs or blanks are not allowed. However leading and trailing blanks are acceptable provided the string length is less than 20 characters. Only SBCS characters may be present in the string. [0261]
  • A string of length 8 of the form yyyymmdd. [0262]
  • The yyyymmdd string must consist of entirely numeric characters with padding zeros where necessary—embedded signs or blanks are not allowed. However leading and trailing blanks around the string are acceptable provided the string length is less than 20 characters. Only SBCS characters may be present in the string. [0263]
  • A valid punctuated string representation of a date, in one of the following valid forms: [0264]
  • aDate [0265]
  • International Standards Organization (ISO) y-mm-dd). [0266]
  • IBM USA standard (USA) (mm/dd/yyyy). [0267]
  • IBM European standard (EUR) (dd.mm.yyyy) [0268]
  • Japanese Industrial Standard Christian Era (JIS) (yyyy-mm-dd). [0269]
  • Leading and trailing blanks are acceptable provided the string length is less than 20 characters. Leading zeros may be omitted from the month and day portions. Only SBCS characters may be present in the string. [0270]
  • A string representation of a timestamp. [0271]
  • Any of the string forms acceptable by the ICBCTimestamp::initializeFromString function are acceptable. For details refer to that function. Briefly, the forms include: [0272]
  • A punctuated string: yyyy-mm-dd-hh.mm.ss.nnnnnn. [0273]
  • A 14 byte string without puctuation, of the form: yyyymmddhhmmss. [0274]
  • ICBCDate::initializeFromTimestamp [0275]
  • Initializes this object from the date portion of a Timestamp object. [0276]
  • IDL Syntax [0277]
  • boolean initializeFromTimestamp(in ICBCTimestamp aTimestamp); [0278]
  • ICBCDate::initializeFromValues [0279]
  • Accepts the date in the form of three separate value parameters for year, month, and day. The values must make a valid date. Returns TRUE if the values are a valid date representation, FALSE otherwise. If FALSE is returned the state of the object is unchanged. [0280]
  • IDL Syntax [0281]
  • boolean initializeFromValues(in long aYear,in long aMonth, in long aDay); [0282]
  • ICBCDate::interval [0283]
  • Calculates the Duration between two ICBCDate objects. The result is a pointer to a new ICBCDuration object of type DATE. [0284]
  • If the interval between DATE1 and DATE2 is required, and DATE1 is greater than or equal to DATE2, the operation is performed by subtracting DATE2 from DATE1. If, however, DATE1 is less than DATE2, DATE1 is subtracted from DATE2, and the sign of the result is made negative. [0285]
  • The following procedural description clarifies the steps involved in the operation result=DATE1-DATE2. [0286]
  • If DAY(DATE2)<=DAY(DATE1) [0287]
  • then DAY(RESULT)=DAY(DATE1)-DAY(DATE2). [0288]
  • If DAY(DATE2)>DAY(DATE1) [0289]
  • then DAY(RESULT)=N+(DAY(DATE1)−DAY(DATE2) [0290]
  • where N=the last day of MONTH(DATE2). [0291]
  • MONTH(DATE2) is then incremented by 1. [0292]
  • If MONTH(DATE2)<=MONTH(DATE1) [0293]
  • then MONTH(RESULT)=MONTH(DATE1)−MONTH(DATE2). [0294]
  • If MONTH(DATE2)>MONTH(DATE1) [0295]
  • then MONTH(RESULT)=12+MONTH(DATE1)−MONTH(DATE2). [0296]
  • YEAR(DATE2) is incremented by 1. [0297]
  • YEAR(RESULT)=YEAR(DATE1)−YEAR(DATE2). [0298]
  • IDL Syntax [0299]
  • ICBCDuration_ptr intervalFromDate(in ICBCDate aDate); [0300]
  • ICBCDuration_ptr intervalFromString(in string aDate); [0301]
  • ICBCDuration_ptr intervalFromLong(in long aDate); [0302]
  • In the cases with a string parameter, the parameter must be recognizable as a date. For details refer to the description of ICBCDate::initializeFromString. If the string is invalid, a pointer value of −1 is returned. [0303]
  • ICBCDate::isObjectChanged [0304]
  • Returns a boolean indicating whether the value of this object has been changed since it was initialized. [0305]
  • IDL Syntax [0306]
  • boolean isObjectChanged( ); [0307]
  • ICBCDate::isLeapYear [0308]
  • Returns TRUE if the year number in the input parameter is a leap year, FALSE otherwise. Year number must be between 1 and 9999. [0309]
  • If the input parameter is not in this range, FALSE is returned. [0310]
  • IDL Syntax [0311]
  • boolean isLeapYear(in long aYear); [0312]
  • ICBCDate: :isValidMonthDayYear [0313]
  • Returns TRUE if the provided values for month, day, and year make a valid date, and FALSE otherwise. [0314]
  • IDL Syntax [0315]
  • boolean isValidMonthDayYear(in long aMonth, in longMonth, in longYear); [0316]
  • ICBCDate: :isValidYearDay [0317]
  • Returns TRUE if the provided values for year, and day within year make a valid date, and FALSE otherwise. [0318]
  • IDL Syntax [0319]
  • boolean isValidYearDay(in long aYear,in long aDay); ICBCDate::julianDay [0320]
  • Returns the Julian day number corresponding to noon GMT on the date represented by this object. Julian Day count started at noon, GMT, on Jan. 1, 4712 BC [0321]
  • IDL Syntax long julianDay( ); [0322]
  • ICBCDate::julianDayFromString [0323]
  • Returns the Julian day number corresponding to noon GMT on the date encoded in the input string parameter. (Julian Day count started at noon, GMT, on Jan. 1, 4712 BC). The input string parameter must conform to a format recognizable as a date. Refer to ICBCDate::initializeFromString for a description of supported formats. If the input parameter is not recognizable, a value of −1 is returned. [0324]
  • IDL Syntax long julianDayFromString(in string aString); [0325]
  • ICBCDate::lessThan [0326]
  • Returns TRUE if the date stored in this ICBCDate object is less than the other ICBCDate object. [0327]
  • IDL Syntax [0328]
  • boolean lessThan(in ICBCDate aDate); [0329]
  • ICBCDate::lessThanOrEqualTo [0330]
  • Returns TRUE if the date stored in this ICBCDate object is less than or equal to the other ICBCDate object. [0331]
  • IDL Syntax [0332]
  • boolean lessThanOrEqualTo(in ICBCDate aDate); [0333]
  • ICBCDate::modifiedJulianDay [0334]
  • Returns the Modified Julian day number (MJD) corresponding to time 00:00:00 GMT on the date represented by this object. MJD is defined as Julian Day—2,400,000.5 days. It thus starts at time 00:00:00 (i.e. midnight), in line with normal civil practice, and unlike Julian Day which extends from noon to noon. [0335]
  • IDL Syntax [0336]
  • long modified JulianDay( ); [0337]
  • ICBCDate::modifiedJulianDayFromString [0338]
  • Returns the Modified Julian day number (MJD) corresponding to time 00:00:00 GMT on the date encoded in the input string parameter. MJD is defined as Julian Day—2,400,000.5 days. It thus starts at time 00:00:00 (i.e., midnight), in line with normal civil practice, and unlike Julian Day which extends from noon to noon. [0339]
  • The input string parameter must conform to a format recognizable as a date. Refer to ICBCDate::initializeFromString for a description of supported formats. If the input parameter is not recognizable, a value of −1 is returned. [0340]
  • IDL Syntax [0341]
  • long modifiedJulianDayFromString(in string aString); [0342]
  • ICBCDate::month [0343]
  • Returns the month part of this object, as a number between 1 and 12. [0344]
  • IDL Syntax [0345]
  • long month( ); [0346]
  • ICBCDate::monthFromString [0347]
  • Returns the month part of the date encoded in the input string parameter. The input string parameter must conform to a format recognizable as a date. Refer to ICBCDate::initializeFromString for a description of supported formats. [0348]
  • If the input parameter is not recognizable, a value of −1 is returned. [0349]
  • IDL Syntax [0350]
  • long monthFromString(in string aString); [0351]
  • ICBCDate::monthName [0352]
  • Returns a string containing the name of the month of this object. [0353]
  • IDL Syntax [0354]
  • long monthName( ); [0355]
  • ICBCDate::monthNameFromNumber [0356]
  • Returns a string containing the name of the month for the month number within a year provided in the input parameter. The input parameter must be a number between 1 and 12. [0357]
  • If the input parameter is not recognizable, an empty string is returned. [0358]
  • IDL Syntax [0359]
  • string monthNameFromNumber(in long aDayIndex); [0360]
  • ICBCDate::monthNameFromString [0361]
  • Returns a string containing the name of the month for the date encoded in the input string parameter. The input string parameter must conform to a format recognizable as a date. Refer to ICBCDate::initializeFromString for a description of supported formats. [0362]
  • If the input parameter is not recognizable, an empty string is returned. [0363]
  • IDL Syntax [0364]
  • string monthNameFromString(in string aDate); [0365]
  • ICBCDate::notEqualTo [0366]
  • The opposite of the operator==member. [0367]
  • IDL Syntax [0368]
  • boolean notEqualTo(in ICBCDate aDate); [0369]
  • ICBCDate::quarter [0370]
  • Returns a number for the quarter within the year for this object. Dates between January 1 and March 31 are in the first quarter, and so on. [0371]
  • IDL Syntax [0372]
  • long quarter( ); [0373]
  • ICBCDate::quarterFromString [0374]
  • Returns a number for the quarter within the year for the date encoded in the input string parameter. The input string parameter must conform to a format recognizable as a date. Refer to ICBCDate::initializeFromString for a description of supported formats. Dates between January 1 and March 31 are in the first quarter, and so on. [0375]
  • If the input parameter is not recognizable, a value of −1 is returned. [0376]
  • IDL Syntax [0377]
  • long quarterFromString(in string aDate); [0378]
  • ICBCDate::year [0379]
  • Returns the year part of the date. [0380]
  • IDL Syntax [0381]
  • long year( ); [0382]
  • ICBCDate::yearFromString [0383]
  • Returns the year part of the date encoded in the input string parameter. The input string parameter must conform to a format recognizable as a date. Refer to ICBCDate::initializeFromString for a description of supported formats. [0384]
  • If the input parameter is not recognizable, a value of −1 is returned. [0385]
  • IDL Syntax [0386]
  • long yearFromString(in string aString); [0387]
  • ICBCDecimal Class [0388]
  • The class stores the value of a DB2 Decimal data type, or Oracle number type in which scale is less than or equal to precision, and positive with a maximum precision of 38. All access and manipulation of this value is through a public functional interface. The actual decimal value and its precision and scale are stored in private attributes. [0389]
    Important
    Throughout the description of ICBCDecimal, precision is the total number
    of digits in the decimal number; scale is the number of digits in the
    fractional part of the number - - - the number of digits that lie to the right
    of the decimal point.
  • IDL Interface Description [0390]
  • interface ICBCDecimal :IManagedLocal::ILocalOnly [0391]
    {
    // Object initialization (DB2 semantics)
    boolean initializeFromString1(in string aString, in short aPrecision,
       in short aScale, in char aDecimalChar);
    boolean initializeFromString2(in string aString, in char aDecimalChar);
    boolean initializeFromDouble(in double aDouble,in short aPrecision,
       in short aScale);
    boolean initializeFromFloat(in float aFloat, in short aPrecision,
       in short aScale);
    boolean initializeFromLong(in long aLong, in short aPrecision,
       in short aScale);
    boolean initializeFromShort(in short aShort, in short aPrecision,
       in short aScale);
    boolean initializeFromDecimal1(in ICBCDecimal aDecimal, in short aPrecision,
       in short aScale);
    boolean initializeFromDecimal2(in ICBCDecimal aDecimal);
    boolean initializeFromPackedDecimal(in string aString,in short aPrecision,
       in short aScale);
    //Comparisons
    boolean equalTo(in ICBCDecimal aDecimal);
    boolean notEqualTo(in ICBCDecimal aDecimal);
    boolean lessThan(in ICBCDecimal aDecimal);
    boolean lessThanOrEqualTo(in ICBCDecimal aDecimal);
    boolean greaterThan(in ICBCDecimal aDecimal);
    boolean greaterThanOrEqualTo(in ICBCDecimal aDecimal);
    //Query functions
    string getAsFormattedString1(inout string aOutput,
       in char aDecimalCharacter);
    string getAsFormattedString2(inout string aOutput,
       in char aDecimalCharacter);
    string getAsFormattedString3(inout string aOutput,
       in char aDecimalCharacter);
    double getAsDouble();
    float getAsFloat();
    long getAsLong();
    short getAsShort();
    string getAsDigits(inout string aOutput);
    string getAsPackedDecimal(inout string aOutput, inout short aPrecision,
       inout short aScale);
    short getPrecision();
    short getScale();
    boolean isNegative();
    boolean isChanged();
    // Manipulation functions
    ICBCDecimal assignFromDecimal(in ICBCDecimal aDecimal);
    ICBCDecimal assignFromDouble(in double aDouble);
    ICBCDecimal assignFromFloat(in float aFloat);
    ICBCDecimal assignFromLong(in long aLong);
    ICBCDecimal assignFromShort(in short aShort);
    ICBCDecimal increment(in ICBCDecimal aDecimal);
    ICBCDecimal decrement(in ICBCDecimal aDecimal);
    ICBCDecimal multiplyThisObjectBy(in ICBCDecimal aDecimal);
    ICBCDecimal divideThisObjectBy(in ICBCDecimal aDecimal);
    ICBCDecimal remainderInThisObject(in ICBCDecimal aDecimal);
    ICBCDecimal addWithNewObject(in ICBCDecimal aDecimal);
    ICBCDecimal subtractWithNewObject(in ICBCDecimal aDecimal);
    ICBCDecimal multiplyWithNewObject(in ICBCDecimal aDecimal);
    ICBCDecimal divideWithNewObject(in ICBCDecimal aDecimal);
    ICBCDecimal remainderWithNewObject(in ICBCDecimal aDecimal);
    ICBCDecimal getPrecedingRemainder();
    void swapSign();
    boolean decimalOverflow();
    };
  • Supported Methods [0392]
  • ICBCDecimal::addWithNewObject [0393]
  • ICBCDecimal::assignFromDecimal [0394]
  • ICBCDecimal::assignFromDouble [0395]
  • ICBCDecimal::assignFromFloat [0396]
  • ICBCDecimal::assignFromLong [0397]
  • ICBCDecimal::assignFromShort [0398]
  • ICBCDecimal:: create [0399]
  • ICBCDecimal::decimalOverflow [0400]
  • ICBCDecimal::decrement [0401]
  • ICBCDecimal::divideThisObjectBy [0402]
  • ICBCDecimal::divideWithNewObject [0403]
  • ICBCDecimal::equalTo [0404]
  • ICBCDecimal::getAsDouble [0405]
  • ICBCDecimal::getAsFloat [0406]
  • ICBCDecimal::getAsFormattedString1 [0407]
  • ICBCDecimal::getAsFormattedString2 [0408]
  • ICBCDecimal::getAsFormattedString3 [0409]
  • ICBCDecimal::getAsDigits [0410]
  • ICBCDecimal::getAsLong [0411]
  • ICBCDecimal::getAsPackedDecimal [0412]
  • ICBCDecimal::getAsShort [0413]
  • ICBCDecimal::getPreceedingRemainder [0414]
  • ICBCDecimal::getPrecision [0415]
  • ICBCDecimal::getScale [0416]
  • ICBCDecimal::greaterThan [0417]
  • ICBCDecimal::greaterThanOrEgualTo [0418]
  • ICBCDecimal::increment [0419]
  • ICBCDecimal::initializeFromDecimal1 [0420]
  • ICBCDecimal::initializeFromDecimal2 [0421]
  • ICBCDecimal::initializeFromDouble [0422]
  • ICBCDecimal::initializeFromFloat [0423]
  • ICBCDecimal::initializeFromLong [0424]
  • ICBCDecimal::initializeFromPackedDecimal [0425]
  • ICBCDecimal::initializeFromShort [0426]
  • ICBCDecimal::initializeFromString1 [0427]
  • ICBCDecimal::initializeFromString2 [0428]
  • ICBCDecimal::isChanged [0429]
  • ICBCDecimal::isNegative [0430]
  • ICBCDecimal::lessThan [0431]
  • ICBCDecimal::lessThanOrEqualTo [0432]
  • ICBCDecimal::multiplyWithNewObject [0433]
  • ICBCDecimal::multiplyThisObjectBy [0434]
  • ICBCDecimal::notEqualTo [0435]
  • ICBCDecimal::remainderInThisObject [0436]
  • ICBCDecimal::remainderWithNewObject [0437]
  • ICBCDecimal::subtractWithNewObject [0438]
  • ICBCDecimal::swapSign [0439]
  • ICBCDecimal::addWithNewObject [0440]
  • Adds the receiving object and the argument ICBCDecimal object and returns a new ICBCDecimal object containing the result. The original operand objects are unchanged. The precision of the result object is: [0441]
  • min(38, max(p1−s1, p2−s2)+max(s1, s2)+1) [0442]
  • The scale is: max(s1, s2) [0443]
  • IDL Syntax [0444]
  • ICBCDecimal addWithNewObject(in ICBCDecimal aDecimal); [0445]
  • Remarks [0446]
  • After a addWithNewObject operation, the change flag of the new object is set to TRUE. The change flag of the original object is unchanged. [0447]
  • It is the application's responsibility to delete the new object, freeing its memory, when no longer needed. [0448]
  • If the non-zero digits to the left of the decimal point in the result object would exceed (p−s)of the result, or if other errors occur that prevent the creation of the new object, an ICBCDecimal pointer with value −1 is returned. [0449]
  • ICBCDecimal::assignFromDecimal [0450]
  • Sets the value of the receiving ICBCDecimal object equal to that of the second ICBCDecimal object. The precision and scale of the receiving object are not changed. [0451]
  • IDL Syntax [0452]
  • ICBCDecimal assignFromDecimal(in ICBCDecimal aDecimal); [0453]
  • Remarks [0454]
  • If the non-zero digits to the left of the decimal point in the source object exceed (p1−s1) of the receiving object (i.e.,the whole number of the source object will not fit in the receiving object), the receiving object is unchanged, and a following invocation of decimalOverflow( ) on the receiving object function will return the value TRUE. [0455]
  • The scale of the source object is reduced to fit the scale of the receiving object, if necessary, by truncating digits from the right. [0456]
  • Any remainder value in the source object resulting from a preceding division operation is not transferred to the receiving object. [0457]
  • The change flag of the receiving object is set to TRUE. [0458]
  • Note that this operation preserves the precision and scale of the receiving object, as in a DB2 regular assignment between two decimal types. In contrast, the ICBCDecimal::initializeFromDecimal( ) function sets the precision and scale of the receiving object, as in the DB2 DECIMAL built-in function. [0459]
  • ICBCDecimal::assignFromDouble [0460]
  • Sets the value of a receiving ICBCDecimal object equal to a double variable. The precision and scale of the object is not changed. [0461]
  • IDL Syntax [0462]
  • ICBCDecimal assignFromDouble(in double aDouble); [0463]
  • Remarks [0464]
  • The operand is converted to a temporary decimal object of precision 38. Numbers less than 0.5E-38 will be rounded to zero. The temporary decimal number is then converted to the precision and scale of the receiving ICBCDecimal object. [0465]
  • If the non-zero digits to the left of the decimal point in the source object exceed (p1−s1) of the receiving object (i.e., the whole number portion of the source object will not fit in the receiving object), the receiving object is unchanged, and a following invocation of decimalOverflow( ) function on the receiving object will return the value TRUE. [0466]
  • ICBCDecimal::assignFromFloat [0467]
  • Sets the value of a receiving ICBCDecimal object equal to a float variable. The precision and scale of the object is not changed. [0468]
  • IDL Syntax [0469]
  • ICBCDecimal assignFromFloat(in float aFloat); [0470]
  • Remarks [0471]
  • The operand is converted to a temporary decimal object of precision 38. Numbers less than 0.5E-38 will be rounded to zero. The temporary decimal number is then converted to the precision and scale of the receiving ICBCDecimal object. [0472]
  • If the non-zero digits to the left of the decimal point in the source object exceed p1−s1) of the receiving object (i.e., the whole number portion of the source object will not fit in the receiving object), the receiving object is unchanged, and a following invocation of decimalOverflow( ) function on the receiving object will return the value TRUE. [0473]
  • ICBCDecimal::assignFromLong [0474]
  • Sets the value of a receiving ICBCDecimal object equal to a long variable. The precision and scale of the object is not changed. [0475]
  • IDL Syntax [0476]
  • ICBCDecimal assignFromLong(in long aLong); [0477]
  • Remarks [0478]
  • The operand is converted to a temporary decimal number, of precision 11 which is then converted to the precision and scale of the receiving object. [0479]
  • If the non-zero digits to the left of the decimal point in the source object exceed (p1−s1) of the receiving object (i.e., the whole number portion of the source object will not fit in the receiving object), the receiving object is unchanged, and a following invocation of decimalOverflow( ) function will return the value TRUE on the receiving object. [0480]
  • ICBCDecimal::assignFromShort [0481]
  • Sets the value of a receiving ICBCDecimal object equal to a short variable. The precision and scale of the object is not changed. [0482]
  • IDL Syntax [0483]
  • ICBCDecimal assignFromShort(in short aShort); [0484]
  • Remarks [0485]
  • The operand is converted to a temporary decimal number, of precision 5 which is then converted to the precision and scale of the receiving object. [0486]
  • If the non-zero digits to the left of the decimal point in the source object exceed (p1−s1) of the receiving object (i.e., the whole number portion of the source object will not fit in the receiving object), the receiving object is unchanged, and a following invocation of decimalOverflow( ) function on the receiving object will return the value TRUE. [0487]
  • ICBCDecimal::_create [0488]
  • Returns a pointer to a new ICBCDecimal object. The object is initialized to zero, with precision=1 and scale=0. [0489]
  • ICBCDecimal::decimalOverflow [0490]
  • Following certain functions that potentially cause a precision overflow in a ICBCDecimal object, this function indicates whether an overflow did, in fact, take place. If the most recent initialization, assignment, or arithmetic operation caused an overflow, this function will return TRUE. Otherwise it returns FALSE. Intervening query or comparison operations will not affect the returned value. [0491]
  • IDL Syntax [0492]
  • boolean decimalOverflow( ); [0493]
  • ICBCDecimal::decrement [0494]
  • Subtracts the argument ICBCDecimal object from the receiving ICBCDecimal object and sets the value of the receiving object to the result. The precision and scale of the receiving object are reset. [0495]
  • The precision is given by: [0496]
  • min(38, max(p1−s1, p2−s2)+max(s1, s2)+1) [0497]
  • The scale is given by: [0498]
  • max(s1, s2) [0499]
  • If the non-zero digits to the left of the decimal point in the result exceed p−s) of the result, the receiving object is not changed, and a following invocation of the function decimalOverflow( ) will return TRUE. [0500]
  • The change flag of the receiving object is set to TRUE. [0501]
  • IDL Syntax [0502]
  • ICBCDecimal decrement(in ICBCDecimal aDecimal); [0503]
  • ICBCDecimal::divideThisObjectBy [0504]
  • Divides the receiving object by the argument ICBCDecimal object, and sets the receiving object to the quotient. The precision and scale of the receiving object are reset. [0505]
  • The precision is 38. [0506]
  • The scale is given by: [0507]
  • 38−p1+s1−s2 [0508]
  • Scale may not be negative. [0509]
  • The division proceeds as far as possible within these limits for the quotient and then stops. Any remainder can be retrieved using the getPrecedingRemainder( ) function (see ICBCDecimal::getPreceedingRemainder). [0510]
  • This function does not cause any overflow conditions. However, the decimalOverflow( ) function is used to warn of zeroDivide situations, returning TRUE if a zeroDivide occured in the preceding divideThisObjectBy( ) function, and FALSE if it did not. [0511]
  • After a divideThisObjectBy operation, the change flag of the receiving object is set to TRUE. For example, 200.00 (precision 5, scale 2) divided by 3.00 (precision 3, scale 2) returns a quotient of precision 38 and scale 33: [0512]
  • 00066.666666666666666666666666666666666 [0513]
  • A subsequent call to getPrecedingRemainder( ) on the same object returns a remainder with precision 38 and scale 35: [0514]
  • 000.00000000000000000000000000000000200 [0515]
  • IDL Syntax [0516]
  • ICBCDecimal divideThisObjectBy(in ICBCDecimal aDecimal); [0517]
  • ICBCDecimal::divideWithNewObject [0518]
  • Divides the receiving object and the argument ICBCDecimal object, and returns a new ICBCDecimal object containing the quotient. The original operand objects are unchanged. [0519]
  • The precision of the result object is 38. [0520]
  • The scale is: 38−p1+s1−s2 [0521]
  • IDL Syntax [0522]
  • ICBCDecimal divideWithNewObject(in ICBCDecimal aDecimal); [0523]
  • Remarks [0524]
  • The division proceeds as far as possible within these limits and then stops. Any remainder can be retrieved using the getPrecedingRemainder( ) function (see ICBCDecimal::getPreceedingRemainder).For an example of a divide operation, see ICBCDecimal::divideThisObjectBy. [0525]
  • After a divideWithNewObject operation, the change flag of the new object is set to TRUE. The change flag of the original object is unchanged. [0526]
  • It is the application's responsibility to delete the new remainder object, freeing its memory, when no longer needed. [0527]
  • This function does not cause any overflow conditions, but may encounter a zeroDivide situation. If so, or if other errors occured that prevented the creation of the new object, an ICBCDecimal pointer with value −1 is returned. [0528]
  • ICBCDecimal::equalTo [0529]
  • Returns TRUE if the value of the receiving ICBCDecimal object is equal to the other ICBCDecimal object. [0530]
  • IDL Syntax [0531]
  • boolean equalTo(in ICBDecimal aDecimal); [0532]
  • ICBCDecimal::getAsDouble [0533]
  • Returns the value of the receiving object as a double. Since the double representation has maximum precision less than that of a decimal data type in DB2, accuracy of the object value may be lost. [0534]
  • IDL Syntax [0535]
  • double getAsDouble( ); [0536]
  • ICBCDecimal::getAsFloat [0537]
  • Returns the value of the receiving object as a float. Since the float representation has maximum precision less than that of a decimal data type in DB2, accuracy of the object value may be lost. [0538]
  • IDL Syntax [0539]
  • double getAsFloat( ); [0540]
  • ICBCDecimal::getAsFormattedString1 [0541]
  • Returns the value of the receiving object as a formatted string. This function is equivalent to the CHAR( ) built-in function of DB2. [0542]
  • The application must supply a non-const pointer to a target storage area long enough to receive the formatted decimal number. The function returns a reference to this area. [0543]
  • IDL Syntax [0544]
  • string getAsFormattedString1(inout string aOutput, in char aDecimalCharacter); [0545]
  • Parameters [0546]
  • AdecimalCharacter [0547]
  • aDecimalCharacter must be a single character to be used as the “decimal point” character in the output.The characters plus (+) and minus (−) are not permitted, and blanks are not permitted. [0548]
  • The length of the output string is always precision +2, where precision is the current precision of the object. One of the additional character positions is always used for the decimal point. If required, the the additional character position is used for a leading sign. If a sign is not required, the output string will have a trailing blank. Leading and trailing padding zeros are provided if necessary to fill the current precision and scale of the object. [0549]
  • For example, assuming an aDecimalCharacter of ‘.’: [0550]
    Value Precision Scale Prints as
    45 2 0 “45.”
    123.33 9 4 “00123.3300”
    −123.33 9 4 “−00123.3300”
  • ICBCDecimal::getAsFormattedString2 [0551]
  • Returns the value of the receiving object as a string formatted without leading zero padding. The application must supply a non-const pointer to a target storage area long enough to receive the formatted decimal number. The function returns a reference to this area. [0552]
  • IDL Syntax [0553]
  • string getAsFormattedString2(inout string aOutput, in char aDecimalCharacter); [0554]
  • Parameters [0555]
  • ADecimalCharacter [0556]
  • ADecimalCharacter must be a single character to be used as the “decimal point” character in the output. The characters plus (+) and minus (−) are not permitted, and blanks are not permitted. The length of the output string is always precision +2, where precision is the current precision of the object. The leftmost character position is reserved for the sign, if necessary. The following positions contain the the number, with an embedded decimal point, which is always present, even if the scale of the number is zero. The digits in the number are padded with leading blanks and trailing zeros to fill the full current precision and scale of the object. Finally, if leading blanks are present, the sign moves to a position immediately adjacent to the first digit (or decimal point). [0557]
  • For example, assuming an aDecimalCharacter of ‘.’, and showing blank as the character ‘b’: [0558]
    Value Precision Scale Prints as
    45 2 0 “b45.”
    123.33 9 4 “bbb123.3300”
    −123.33 9 4 “bb−123.3300”
  • ICBCDecimal::getAsFormattedString3 [0559]
  • Returns the value of the receiving object formatted as a left justified string with a leading sign if required, and a decimal point only if there are digits that lie to the right of the decimal point. There are no leading or trailing zeros or blanks. [0560]
  • The application must supply a non-const pointer to a target storage area long enough to receive the formatted decimal number. The function returns a reference to this area. [0561]
  • IDL Syntax [0562]
  • string getAsFormattedString3(inout string aOutput, in char aDecimalCharacter); [0563]
  • Parameters [0564]
  • aDecimalCharacter [0565]
  • aDecimalCharacter must be a single character to be used as the “decimal point” character in the output. The characters plus (+) and minus (−) are not permitted, and blanks are not permitted. [0566]
  • The length of the output string is variable, containing only enough characters to hold the significant digits plus a sign and a decimal point if required. The precision and scale of the object are not reflected in the length output string. [0567]
  • This format is suitable for providing to the Oracle TO_NUMBER function without the need for an associated “NUMBER format element” parameter. [0568]
  • For example, assuming an aDecimalCharacter of ‘.’: [0569]
    Value Precision Scale Prints as
    45 2 0 “45.”
    123.33 9 4 “123.33”
    −123.33 9 4 “−123.33”
  • ICBCDecimal::getAsDigits [0570]
  • Returns a null terminated string of length equal to the precision of the object, containing the digits in the value of the object, left justified, and without either decimal point or sign. Leading zeros are provided if necessary.For example, an object of precision and scale of 6 and 2 respectively, containing a value of −6.28 would return a string containing ‘000628’. [0571]
  • IDL Syntax [0572]
  • string getAsDigits(inout string aOutput); [0573]
  • Remarks [0574]
  • The application must supply a non-const pointer to a target storage area long enough to receive the digits and null terminator. The function returns a reference to this area. [0575]
  • ICBCDecimal::getAsLong [0576]
  • Returns the value of the receiving object as a long. All digits in the object value that lie to the right of the decimal point will be truncated. It is a user responsibility to ensure that the value of the object does not exceed the range for a long data type. [0577]
  • IDL Syntax [0578]
  • double getAsLong( ); [0579]
  • ICBCDecimal::getAsPackedDecimal [0580]
  • Returns the value of the object as a packed decimal string. [0581]
  • The format of the returned packed string will one of the following: [0582]
  • [dd]..[ds] if the number of digits is odd [0583]
  • [Od]..[ds] if the number of digits is even [0584]
  • where [ ] denotes a single byte containing two 4-bit nibbles, d is a four-bit binary digit, 0 is a 4-bit binary zero, and s is a 4-bit sign representation. A hexadecimal value “C” denotes the positive sign, and “D” the negative sign. A sign is always present in the lower order four bits of the rightmost byte. [0585]
  • Parameters [0586]
  • There is no decimal point embedded in the string. Output parameters are updated to describe the precision (aPrecision), and scale (aScale), of the packed string aScale. [0587]
  • IDL Syntax [0588]
  • string getAsPackedDecimal(inout string aOutput, inout short aPrecision, inout short aScale); [0589]
  • Remarks [0590]
  • Because of the presence of the sign, and the packing of two digits per byte, strings with an even number of bytes will have a leading zero padding character. [0591]
  • It is the responsibility of the application to provide a string of sufficient length to receive the packed string, with its sign and leading zero (if present). On return, a null terminator is appended to the end of the string. [0592]
  • ICBCDecimal::getAsShort [0593]
  • Returns the value of the receiving object as a short. All digits in the object value that lie to the right of the decimal point will be truncated. It is a user responsibility to ensure that the value of the object does not exceed the range for a long data type. [0594]
  • IDL Syntax [0595]
  • double getAsShort( ); [0596]
  • ICBCDecimal::getPreceedingRemainder [0597]
  • Returns a new object containing the remainder value of an immediately preceding division operation. This function may be invoked on an object that has been the subject of a divideThisObjectBy( ) operation, or on the new object produced by a divideWithNewObject( ) operation. This function will only return a meaningful result if used immediately after a divide operation. If used following any other manipulation function it will return an object with a zero value. [0598]
  • The precision of the result object is 38. [0599]
  • The scale is: 38−p1+s1 [0600]
  • IDL Syntax [0601]
  • ICBCDecimal getPreceedingRemainder( ); [0602]
  • Remarks [0603]
  • If errors occur that prevent creation of the new object, a ICBCDecimal pointer with value−1 is returned. [0604]
  • If a division operation has already been performed, this function is a more efficient way of obtaining the remainder than issuing a remainderInThisObject( ) or remainderWithNewObject( ). This function retrieves the remainder that was cached in the object as a by-product of the preceding divide operation, whereas the latter two functions perform an implicit divide to calculate the remainder. [0605]
  • It is the application's responsibility to delete the new remainder object, freeing its memory, when no longer needed. [0606]
  • ICBCDecimal::getPrecision [0607]
  • Returns the precision of the object—the maximum number of digits that make up the value of the object. Precision is conceptually similar to the precision of a DB2 column. For example, an object with precision and scale of 5 and 2 respectively can store numbers up to value 999.99, but could not store numbers 1000.00, nor 999.991, nor 99.991. Precision is set by an ICBCDecimal::initialize..( ) function, and is generally retained by the object through its lifetime unless changed by arithmetic functions. [0608]
  • IDL Syntax [0609]
  • short getPrecision( ); [0610]
  • ICBCDecimal::getScale [0611]
  • Returns the scale of the object. Scale, like precision (see ICBCDecimal::getPrecision), is set by the ICBCDecimal::initialize..( ) functions, and is generally retained by the object through its lifetime unless changed by arithmetic operations. [0612]
  • IDL Syntax [0613]
  • short getScale( ); [0614]
  • ICBCDecimal::greaterThan [0615]
  • Returns TRUE if the value of the receiving ICBCDecimal object is greater than the other ICBCDecimal object. [0616]
  • IDL Syntax [0617]
  • boolean greaterThan(in ICBCDecimal aDecimal); [0618]
  • ICBCDecimal::greaterThanOrEqualTo [0619]
  • Returns TRUE if the value of the receiving ICBCDecimal object is greater than or equal to the other ICBCDecimal object. [0620]
  • IDL Syntax [0621]
  • boolean greaterThanOrEqualTo(in ICBCDecimal aDecimal); [0622]
  • ICBCDecimal::increment [0623]
  • Adds the argument ICBCDecimal object to the receiving ICBCDecimal object and sets the value of the receiving object to the result. The precision and scale of the receiving object are reset. The precision is given by: [0624]
  • min(38, max(1−s1, p2−s2)+max(s1, s2)+1) [0625]
  • The scale is given by: [0626]
  • max(s1, s2) [0627]
  • If the non-zero digits to the left of the decimal point in the result exceed (p−s) of the result, the receiving object is not changed, and a following invocation of the function decimalOverflow( ) will return TRUE. [0628]
  • After an increment operation, the change flag of the receiving object is set to TRUE. [0629]
  • IDL Syntax [0630]
  • ICBCDecimal increment(in ICBCDecimal aDecimal); [0631]
  • ICBCDecimal::initializeFromDecimal1 [0632]
  • Initializes the receiving object with the value of the argument ICBCDecimal object, and sets its precision and scale to the values of the parameters. [0633]
  • IDL Syntax [0634]
  • boolean initializeFromDecimal1(in ICBCDecimal aDecimal in short precision, in short scale); [0635]
  • Remarks [0636]
  • This function requires parameters to be explicitly specified for the precision and scale of the receiving object, precision must be a number between zero and 38. If zero, a default value of 15 is assumed, scale must be a number between C and the value of precision. If precision is zero, the value of scale is ignored and the scale of the object is taken to be zero. The value of precision—scale must be sufficient to contain the digits to the left of the decimal point in the source ICBCDecimal object. If scale is insufficient to contain the digits to the right of the decimal point, those digits will be truncated from the right. [0637]
  • The difference between this function and ICBCDecimal::assignFromDecimal( ) is that this function sets the precision and scale of the receiving object, whereas ICBCDecimal::assignFromDecimal( ) leaves the existing precision and scale of the receiving object unchanged. [0638]
  • If the the object can be successfully initialized from the other Decimal object, TRUE is returned and any existing value in the object is replaced. If the initialization cannot be performed, FALSE is returned and the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE. [0639]
  • ICBCDecimal::initializeFromDecimal2 [0640]
  • Initializes the receiving object with the value of the argument ICBCDecimal object, and sets its precision and scale to the values of the parameters. [0641]
  • IDL Syntax [0642]
  • boolean initializeFromDecimal2(in ICBCDecimal aDecimal); [0643]
  • Remarks [0644]
  • This function has no explicit parameters for precision and scale. The precision and scale of the receiving object are set to the same values as the source Decimal object. [0645]
  • The difference between this function and ICBCDecimal::assignFromDecimal( ) is that this function sets the precision and scale of the receiving object, whereas ICBCDecimal::assignFromDecimal( ) leaves the existing precision and scale of the receiving object unchanged. [0646]
  • If the the object can be successfully initialized from the other Decimal object, TRUE is returned and any existing value in the object is replaced. If the initialization cannot be performed, FALSE is returned and the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE. [0647]
  • ICBCDecimal::initializeFromDouble [0648]
  • Initializes the receiving object with the value of an argument of type double, and sets its precision and scale. [0649]
  • IDL Syntax [0650]
  • boolean initializeFromDouble(in double aDouble in short precision, in short scale); [0651]
  • Parameters Precision [0652]
  • scale [0653]
  • Precision must be a number between zero and 38. A zero value implies that the application is not supplying values for precision or scale. In this case, a default value of 15 is assumed. [0654]
  • Scale must be a number between 0 and the value of precision. If precision is zero, the value of scale is ignored and a value of zero is assumed. [0655]
  • Remarks [0656]
  • If the the object can be successfully initialized with the numeric operand, TRUE is returned and any existing value in the object is replaced. If the initialization cannot be performed, FALSE is returned and the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE. [0657]
  • Precision and scale must be such that (precision—scale) is sufficient to contain the digits to the left of the decimal point in the numeric operand. If scale is insufficient to contain the digits to the right of the decimal point, those digits will be truncated from the right. [0658]
  • ICBCDecimal::initializeFromFloat [0659]
  • Initializes the receiving object with the value of an argument of type float, and sets its precision and scale. [0660]
  • IDL Syntax [0661]
  • boolean initializeFromFloat(in float aFloat in short precision, in short scale); [0662]
  • Parameters Precision [0663]
  • scale [0664]
  • Precision must be a number between zero and 38. A zero value implies that the Precision application is not supplying values for precision or scale. In this case, a default value of 15 is assumed. [0665]
  • Scale must be a number between 0 and the value of precision. If precision is zero, the value of scale is ignored and a value of zero is assumed. [0666]
  • Remarks [0667]
  • If the the object can be successfully initialized with the numeric operand, TRUE is returned and any existing value in the object is replaced. If the initialization cannot be performed, FALSE is returned and the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE. [0668]
  • Precision and scale must be such that (precision—scale) is sufficient to contain the digits to the left of the decimal point in the numeric operand. If scale is insufficient to contain the digits to the right of the decimal point, those digits will be truncated from the right. [0669]
  • ICBCDecimal::initializeFromLong [0670]
  • Initializes the receiving object with the value of an argument of type long, and sets its precision and scale. [0671]
  • IDL Syntax [0672]
  • boolean initializeFromLong(in long along in short precision, in short scale); [0673]
  • Parameters Precision [0674]
  • scale [0675]
  • Precision must be a number between zero and 38. A zero value implies that the Precision application is not supplying values for precision or scale. In this case, a default value of 11 is assumed. [0676]
  • Scale must be a number between 0 and the value of precision. If precision is zero, the value of scale is ignored and a value of zero is assumed. [0677]
  • Remarks [0678]
  • If the the object can be successfully initialized with the numeric operand, TRUE is returned and any existing value in the object is replaced. If the initialization cannot be performed, FALSE is returned and the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE. [0679]
  • Precision and scale must be such that (precision—scale) is sufficient to contain the digits in the numeric operand. [0680]
  • ICBCDecimal::initializeFromPackedDecimal [0681]
  • Accepts a value in the form of a packed decimal string. [0682]
  • IDL Syntax [0683]
  • boolean initializeFromPackedDecimal(in string aString, in short aPrecision, in short aScale); [0684]
  • Parameters [0685]
  • aString [0686]
  • Precision [0687]
  • scale [0688]
  • must have one of the following forms: [0689]
  • [dd][dd]...[ds] if number of digits is odd [0690]
  • [0d][dd]...[ds] if number of digits is even [0691]
  • Where [ ] denotes a byte containing two 4-bit “nibbles”, d is a four-bit binary digit, 0 is a 4-bit binary zero, and s is a 4-bit sign representation. The hexadecimal value “C” is interpreted as the positive sign, and “D” as the negative sign. There is no embedded decimal point. The scale of the object is defined by the scale input argument aScale. The number of digits unpacked from aString is defined by the aPrecision argument. The sign is always present in the lower order four bits of the rightmost byte. Because of the presence of the sign, and the packing of two digits per byte, strings with an even number of bytes will have a leading zero padding character. [0692]
  • This format is consistent with that used by DB2 for packed decimal variables passed to an application program. [0693]
  • This must be a number between zero and 38, and must always be present. There is no default. [0694]
  • This parameter must be a number between 0 and the value of precision. It indicates the number of digits that lie to the right of the decimal point. It must always be present. [0695]
  • There is no default. A null terminator character on the packed string is not required, but is tolerated if present. [0696]
  • Remarks [0697]
  • If the string is a valid packed decimal representation and the object is successfully initialized, TRUE is returned and any existing value in the object is replaced. Returns FALSE if the parameter is invalid. If FALSE is returned the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE. [0698]
  • ICBCDecimal::initializeFromShort [0699]
  • Initializes the receiving object with the value of an argument of type short, and sets its precision and scale. [0700]
  • IDL Syntax [0701]
  • boolean initializeFromShort(in short aShort in short precision, in short scale); [0702]
  • Parameters precision [0703]
  • scale [0704]
  • Precision must be a number between zero and 38. A zero value implies that the application is not supplying values for precision or scale. In this case, a default value of 5 is assumed. [0705]
  • Scale must be a number between 0 and the value of precision. If precision is zero, the value of scale is ignored and a value of zero is assumed. [0706]
  • Remarks [0707]
  • If the the object can be successfully initialized with the numeric operand, TRUE is returned and any existing value in the object is replaced. If the initialization cannot be performed, FALSE is returned and the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE. [0708]
  • Precision and scale must be such that (precision—scale) is sufficient to contain the digits in the numeric operand. [0709]
  • ICBCDecimal::initializeFromString1 [0710]
  • Accepts a value for this decimal object in the form of a string, specified values for precision and scale of the object, and the character that is used in the string as the decimal point (if any). [0711]
  • IDL Syntax [0712]
  • boolean initializeFromString1(in string aString, in short precision, in short scale, in char decimalChar); [0713]
  • Parameters [0714]
  • A String [0715]
  • decimalChar [0716]
  • precision [0717]
  • scale [0718]
  • The parameter aString must be of the form: [0719]
  • A String [spaces][sign][zeros][digits][decimal point][digits][zeros]&lbrk.spaces][0720]
  • A negative sign is ignored if the value represented by the string is zero. decimalChar must be a single character that is used in aString to represent the decimal point. The characters plus (+) and minus (−) are not permitted, and blanks are not permitted. [0721]
  • Precision must be a number between zero and 38. If the value is zero, a default precision of 15 and a default scale of zero are used (the parameter for scale is ignored in this case). Otherwise the parameter values for precision and scale are used. [0722]
  • Scale must be a number between 0 and the value of precision. It indicates the number of digits that lie to the right of the decimal point. Note that if the parameter precision is zero, the value of scale is ignored and a default scale of zero is used. [0723]
  • Remarks [0724]
  • If the parameters are valid, TRUE is returned and any existing value in the object is replaced. If the parameter is invalid, FALSE is returned and the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE. [0725]
  • Precision and scale must be such that (precision—scale) is sufficient to contain the non-zero characters to the left of the decimal point in aString. If scale is insufficient to contain the characters to the right of the decimal point, those characters will be truncated from the right. [0726]
  • ICBCDecimal::initializeFromString2 [0727]
  • Accepts a value for this decimal object in the form of a string, and the character used in the string as a decimal point. [0728]
  • IDL Syntax [0729]
  • boolean initializeFromString2(in string aString, in char aDecimalChar); [0730]
  • Remarks [0731]
  • The precision and scale of the object are set to the actual precision and scale of the string parameter. The precision is the total number of digits, including leading and trailing zeros. The scale is the number of digits to the right of the decimal point, including trailing zeros. In other respects, this function behaves the same as ICBCDecimal::initializeFromString1( ). [0732]
  • If the input parameters are valid, TRUE is returned and any existing value in the object is replaced. If the parameter is invalid, FALSE is returned and the state of the object is unchanged, except that, if the FALSE return resulted from a numeric overflow, a following invocation of the decimalOverflow( ) function against the object will return the value TRUE. [0733]
  • ICBCDecimal::isChanged [0734]
  • Returns a boolean indicating whether the the value of the receiving object has been changed since its initialization. All initialization functions set a changed flag in the object to FALSE. All arithmetic and assignment functions set the flag TRUE. Query functions do not affect the changed flag. [0735]
  • IDL Syntax [0736]
  • boolean isChanged( ); [0737]
  • ICBCDecimal::isNegative [0738]
  • Returns a boolean indicating whether the the value of the receiving object is less than zero. [0739]
  • IDL Syntax [0740]
  • boolean isNegative( ); [0741]
  • ICBCDecimal::lessThan [0742]
  • Returns TRUE if the value of the receiving ICBCDecimal object is less than the other ICBCDecimal object. [0743]
  • IDL Syntax [0744]
  • boolean lessThan(in ICBCDecimal aDecimal); [0745]
  • ICBCDecimal::lessThanOrEqualTo [0746]
  • Returns TRUE if the value of the receiving ICBCDecimal object is less than or equal to the other ICBCDecimal object. [0747]
  • IDL Syntax [0748]
  • boolean lessThanOrEqualTo(in ICBCDecimal aDecimal); [0749]
  • ICBCDecimal::multiplyWithNewObject [0750]
  • Multiplies the receiving object by the argument ICBCDecimal object and returns a new ICBCDecimal object containing the result. The original operand objects are unchanged. The precision of the result object is: [0751]
  • min(38,p1+p2) [0752]
  • The scale is: min(38, s1+s2) [0753]
  • IDL Syntax [0754]
  • ICBCDecimal multiplyWithNewObject(in ICBCDecimal aDecimal); [0755]
  • Remarks [0756]
  • After a multiplyWithNewObject operation, the change flag of the new object is set to TRUE. The change flag of the original object is unchanged. [0757]
  • It is the application's responsibility to delete the new object, freeing its memory, when no longer needed. [0758]
  • If the non-zero digits to the left of the decimal point in the result object would exceed (p−s)of the result, or if other errors occur that prevent the creation of the new object, an ICBCDecimal pointer with value −1 is returned. [0759]
  • ICBCDecimal::notEqualTo [0760]
  • The opposite of the operator==member. [0761]
  • IDL Syntax [0762]
  • boolean notEqualTo(in ICBCDecimal aDecimal); [0763]
  • ICBCDecimal::multiplyThisObjectBy [0764]
  • Multiplies the receiving object by the argument ICBCDecimal object, and sets the receiving object to the result. The precision and scale of the receiving object are reset. The precision is given by: [0765]
  • min(38, p1+p2) [0766]
  • The scale is given by: [0767]
  • min(38, s1+s2) [0768]
  • If the non-zero digits to the left of the decimal point in the results exceed (p−s) of the result, the object is not changed, and a following invocation of the function decimalOverflow( ) will return TRUE. [0769]
  • The change flag of the receiving object is set to TRUE. [0770]
  • IDL Syntax [0771]
  • ICBCDecimal multiplyThisObjectBy(in ICBCDecimal aDecimal); [0772]
  • ICBCDecimal::remainderInThisObject [0773]
  • Divides the receiving object by the argument ICBCDecimal object, and sets the receiving object to the remainder of the division operation. The precision and scale of the receiving object are reset. [0774]
  • The change flag of the receiving object is set to TRUE. [0775]
  • The precision is: 38. [0776]
  • The scale is: 38−p1+s1 [0777]
  • IDL Syntax [0778]
  • ICBCDecimal remainderInThisObject(in ICBCDecimal aDecimal); [0779]
  • ICBCDecimal::remainderWithNewObject [0780]
  • Divides the receiving object by the argument ICBCDecimal object and returns a new ICBCDecimal object containing the remainder. The original operand objects are unchanged. [0781]
  • The precision of the result object is 38. [0782]
  • The scale is: 38−p1+s1 [0783]
  • IDL Syntax [0784]
  • ICBCDecimal remainderWithNewObject(in ICBCDecimal aDecimal); [0785]
  • Remarks [0786]
  • This function does not cause any overflow conditions, but may encounter a zeroDivide situation. If so, or if errors occur that prevent the recreation of the new object, a ICBCDecimal pointer with value −1 is returned. [0787]
  • After a remainderWithNewObject operation, the change flag of the new object is set to TRUE. The change flag of the original object is unchanged. [0788]
  • It is the application's responsibility to delete the new object, freeing its memory, when no longer needed. [0789]
  • ICBCDecimal::subtractWithNewObject [0790]
  • Subtracts the argument ICBCDecimal object from the receiving object and returns a new ICBCDecimal object containing the result. The original operand objects are unchanged. The precision of the result object is: [0791]
  • min(38, max(p1−s1, p2−s2)+max(s1, s2)+1) [0792]
  • The scale is: max(s1, s2) [0793]
  • IDL Syntax [0794]
  • ICBCDecimal subtractWithNewObject(in ICBCDecimal aDecimal); [0795]
  • Remarks [0796]
  • After a subtractWithNewObject operation, the change flag of the new object is set to TRUE. The change flag of the original object is unchanged. [0797]
  • It is the application's responsibility to delete the new object, freeing its memory, when no longer needed. [0798]
  • If the non-zero digits to the left of the decimal point in the result object would exceed p−s) of the result, or if other errors occur that prevent the creation of the new object, an ICBCDecimal pointer with value −1 is returned. [0799]
  • ICBCDecimal::swapSign [0800]
  • This function is effectively a unary minus operator which reverses the sign of this ICBCDecimal object. [0801]
  • IDL Syntax [0802]
  • void swapSign( ); [0803]
  • ICBCDuration Class [0804]
  • The class ICBCDuration represents the “Labeled Duration”, “Date Duration”, “Time Duration”, and “Timestamp Duration” constructs of DB2. Duration is a complementary data type to Date, Time, and Timestamp, and participates in SQL expressions. However, it is not, itself, stored in DB2 tables. [0805]
  • The class holds the value of a duration, and a record of whether this duration value is in units of years, months, days, hours, minutes seconds, or microseconds. The value can also be of a composite type defining a “Date Duration” of the form yyyymmdd, a “Time Duration” of the form hhmmss, or a “Timestamp Duration” of the form yyyymmddhhmmsszzzzzz. [0806]
  • Arithmetic between two ICBCDuration classes is not supported (This is consistent with DB2 support of Durations). However, they can be compared, and a unary minus operator (which swaps the sign) is provided. [0807]
  • IDL Interface Description [0808]
  • interface ICBCDuration :IManagedLocal::ILocalOnly [0809]
    {
    enum durationType {YEARS, MONTHS, DAYS, HOURS, MINUTES, SECONDS,
      MICROSECONDS, DATE, TIME, TIMESTAMP};
    // Object initialization
    // 1. Initializer for YEAR, MONTH, DAY, HOUR, MINUTE, SECOND
    // and MICROSECOND durations
    boolean initializeLabeledDuration(in long aDuration,
      in ICBCDuration::durationType aType);
    //Initializer for DATE and TIME durations
    boolean initializeDateTimeDuration(in long aValue1, in long aValue2,
      in long aValue3,
      in boolean aNegativeFlag,
      in ICBCDuration::durationType aType);
    //Initializer for TIMESTAMP durations
    boolean initializeTimestampDuration(in long aValue1, in long aValue2,
      in long aValue3, in long aValue4,
      in long aValue5, in long aValue6,
      in long aValue7,
      in boolean aNegativeFlag);
    /* Comparisons */
    boolean equalTo(in ICBCDuration aDuration);
    boolean notEqualTo(in ICBCDuration aDuration);
    boolean lessThan(in ICBCDuration aDuration);
    boolean lessThanOrEqualTo(in ICBCDuration aDuration);
    boolean greaterThan(in ICBCDuration aDuration);
    boolean greaterThanOrEqualTo(in ICBCDuration aDuration);
    /* Query functions */
    ICBCDuration::durationType getType();
    boolean isNegative();
    long microsecond();
    long second();
    long minute();
    long hour();
    long day();
    long month();
    long year();
    long size(in long aIntervalType);
    string formattedString(inout string aString);
    /* Manipulation functions */
    void assignFromDuration(in ICBCDuration aDuration);
    void swapSign();  // unary minus
    };
  • Supported Methods [0810]
  • ICBCDuration::_create [0811]
  • ICBCDuration::initializeLabeledDuration [0812]
  • ICBCDuration::initializeDateTimeDuration [0813]
  • ICBCDuration::initializeTimestampDuration [0814]
  • ICBCDuration::equalTo [0815]
  • ICBCDuration::notEqualTo [0816]
  • ICBCDuration::lessThan [0817]
  • ICBCDuration::lessThanOrEqualTo [0818]
  • ICBCDuration::greaterThan [0819]
  • ICBCDuration::greaterThanOrEqualTo [0820]
  • ICBCDuration::formattedString [0821]
  • ICBCDuration::getType [0822]
  • ICBCDuration::isNegative [0823]
  • ICBCDuration::microSecond [0824]
  • ICBCDuration::second [0825]
  • ICBCDuration::minute [0826]
  • ICBCDuration::hour [0827]
  • ICBCDuration::day [0828]
  • ICBCDuration::month [0829]
  • ICBCDuration::year [0830]
  • ICBCDuration::assignFromDuration [0831]
  • ICBCDuration::size [0832]
  • swapSign [0833]
  • ICBCDuration::assignFromDuration [0834]
  • Sets all state data of this ICBCDuration object equal to the the other ICBCDuration object. [0835]
  • IDL Syntax [0836]
  • void assignFromDuration(in ICBCDuration aDuration); [0837]
  • ICBCDuration::_create [0838]
  • Returns a pointer to a new ICBCDuration object. The object is initialized to a type of “YEARS” and a value of zero. [0839]
  • ICBCDuration::day [0840]
  • Returns the day part of the ICBCDuration. [0841]
  • IDL Syntax [0842]
  • long day( ); [0843]
  • ICBCDuration::equalTo [0844]
  • Returns TRUE if all state data of this ICBCDuration object is equal to the other ICBCDuration object. [0845]
  • IDL Syntax [0846]
  • boolean equalTo(in ICBCDuration aDuration); [0847]
  • ICBCDuration::formattedString [0848]
  • Returns the value of a DATE type duration as a string of the form yyyymmdd, a TIME type duration in the form hhmmss, or a TIMESTAMP duration in the form yyyymmddhhmmssmmmmmm. For other duration types this function returns a null string. [0849]
  • IDL Syntax [0850]
  • string formattedString(inout string aString); [0851]
  • The application must supply a non-const pointer to a target storage area long enough to receive the formatted date. The function returns a reference to this area, enabling the function to be nested in stream operations. [0852]
  • ICBCDuration::greaterThan [0853]
  • Returns TRUE if the value of this ICBCDuration object is greater than the other ICBCDuration object. [0854]
  • IDL Syntax [0855]
  • boolean greaterThan(in ICBCDuration aDuration); [0856]
  • ICBCDuration::greaterThanOrEqualTo [0857]
  • Returns TRUE if the value of this ICBCDuration object is greater than or equal to the other ICBCDuration object. [0858]
  • IDL Syntax [0859]
  • boolean greaterThanOrEqualTo(in ICBCDuration aDuration); [0860]
  • ICBCDuration::getType [0861]
  • Returns the type of this ICBCDuration. Returned values can be DATE, TIME, YEARS, MONTHS, DAYS, HOURS, MINUTES, SECONDS, MICROSECONDS. [0862]
  • IDL Syntax [0863]
  • ICBCDuration::durationType getType( ); [0864]
  • ICBCDuration::hour [0865]
  • Returns the hour part of the ICBCDuration. [0866]
  • IDL Syntax [0867]
  • long hour( ); [0868]
  • ICBCDuration::initializeDateTimeDuration [0869]
  • Accepts three numeric values, an indicator of the sign of the duration (positive or negative) and an indicator of the duration type. [0870]
  • IDL Syntax [0871]
  • boolean initializeDateTimeDuration(in long aValue1, [0872]
  • in long aValue2, [0873]
  • in long aValue3, [0874]
  • in boolean aNegativeFlag, [0875]
  • in ICBCDuration::durationType aType); [0876]
  • If the type indicator is DATE, then aValue1, aValue2, aValue3 must supply valid values for years, months, and days, respectively. Each value must be a positive number, or zero. If the supplied parameters are valid, returns TRUE, else returns FALSE. [0877]
  • If type indicator is TIME, then aValue1, aValue2, aValue3 must supply valid values for hours, minutes, and seconds, respectively. [0878]
  • Each value must be a positive number, or zero. If the supplied parameters are valid, returns TRUE, else returns FALSE. [0879]
  • ICBCDuration::initializeLabeledDuration [0880]
  • Accepts a single numeric value, and an indicator of the type of duration. [0881]
  • IDL Syntax [0882]
  • boolean initializeLabeledDuration(in long aDuration, in ICBCDuration::durationType aType); [0883]
  • The type indicator can be: YEARS, MONTHS, DAYS, HOURS, MINUTES, SECONDS, MICROSECONDS. The supplied values must be a positive number or zero.If the numeric value is valid, returns TRUE, otherwise returns FALSE. If the values are valid, any existing value in the object is replaced. [0884]
  • ICBCDuration::initializeTimestampDuration [0885]
  • Accepts seven numeric values, and an indicator of the sign of the duration (positive or negative). [0886]
  • IDL Syntax [0887]
  • boolean initializeTimestampDuration(in long aValue1, [0888]
  • in long aValue2, [0889]
  • in long aValue3, [0890]
  • in long aValue4, [0891]
  • in long aValue5, [0892]
  • in long aValue6, [0893]
  • in long aValue7, [0894]
  • in boolean aNegativeFlag); [0895]
  • The numeric values represent the years, months, days, hours, minutes, seconds, and microseconds portions of the timestamp duration. They must be positive numbers or zeros. If the supplied parameters are valid, returns TRUE, else returns FALSE. [0896]
  • ICBCDuration::isNegative [0897]
  • Returns a Boolean TRUE is this object's value is negative. Otherwise returns FALSE; [0898]
  • IDL Syntax [0899]
  • boolean isNegative( ); [0900]
  • ICBCDuration::lessThan [0901]
  • Returns TRUE if the value of this ICBCDuration object is less than the other ICBCDuration object. [0902]
  • IDL Syntax [0903]
  • boolean lessThan(in ICBCDuration aDuration); [0904]
  • ICBCDuration::lessThanOrEqualTo [0905]
  • Returns TRUE if the value of this ICBCDuration object is less than or equal to the other ICBCDuration object. [0906]
  • IDL Syntax [0907]
  • boolean lessThanOrEqualTo(in ICBCDuration aDuration); [0908]
  • ICBCDuration::microSecond [0909]
  • Returns the microseconds part of the ICBCDuration. [0910]
  • IDL Syntax [0911]
  • long microSecond( ); [0912]
  • ICBCDuration::minute [0913]
  • Returns the minute part of the ICBCDuration. [0914]
  • IDL Syntax [0915]
  • long minute( ); [0916]
  • ICBCDuration::month [0917]
  • Returns the month part of the ICBCDuration. [0918]
  • IDL Syntax [0919]
  • long month( ); [0920]
  • ICBCDuration::notEqualTo [0921]
  • The opposite of the equalTo operation. [0922]
  • IDL Syntax [0923]
  • boolean notEqualTo(in ICBCDuration aDuration); [0924]
  • ICBCDuration::second [0925]
  • Returns the seconds part of the ICBCDuration. [0926]
  • IDL Syntax [0927]
  • long second( ); [0928]
  • ICBCDuration::size [0929]
  • Equivalent to the DB2 TIMESTAMPDIFF built-in function. [0930]
  • IDL Syntax [0931]
  • long size(in long aIntervalType); [0932]
  • Remarks [0933]
  • Returns the value of the timestamp duration converted to the interval type specified in the input parameter. If the parameter is not valid, a value of −1 is returned. Valid parameter values, and associated interval types are: [0934]
  • 1 Fractions of a second. [0935]
  • 2 Seconds. [0936]
  • 4 Minutes. [0937]
  • 8 Hours. [0938]
  • 16 Days. [0939]
  • 32 Weeks. [0940]
  • 64 Months. [0941]
  • 128 Quarters. [0942]
  • 256 Years. [0943]
  • The conversion is not precise. A standard length year and month are assumed, taking no account of leap years. Conversion factors used are as follows: [0944]
  • 365 days per year. [0945]
  • 30 days per month. [0946]
  • 24 hours per day. [0947]
  • 60 minutes per hour. [0948]
  • 60 seconds per minute. [0949]
  • ICBCDuration::year [0950]
  • Returns the year part of the ICBCDuration. [0951]
  • IDL Syntax [0952]
  • long year( ); [0953]
  • swapSign [0954]
  • This function is effectively a unary minus operator which reverses the sign of this ICBCDuration object. [0955]
  • IDL Syntax [0956]
  • void swapSign( ); [0957]
  • ICBCTime Class [0958]
  • The class stores the value of a time-of-day. All access and manipulation of this time is through a public functional interface. The actual time value and its format are stored in private attributes. [0959]
  • IDL Interface Description [0960]
  • interface ICBCTime :IManagedLocal::ILocalOnly [0961]
    {
    /* Object initialization (DB2 semantics)*/
    boolean initializeFromString(in string aTime);
    boolean initializeFromTimestamp(in ICBCTimestamp aTimestamp);
    boolean initializeFromValues(in long aHour,
      in long aMinute,
      in long aSecond);
    // Comparisons
    boolean equalTo(in ICBCTime aTime);
    boolean notEqualTo(in ICBCTime aTime);
    boolean lessThan(in ICBCTime aTime);
    boolean lessThanOrEqualTo(in ICBCTime aTime);
    boolean greaterThan(in ICBCTime aTime);
    boolean greaterThanOrEqualTo(in ICBCTime aTime);
    // Query functions (DB2 semantics)
    enum OutputFormat {ISO, USA, EUR, JIS, LOC};
    string formattedString(inout string aOutput,
    in ICBCTime::OutputFormat aFormat);
    long second();
    long minute();
    long hour();
    boolean isObjectChanged();
    // Manipulation functions (DB2 semantics)
    void assignFromTime(in ICBCTime aTime);
    void increment(in ICBCDuration aDuration);
    void decrement(in ICBCDuration aDuration);
    long timeOverflow();
    ICBCDuration intervalFromTime(in ICBCTime aTime);
    ICBCDuration intervalFromString(in string aTime);
    };
  • Supported Methods [0962]
  • ICBCTime::_create [0963]
  • ICBCTime::initializeFromString [0964]
  • ICBCTime::initializeFromTimestamp [0965]
  • ICBCTime::initializeFromValues [0966]
  • ICBCTime::equalTo [0967]
  • ICBCTime::notEqualTo [0968]
  • ICBCTime::lessThan [0969]
  • ICBCTime::lessThanOrEqualTo [0970]
  • ICBCTime::greaterThan [0971]
  • ICBCTime::greaterThanOrEqualTo [0972]
  • ICBCTime::formattedString [0973]
  • ICBCTime::second [0974]
  • ICBCTime::minute [0975]
  • ICBCTime::hour [0976]
  • ICBCTime::isObjectChanged [0977]
  • ICBCTime::assignFromTime [0978]
  • ICBCTime::increment [0979]
  • ICBCTime::decrement [0980]
  • ICBCTime::timeOverflow [0981]
  • ICBCTime::interval [0982]
  • ICBCTime::assignFromTime [0983]
  • Sets all state data in this ICBCTime object equal to the second ICBCTime object. The change flag of this object is set to TRUE. [0984]
  • IDL Syntax [0985]
  • void assignFromTime(in ICBCTime aTime); [0986]
  • ICBCTime::_create [0987]
  • Returns a pointer to a new ICBCTime object. The object is initialized to the current local time. [0988]
  • ICBCTime::decrement [0989]
  • Subtracts a ICBCDuration from the value of this ICBCTime object. [0990]
  • IDL Syntax [0991]
  • void decrement(in ICBCDuration aDuration); [0992]
  • Remarks [0993]
  • This operation is performed essentially as the inverse of the increment operation. [0994]
  • When a duration of type TIME is subtracted from a time, the time is decremented by the specified number of hours, minutes, and seconds, in that order. [0995]
  • If the hours value of the result of a decrement operation is negative, then enough whole periods of 24 hours are added to the value to make it positive. The number of 24 hour periods (i.e., days) thus added can be retrieved as a negative number using the timeOverflow( ) function. [0996]
  • Although a ICBCTime object with a value (expressed in ISO format) of 24.00.00 can be input to an increment or decrement operation, a time of 24.00.00 will never be returned as the result of the operation. Thus 24.00.00 plus or minus a zero duration will return the time 00.00.00. [0997]
  • The change flag of this object is set to TRUE. [0998]
  • ICBCTime::equalTo [0999]
  • Returns TRUE if the time in this ICBCTime object is equal to the other ICBCTime object. Note: Although 24.00.00 and 00.00.00 both represent midnight, ICBCTime considers that 24.00.00>00.00.00. [1000]
  • IDL Syntax [1001]
  • boolean equalTo(in ICBCTime aTime); [1002]
  • ICBCTime::formattedString [1003]
  • Returns the time value of this object as a string in a specified format. The parameter OutputType must take one the values: ISO, USA, EUR, JIS. Formats are as described for the function ICBCTime::initializeFromString( ). The LOC site-defined option described in the DB2 manual is not supported by ICBCTime. [1004]
  • IDL Syntax [1005]
  • string formattedString(inout string aOutput, in ICBCTime::OutputFormat aFormat); [1006]
  • The application must supply a non-const pointer to a target storage area long enough to receive the formatted time. The function returns a reference to this area. [1007]
  • ICBCTime::greaterThan [1008]
  • Returns TRUE if the time stored in this ICBCTime object is greater than the other ICBCTime object. [1009]
  • IDL Syntax [1010]
  • boolean greaterThan(in ICBCTime aTime); [1011]
  • ICBCTime::greaterThanOrEqualTo [1012]
  • Returns TRUE if the time stored in this ICBCTime object is greater than or equal to the other ICBCTime object. [1013]
  • IDL Syntax [1014]
  • boolean greaterThanOrEqualTo(in ICBCTime aTime); [1015]
  • ICBCTime::hour [1016]
  • Returns the hour part of the time. [1017]
  • IDL Syntax [1018]
  • long hour( ); [1019]
  • ICBCTime::increment [1020]
  • Adds a ICBCDuration to the value of this ICBCTime object. [1021]
  • IDL Syntax [1022]
  • void increment (in ICBCDuration aDuration); [1023]
  • Remarks [1024]
  • If a duration of type HOURS is added to a time, only the hours portion of the time is affected. The minutes and seconds are unchanged. [1025]
  • Similarly, if a duration of type MINUTES is added to the time, only minutes and, if necessary, hours are affected. [1026]
  • Adding a duration of type SECONDS will, of course, affect the seconds portion of the time, and potentially the minutes and hours. [1027]
  • When a duration of type TIME is added to a time, the time is incremented by the specified number of hours, minutes, and seconds, in that order. [1028]
  • If the hours value of the result of an increment operation is greater than 24 hours, then the hours value is divided by 24 and the remainder stored in the hours value. The quotient of the division (the number of whole 24 hour periods or days in the original hours value) can be retrieved using the timeOverflow( ) function. [1029]
  • Although a ICBCTime object with a value (expressed in ISO format) of 24.00.00 can be input to an increment or decrement operation, a time of 24.00.00 will never be returned as the result of the operation. Thus 24.00.00 plus or minus a zero duration will return the time 00.00.00. The change flag of this object is set to TRUE. [1030]
  • ICBCTime::initializeFromString [1031]
  • Accepts a value for the time in the form of a string. Any existing value in the object is replaced. Returns TRUE if the string is a valid time representation and the object is successfully initialized. Returns FALSE if the parameter is invalid. If FALSE is returned the state of the object is unchanged. [1032]
  • IDL Syntax [1033]
  • boolean initializeFromString(in string aTime); [1034]
  • Parameters [1035]
  • The string must be either: [1036]
  • A valid string representation of a time, in one of the following valid forms. [1037]
  • International Standards Organization (ISO) (hh.mm.ss). [1038]
  • IBM USA standard (USA) (hh:mm AM or PM). [1039]
  • IBM European standard (EUR) (hh.mm.ss). [1040]
  • Japanese Industrial Standard Christian Era (JIS) (hh:mm:ss). [1041]
  • Atime [1042]
  • Leading and trailing blanks are acceptable provided the string length is less than 20 characters. Leading zeros can be omitted from the hours portion, and in ISO, EUR and JIS the seconds portion can be omitted completely. In the USA format, the minutes can be omitted. Zeros are assumed for omitted portions. In the USA time format, the hour cannot be greater than 12 and cannot be 0 except for the special case of 00:00 AM. Only SBCS characters may be present in the string. [1043]
  • A string representation of a timestamp. Any of the string forms acceptable by the ICBCTimestamp::initializeFromString( ) function are acceptable. For details refer to that function. Briefly, the forms include: [1044]
  • A punctuated string: yyyy-mm-dd-hh.mm.ss.nnnnnn. [1045]
  • A 14 byte string without punctuation, of the form: yyyymmddhhmmss. [1046]
  • ICBCTime::initializeFromTimestamp [1047]
  • Initializes this object from the time portion of a Timestamp object. [1048]
  • IDL Syntax [1049]
  • boolean initializeFromTimestamp(in ICBCTimestamp aTimestamp); [1050]
  • ICBCTime::initializeFromValues [1051]
  • Accepts the time in the form of three separate value parameters for hour, minute, and second. [1052]
  • The values must make a valid time. [1053]
  • Returns TRUE if the values are a valid time representation, FALSE otherwise. If FALSE is returned, the state of the object is unchanged. [1054]
  • IDL Syntax [1055]
  • boolean initializeFromValues(in long aHour, in long aMinute, in long aSecond); [1056]
  • ICBCTime::interval [1057]
  • Calculates the Duration between two ICBCTime objects. The result is a pointer to a new ICBCDuration object of type TIME. [1058]
  • If the interval between TIME1 and TIME2 is required, and TIME1 is greater than or equal to TIME2, the operation is performed by subtracting TIME2 from TIME1. If, however, TIME1 is less than TIME2, TIME1 is subtracted from TIME2, and the sign of the result is made negative. The following procedural description clarifies the steps involved in the operation result=TIME1−TIME2. [1059]
  • If SECOND (TIME2)<=SECOND (TIME1) [1060]
  • then SECOND(RESULT)=SECOND(TIME1)−SECOND(TIME2). [1061]
  • If SECOND(TIME2)>SECOND(TIME1) [1062]
  • then SECOND(RESULT)=60+SECOND(TIME1)−SECOND(TIME2). MINUTE(TIME2) is then incremented by 1. [1063]
  • If MINUTE(TIME2)<=MINUTE(TIME1) [1064]
  • then MINUTE(RESULT)=MINUTE(TIME1)−MINUTE(TIME2). [1065]
  • If MINUTE(TIME2)>MINUTE(TIME1) [1066]
  • then MINUTE(RESULT)=60+MINUTE(TIME1)−MINUTE(TIME2). [1067]
  • HOUR(TIME2) is then incremented by 1. [1068]
  • HOUR(RESULT)=HOUR(TIME1)−HOUR(TIME2). [1069]
  • IDL Syntax [1070]
  • ICBCDuration_ptr intervalFromTime(in ICBCTime aTime); [1071]
  • ICBCDuration_ptr intervalFromString(in string aTime); [1072]
  • In the case with a string parameter, the parameter must be a valid string representation of a time. For details see ICBCTime::initializeFromString. [1073]
  • If parameters to this function cannot be recognized as a valid time, then a pointer value of −1 is returned. [1074]
  • ICBCTime::isObjectChanged [1075]
  • Returns a boolean indicating whether the value of this object has been changed since it was initialized. [1076]
  • IDL Syntax [1077]
  • boolean isObjectChanged( ); [1078]
  • ICBCTime::lessThan [1079]
  • Returns TRUE if the time stored in this ICBCTime object is less than the other ICBCTime object. [1080]
  • IDL Syntax [1081]
  • boolean lessThan(in ICBCTime aTime); [1082]
  • ICBCTime::lessThanOrEqualTo [1083]
  • Returns TRUE if the time stored in this ICBCTime object is less than or equal to the other ICBCTime object. [1084]
  • IDL Syntax [1085]
  • boolean lessThanOrEqualTo(in ICBCTime aTime); [1086]
  • ICBCTime::minute [1087]
  • Returns the minute part of the time. [1088]
  • IDL Syntax [1089]
  • long minute( ); [1090]
  • ICBCTime::notEqualTo [1091]
  • The opposite of the operator==member. [1092]
  • IDL Syntax [1093]
  • boolean notEqualTo(in ICBCTime aTime); [1094]
  • ICBCTime::second [1095]
  • Returns the second part of the time. [1096]
  • IDL Syntax [1097]
  • long second( ); [1098]
  • ICBCTime::timeOverflow [1099]
  • Returns the number of overflow or underflow days of a preceding increment or decrement operation. For an increment, returns the number of whole 24 hour periods (days) in the hours value of the result. For a decrement, returns the number of 24 hour periods necessary to restore the hours value of the result to a positive value. [1100]
  • IDL Syntax [1101]
  • long timeOverflow( ); [1102]
  • ICBCTimestamp Class [1103]
  • The class stores the value of a DB2 Timestamp or an Oracle DATE type. All access and manipulation of this timestamp is through a public functional interface. The actual timestamp value is stored in a private attributes. [1104]
  • A Timestamp attribute in a Component Broker business object that originates from a DB2 database is represented by Component Broker as a 26 character string of form yyyy-mm-dd-hh.mm.ss.mmmmmm. This string can be used to initialize an ICBCTimestamp instance through the ICBCTimestamp::initializeFromString function. A DATE attribute that originates from an Oracle database is represented by Component Broker in the same 26 character form yyyy-mm-dd-hh.mm.ss.mmmmmm, but with the final six characters (the microseconds field) always set to zeros. This string can be used to initialize an ICBCTimestamp via ICBCTimestamp::initializeFromString. However, Oracle dates earlier than 0001-01-01 are rejected. Whether the ICBCTimestamp object is initialized from data originating in DB2 or in Oracle, ICBCTimestamp applies DB2 semantics in its processing of the data. [1105]
  • IDL Interface Description [1106]
  • interface ICBCTimestamp:IManagedLocal::ILocalOnly [1107]
    {
    // Object initialization
    boolean initializeFromString(in string aTimestamp);
    boolean initializeFromDateTime(in ICBCDate aDate,
       in ICBCTime aTime,
       in long aMicroseconds);
    void initializeFromDate(in ICBCDate aDate); // Equivalent to TIMESTAMP_ISO
    void initiailizeFromTime(in ICBCTime aTime); // Equivalent to TIMESTAMP_ISO
    enum DatastoreType {ORCL};
    boolean initializeFromDatastoreFormat(in string aTimestamp,
       in ICBCTimestamp::DatastoreType
       aDatastore);
    // Comparisons
    boolean equalTo(in ICBCTimestamp aTimestamp);
    boolean notEqualTo(in ICBCTimestamp aTimestamp);
    boolean lessThan(in ICBCTimestamp aTimestamp);
    boolean lessThanOrEqualTo(in ICBCTimestamp aTimestamp);
    boolean greaterThan(in ICBCTimestamp aTimestamp);
    boolean greaterThanOrEqualTo(in ICBCTimestamp aTimestamp);
    // Query functions
    enum OutputFormat {ISO, USA, EUR, JIS, LOC};
    // gets whole timestamp as a string:
    string formattedString(inout string aOutput);
    string getAsDateFormattedString(inout string aTarget,
       in ICBCTimestamp::OutputFormat aFormat);
    string getAsTimeFormattedString(inout string aTarget,
       in ICBCTimestamp::OutputFormat aFormat);
    string getAsDatstoreFormat(inout string aTarget,
       in ICBCTimestamp::DatastoreType aDatastore);
    long microsecond();
    long second();
    long minute();
    long hour();
    long day();
    long month();
    long year();
    long dayOfWeek();
    long dayOfYear();
    long julianDay();
    long modifiedJulianDay();
    string dayName();
    long dayFromString(in string aTimestamp);
    long dayOfWeekFromString(in string aTimestamp);
    long dayOfYearFromString(in string aTimestamp);
    long julianDayFromString(in string aTimestamp);
    long modifiedJulianDayFromString(in string aTimestamp);
    string dayNameFromString(in string aTimestamp);
    string dayNameFromNumber(in long aDayIndex);
    string monthName();
    long monthFromString(in string aTimestamp);
    string monthNameFromString(in string aTimestamp);
    string monthNameFromNumber(in long aMonthIndex);
    long quarter();
    long quarterFromString(in string aTimestamp);
    long yearFromString(in string aTimestamp);
    boolean isLeapYear(in long aYear);
    long daysInObject();
    long daysInString(in string aTimestamp);
    long daysInMonth(in long aYear, in long aMonth);
    long daysInYear(in long aYear);
    boolean isObjectChanged();
    // Manipulation functions
    void assignFromTimestamp(in ICBCTimestamp aTimestamp);
    void increment(in ICBCDuration aDuration);
    void decrement(in ICBCDuration aDuration);
    long timestampOverflow();
    ICBCDuration intervalFromTimestamp(in ICBCTimestamp aTimestamp);
    ICBCDuration intervalFromString(in string aTimestamp);
    };
  • Supported Methods [1108]
  • ICBCTimestamp::_create [1109]
  • ICBCTimestamp::initializeFromString [1110]
  • ICBCTimestamp::initializeFromDateTime [1111]
  • ICBCTimestamp::initializeFromDate [1112]
  • ICBCTimestamp::initializeFromTime [1113]
  • ICBCTimestamp::equalTo [1114]
  • ICBCTimestamp::notEqualTo [1115]
  • ICBCTimestamp::lessThan [1116]
  • ICBCTimestamp::lessThanOrEqualTo [1117]
  • ICBCTimestamp::greaterThan [1118]
  • ICBCTimestamp::greaterThanOrEqualTo [1119]
  • ICBCTimestamp::formattedString [1120]
  • ICBCTimestamp::microsecond [1121]
  • ICBCTimestamp::second [1122]
  • ICBCTimestamp::minute [1123]
  • ICBCTimestamp::hour [1124]
  • ICBCTimestamp::day [1125]
  • ICBCTimestamp::month [1126]
  • ICBCTimestamp::year [1127]
  • ICBCTimestamp::dayOfWeek [1128]
  • ICBCTimestamp::dayOfYear [1129]
  • ICBCTimestamp::julianDay [1130]
  • ICBCTimestamp::modifiedJulianDay [1131]
  • ICBCTimestamp::dayName [1132]
  • ICBCTimestamp::dayFromString [1133]
  • ICBCTimestamp::dayOfWeekFromString [1134]
  • ICBCTimestamp::dayOfYearFromString [1135]
  • ICBCTimestamp::)julianDayFromString [1136]
  • ICBCTimestamp::modifiedJulianDayFromString [1137]
  • ICBCTimestamp::dayNameFromString [1138]
  • ICBCTimestamp::dayNameFromNumber [1139]
  • ICBCTimestamp::monthName [1140]
  • ICBCTimestamp::monthFromString [1141]
  • ICBCTimestamp::monthNameFromString [1142]
  • ICBCTimestamp::monthNameFromNumber [1143]
  • ICBCTimestamp::quarter [1144]
  • ICBCTimestamp::quarterFromString [1145]
  • ICBCTimestamp:.yearFromSting [1146]
  • ICBCTimestamp::isLeapYear [1147]
  • ICBCTimestamp::daysInObject [1148]
  • ICBCTimestamp::daysInString [1149]
  • ICBCTimestamp::daysInMonth [1150]
  • ICBCTimestamp::daysInYear [1151]
  • ICBCTimestamp::isObjectChanged [1152]
  • ICBCTimestamp::assignFromTimestamp [1153]
  • ICBCTimestamp::increment [1154]
  • ICBCTimestamp::decrement [1155]
  • ICBCTimestamp::timestampOverflow [1156]
  • ICBCTimestamp::interval [1157]
  • ICBCTimestamp::assignFromTimestamp [1158]
  • Sets all state data in this ICBCTimestamp object equal to the the second ICBCTimestamp object. The change flag of this object is set to TRUE. [1159]
  • IDL Syntax [1160]
  • ICBCTimestamp assignFromTimestamp(in ICBCTimestamp aTimestamp); [1161]
  • ICBCTimestamp::_create [1162]
  • Returns a pointer to a new ICBCTimestamp object. The object is initialized to today's date and the current local time with a miicroseconds value of zero. [1163]
  • ICBCTimestamp::day [1164]
  • Returns the day part of the timestamp. [1165]
  • IDL Syntax [1166]
  • long day( ); [1167]
  • ICBCTimestamp::dayFromString [1168]
  • Returns the day part of the timestamp encoded in the input string parameter. The input string parameter must conform to a format recognizable as a timestamp. Refer to ICBCTimestamp::initializeFromString( ) for a description of supported formats. [1169]
  • If the input parameter is not recognizable, a value of −1 is returned. [1170]
  • IDL Syntax [1171]
  • long dayFromString(in string aString); [1172]
  • ICBCTimestamp::dayName [1173]
  • Returns a string containing the name of the day of the week for this timestamp object. [1174]
  • IDL Syntax [1175]
  • long dayName( ); [1176]
  • ICBCTimestamp::dayNameFromNumber [1177]
  • Returns a string containing the name of the day of the week for the day number within a week provided in the input parameter. The input parameter must be a number between 1 and 7. Sunday is day number 1. [1178]
  • If the in put parameter is not recognizable, an empty string is returned. [1179]
  • IDL Syntax [1180]
  • long dayNameFromNumber(in long aDayIndex); [1181]
  • ICBCTimestamp::dayNameFromString [1182]
  • Returns a string containing the name of the day of the week for for the timestamp encoded in the input string parameter. The input string parameter must conform to a format recognizable as a timestamp. Refer to ICBCTimestamp::initializeFromString( ) for a description of supported formats. [1183]
  • If the input parameter is not recognizable, an empty string is returned. [1184]
  • IDL Syntax [1185]
  • long dayNameFromString(in string aTimestamp); [1186]
  • ICBCTimestamp::dayOfWeek [1187]
  • Returns a number between 1 and 7 representing the day of the week for this timestamp object. Sunday is day number 1. [1188]
  • IDL Syntax [1189]
  • long dayOfWeek( ); [1190]
  • ICBCTimestamp::dayOfWeekFromString [1191]
  • Returns a number between 1 and 7 representing the day of the week for the timestamp encoded in the input string parameter. Sunday is day number 1. [1192]
  • The input string parameter must conform to a format recognizable as a timestamp. Refer to ICBCtimestamp::initializeFromString( ) for a description of supported formats. [1193]
  • If the input parameter is not recognizable, a value of −1 is returned. [1194]
  • IDL Syntax [1195]
  • long dayOfWeekFromString(in string aString); [1196]
  • ICBCTimestamp::dayOfYear [1197]
  • Returns a number between 1 and 366 representing the day of the year for this timestamp object. January 1 is day number 1. [1198]
  • IDL Syntax [1199]
  • long dayOfYear( ); [1200]
  • ICBCTimestamp::dayOfYearFromString [1201]
  • Returns a number between 1 and 366 representing the day of the year for the timestamp encoded in the input string parameter. January 1 is day number 1. [1202]
  • The input string parameter must conform to a format recognizable as a timestamp. Refer to ICBCTimestamp::initializeFromString( ) for a description of supported formats. [1203]
  • If the input parameter is not recognizable, a value of −1 is returned. [1204]
  • IDL Syntax [1205]
  • long dayOfYearFromString(in string aString); [1206]
  • ICBCTimestamp::daysInObject [1207]
  • The result is the number of days from Jan. 1, 0001 to the timestamp represented by this object, plus one day. i.e., an object holding a timestamp for date Jan. 2, 0001 returns the value 2. [1208]
  • IDL Syntax [1209]
  • long daysInObject( ); [1210]
  • ICBCTimestamp::daysInMonth [1211]
  • Returns the number of days in the month of the year provided in the input parameters. Month number must be between 1 and 12. If the input parameters are not valid, a value of −1 is returned. [1212]
  • IDL Syntax [1213]
  • long daysInMonth(in long aYear, in long aMonth); [1214]
  • ICBCTimestamp::daysInString [1215]
  • The result is the number of days from Jan. 1, 0001 to the timestamp represented by the string parameter, plus one day. i.e., an object holding a timestamp for date 00010102 returns the value 2. [1216]
  • If the string is invalid, returns a value of −1. [1217]
  • IDL Syntax [1218]
  • long daysInString(in string aTimestamp); [1219]
  • The input string parameter must conform to a format recognizable as a timestamp. Refer to ICBCtimestamp::initializeFromString( ) for a description of supported formats. If the input parameter is not recognizable, a value of −1 is returned. [1220]
  • ICBCTimestamp::daysInYear [1221]
  • Returns the number of days in the year provided in the input parameter. If the input parameter is not valid, a value of −1 is returned. Returns the number of days in the year provided in the input parameter. [1222]
  • If the input parameter is not valid, a value of −1 is returned. [1223]
  • IDL Syntax [1224]
  • long daysInYear(in long aYear); [1225]
  • ICBCTimestamp::decrement [1226]
  • Subtracts a ICBCDuration from the value of this ICBCTimestamp object. No value is returned (i.e., this is effectively a −=operator). [1227]
  • Decrementing of a timestamp with a duration (of any type) is carried out on the date and time portions of the timestamp as described for ICBCDate and ICBCTime, except that any underflow of microseconds is satisfied from the seconds portion of the result timestamp, and any underflow of hours is satisfied from the days portion. [1228]
  • If the years value of the result of an decrement operation is less than 0001 years, then the years value of the result is set to 0001, and the number of “underflow” years can be retrieved as a negative number with the dateOverflow( ) function. [1229]
  • The change flag of this object is set to TRUE. [1230]
  • Although an ICBCTimestamp object with an time portion equal to 24.00.00 can be initialized, or returned from an ICBCTimestamp::interval operation, and can be input to an increment or decrement operation, such a timestamp is never be returned as a result of the increment or decrement operation. For the purposes of the calculation, the time portion of the timestamp is considered to be 00.00.00, with the days part incremented by 1. For example, a timestamp value of 1998-11-2-24.00.00.000000 plus or minus a zero duration will return the timestamp result 1998-11-3-00.00.00.000000. [1231]
  • IDL Syntax [1232]
  • void decrement(in ICBCDuration aDuration); [1233]
  • ICBCTimestamp::equalTo [1234]
  • Returns TRUE if the date and time this ICBCTimestamp object is equal to the other ICBCTimestamp object. [1235]
  • Note that because of the alternative representations of midnight it is possible to have two different timestamps that actually represent the same point in time, for example: 1997-11-02-24.00.00.000000 and 1997-11-03-00.00.00.000000. ICBCTimestamp compares timestamps by date portion, followed by time portion, and will consider that for timestamp pairs of this type, the timestamp with the higher day part is greater. e.g.: 1997-11-03-00.00.00.000000>1997-11-02-24.00.00.000000. [1236]
  • IDL Syntax [1237]
  • boolean equalTo(in ICBCTimestamp aTimestamp); [1238]
  • ICBCTimestamp::formattedString [1239]
  • Returns the value of this timestamp object as a string in the form yyyy-mm-dd-hh.mm.ss.mmmmmm. [1240]
  • The application must supply a non-const pointer to a target storage area long enough to receive the formatted timestamp. The function returns a reference to this area, enabling the function to be nested in stream operations. [1241]
  • IDL Syntax [1242]
  • string formattedString(inout string aOutput); [1243]
  • ICBCTimestamp::greaterThan [1244]
  • Returns TRUE if the date and time stored in this ICBCTimestamp object is greater than the other ICBCTimestamp object. [1245]
  • IDL Syntax [1246]
  • boolean greaterThan(m ICBCTimestamp aTimestamp); [1247]
  • ICBCTimestamp::greaterThanOrEqualTo [1248]
  • Returns TRUE if the date and time stored in this ICBCTimestamp object is greater than or equal to the other ICBCTimestamp object. [1249]
  • IDL Syntax [1250]
  • boolean greaterThanOrEqualTo(in ICBCTimestamp aTimestamp); [1251]
  • ICBCTimestamp::hour [1252]
  • Returns the hour part of the timestamp. [1253]
  • IDL Syntax [1254]
  • long hour( ); [1255]
  • ICBCTimestamp::increment [1256]
  • Adds a ICBCDuration to the value of this ICBCTimestamp object. [1257]
  • Incrementing of a timestamp with a duration (of any type) is carried out on the date and time portions of the timestamp as described for ICBCDate and ICBCTime, except that any overflow of microseconds is carried into the seconds portion of the result timestamp, and any overflow of hours is carried into the days portion. [1258]
  • If the years value of the result of an increment operation is greater than 9999 years, then the years value of the result timestamp is set to 9999, and the number of overflow years can be retrieved using the dateOverflow( ) function. [1259]
  • The change flag of this object is set to TRUE. [1260]
  • Although an ICBCTimestamp object with an time portion equal to 24.00.00 can be initialized, or returned from an ICBCTimestamp::interval operation, and can be input to an increment or decrement operation, such a timestamp is never be returned as a result of the increment or decrement operation. For the purposes of the calculation, the time portion of the timestamp is considered to be 00.00.00, with the days part incremented by 1. For example, a timestamp value of 1998-11-2-24.00.00.000000 plus or minus a zero duration will return the timestamp result 1998-11-3-00.00.00.000000. [1261]
  • IDL Syntax [1262]
  • void increment(in ICBCDuration aDuration); [1263]
  • ICBCTimestamp::initializeFromString [1264]
  • Accepts a value for the time in the form of a string. Any existing value in the object is replaced. Returns TRUE if the string is a valid timestamp representation and the object is successfully initialized. Returns FALSE if the parameter is invalid. If FALSE is returned the state of the object is unchanged. [1265]
  • IDL Syntax [1266]
  • boolean initializeFromString(in string aTimestamp); [1267]
  • The string must be in one of two formats: [1268]
  • A character string of length 14 numeric characters, yyyyxxddhhmmss. Leading and trailing blanks are acceptable provided the string length is less than 30 characters. The string must represent a valid date and time. The microseconds portion of the timestamp is set to zero. Only SBCS characters may be present in the string. [1269]
  • A punctuated string of the form: yyyy-mm-dd-hh.mm.ss.mmmmmm. Leading and trailing blanks are acceptable provided the string length is less than 30 characters. The string must represent a valid date and time. Leading zeros can be omitted from month, day, and hour. Microseconds can be truncated, or omitted entirely. If omitted, microseconds are set to zero. Only SBCS characters may be present in the string. [1270]
  • ICBCTimestamp::initializeFromDateTime [1271]
  • Initializes this timestamp object from one ICBCDate and one ICBCTime object. The time portion the timestamp takes its value from the ICBCDate and the time portion from the ICBCTime object. The microseconds portion of the timestamp is set to zero. [1272]
  • IDL Syntax [1273]
  • boolean initializeFromDateTime(in ICBCDate_ptr aICBCDate, in ICBCTime_ptr aICBCTime); [1274]
  • ICBCTimestamp::initializeFromDate [1275]
  • Initializes the date part of this timestamp object from the provided ICBCDate parameter. The time portion and the microseconds portion of the timestamp are set to zero. [1276]
  • IDL Syntax [1277]
  • void initializeFromDate(inICBCDate aDate); [1278]
  • ICBCTimestamp::initializeFromTime [1279]
  • Initializes the date portion of this timestamp object to the current date, and the time portion from the provided ICBCTime parameter. The microseconds portion of the timestamp is set to zero. [1280]
  • IDL Syntax [1281]
  • void initializeFromTime(in ICBCTime aTime); [1282]
  • ICBCTimestamp::interval [1283]
  • Calculates the Duration between two ICBCTimestamp objects. The result is a pointer to a new ICBCDuration object of type TIMESTAMP. [1284]
  • If the interval between TIMESTAMP1 and TIMESTAMP2 is required, and TIMESTAMP1 is greater than or equal to TIMESTAMP2, the operation is performed by subtracting TIMESTAMP2 from TIMESTAMP1. If, however, TIMESTAMP1 is less than TIMESTAMP2, TIMESTAMP1 is is subtracted from TIMESTAMP2, and the sign of the result is made negative. The following procedural description clarifies the steps involved in the operation result=TIMESTAMP1−TIMESTAMP2. [1285]
  • If MICROSECOND(TS2)<=MICROSECOND(TS1) [1286]
  • then MICROSECOND(RESULT=MICROSECOND(TS1)−MICROSECOND(TS2). [1287]
  • If MICROSECOND(TS2)>MICROSECOND(TS1) [1288]
  • then MICROSECOND(RESULT=1000000+MICROSECOND(TS1)−MICROSECOND(TS2). and SECOND(TS2) is incremented by 1. [1289]
  • The seconds and minutes part of the timestamps are subtracted as specified in rules for subtracting ICBCTime. [1290]
  • If HOUR(TS2)<=HOUR(TS1) [1291]
  • then HOUR(RESULT)=HOUR(TS1)−HOUR(TS2). [1292]
  • IF HOUR(TS2)>HOUR(TS1) [1293]
  • then HOUR(RESULT)=24+HOUR(TS1)−HOUR(TS2) and DAY(TS2) is incremented by 1 [1294]
  • The date part of the timestamps is substracted as specified in the rules for subtracting ICBCDate. [1295]
  • IDL Syntax [1296]
  • ICBCDuration_ptr intervalFromTimestamp (in ICBCTimestamp aTimestamp); [1297]
  • ICBCDuration_ptr intervalFromString(m string aTimestamp); [1298]
  • In the case with a string parameter, the parameter must be a valid string representation of a timestamp, in the form yyyy-mm-dd-hh.mm.ss.mmmmmm For details refer to the description of ICBCTimestamp::initializeFromString( ). [1299]
  • If the string parameter to this function cannot be recognised as a valid timestamp, then a pointer value of −1 is returned. [1300]
  • ICBCTimestamp::isLeapYear [1301]
  • Returns TRUE if the year number in the input parameter is a leap year, FALSE otherwise. Year number must be between 1 and 9999. [1302]
  • If the input parameter is not in this range, FALSE is returned. [1303]
  • IDL Syntax [1304]
  • boolean isLeapYear(in long aYear); [1305]
  • ICBCTimestamp::isObjectChanged [1306]
  • Returns a boolean indicating whether the the value of this object has been changed since it was initialized. [1307]
  • IDL Syntax [1308]
  • boolean isObjectChanged( ); [1309]
  • ICBCTimestamp::julianDay [1310]
  • Returns the Julian day number corresponding to noon GMT on the date of this timestamp object. (Julian Day count started at noon, GMT, on Jan. 1 4712 BC.) [1311]
  • IDL Syntax [1312]
  • long julianDay( ); [1313]
  • ICBCTimestamp::julianDayFromString [1314]
  • Returns the Julian day number corresponding to noon GMT on the timestamp encoded in the input string parameter. Julian Day count started at noon, GM on Jan. 1 4712 BC) The input string parameter must conform to a format recognizable as a timestamp. Refer to ICBCTimestamp::initializeFromString( ) for a description of supported formats. [1315]
  • If the input parameter is not recognizable, a value of −1 is returned. [1316]
  • IDL Syntax [1317]
  • long julianDayFromString(in string aString); [1318]
  • ICBCTimestamp::lessThan [1319]
  • Returns TRUE if the date and time stored in this ICBCTimestamp object is less than the other ICBCTimestamp object. [1320]
  • IDL Syntax [1321]
  • boolean lessThan(in ICBCtimestamp aTimestamp); [1322]
  • ICBCTimestamp::lessThanOrEqualTo [1323]
  • Returns TRUE if the date and time stored in this ICBCTimestamp object is less than or equal to the other ICBCTimestamp object. [1324]
  • IDL Syntax [1325]
  • boolean lessThanOrEqualTo(in ICBCTimestamp aTimestamp); [1326]
  • ICBCTimestamp::microsecond [1327]
  • Returns the microsecond part of the timestamp. [1328]
  • IDL Syntax [1329]
  • long microsecond( ); [1330]
  • ICBCTimestamp::minute [1331]
  • Returns the minute part of the timestamp. [1332]
  • IDL Syntax [1333]
  • long minute( ); [1334]
  • ICBCTimestamp::modifiedJulianDay [1335]
  • Returns the Modified Julian day number (MJD) corresponding to time 00:00:00 GMT on the date of this timestamp object. MJD is defined as Julian Day—2,400,000.5 days. It thus starts at time 00:00:00 (i.e., midnight), in line with normal civil practice, and unlike Julian Day which extends from noon to noon. [1336]
  • IDL Syntax [1337]
  • long modifiedJulianDay( ); [1338]
  • ICBCTimestamp::modifiedJulianDayFromString [1339]
  • Returns the Modified Julian day number (MJD) corresponding to time 00:00:00 GMT on the date of the timestamp encoded in the input string parameter. MJD is defined as Julian Day—2,400,000.5 days. It thus starts at time 00:00:00 (i.e., midnight), in line with normal civil practice, and unlike Julian Day which extends from noon to noon. The input string parameter must conform to a format recognizable as a timestamp. Refer to ICBCTimestamp::initializeFromString( ) for a description of supported formats. [1340]
  • If the input parameter is not recognizable, a value of −1 is returned. [1341]
  • IDL Syntax [1342]
  • long modifiedJulianDayFromString(in string aString); [1343]
  • ICBCTimestamp::month [1344]
  • Returns the month part of the timestamp. [1345]
  • IDL Syntax [1346]
  • long month( ); [1347]
  • ICBCTimestamp::monthFromString [1348]
  • Returns the month part of the timestamp encoded in the input string parameter. The input string parameter must conform to a format recognizable as a timestamp. Refer to ICBCTimestamp::initializeFromString( ) for a description of supported formats. [1349]
  • If the input parameter is not recognizable, a value of −1 is returned. [1350]
  • IDL Syntax [1351]
  • long monthFromString(in string aString); [1352]
  • ICBCTimestamp::monthName [1353]
  • Returns a string containing the name of the month of this timestamp object. [1354]
  • IDL Syntax [1355]
  • string monthName( ); [1356]
  • ICBCTimestamp::monthNameFromNumber [1357]
  • Returns a string containing the name of the month for the month number within a year provided in the input parameter. The input parameter must be a number between 1 and 12. [1358]
  • If the input parameter is not recognizable, an empty string is returned. [1359]
  • IDL Syntax [1360]
  • string monthNameFromNumber(in long aDayIndex); [1361]
  • ICBCTimestamp::monthNameFromString [1362]
  • Returns a string containing the name of the month for the timestamp encoded in the input string parameter. The input string parameter must conform to a format recognizable as a timestamp. Refer to ICBCTimestamp::initializeFromString( ) for a description of supported formats. [1363]
  • If the input parameter is not recognizable, an empty string is returned. [1364]
  • IDL Syntax [1365]
  • string monthNameFromString(in string aTimestamp); [1366]
  • ICBCTimestamp::notEqualTo [1367]
  • The opposite of the operator==member. [1368]
  • IDL Syntax [1369]
  • boolean notEqualTo(in ICBCTimestamp aTimestamp); [1370]
  • ICBCTimestamp::quarter [1371]
  • Returns a number for the quarter within the year for this timestamp object. timestamps between January 1 and March 31 are in the first quarter, and so on. [1372]
  • IDL Syntax [1373]
  • long quarter( ); [1374]
  • ICBCTimestamp::quarterFromString [1375]
  • Returns a number for the quarter within the year for the timestamp encoded in the input string parameter. The input string parameter must conform to a format recognizable as a timestamp. Refer to ICBCTimestamp::initializeFromString( ) for a description of supported formats. Timestamps between January 1 and March 31 are in the first quarter, and so on. [1376]
  • If the input parameter is not recognizable, a value of −1 is returned. [1377]
  • IDL Syntax [1378]
  • long quarterFromString(in string aTimestamp); [1379]
  • ICBCTimestamp::second [1380]
  • Returns the second part of the timestamp. [1381]
  • IDL Syntax [1382]
  • ICBCTimestamp::timestampOverflow [1383]
  • Returns the number of overflow or underflow years of a preceding increment or decrement operation. For an increment, returns the years in excess of year 9999. For a decrement, returns the number of years less than year 0001. [1384]
  • IDL Syntax [1385]
  • long timestampOverflow( ); [1386]
  • ICBCTimestamp::year [1387]
  • Returns the year part of the timestamp. [1388]
  • IDL Syntax [1389]
  • long year( ); [1390]
  • ICBCTimestamp::yearFromSting [1391]
  • Returns the year part of the timestamp encoded in the input string parameter. The input string parameter must conform to a format recognizable as a timestamp. Refer to ICBCTimestamp::initializeFromString( ) for a description of supported formats. [1392]
  • If the input parameter is not recognizable, a value of −1 is returned. [1393]
  • IDL Syntax [1394]
  • long yearFromString(in string aString); [1395]

Claims (42)

What is claimed is:
1. A method for accessing a database, comprising the steps of:
(a) defining one or more object classes in a memory of a computer to match one or more corresponding specialized data types stored in the database; and
(b) creating one or more instances of the defined object classes in the memory of the computer to represent data in the database that comprise the corresponding specialized data types.
2. The method of claim 1 above, wherein the defining step further comprises the step of defining the object classes within a Component Broker.
3. The method of claim 1 above, wherein the defined object class includes one or more methods selected from a group comprising object initialization, comparisons, query functions, and manipulation functions.
4. The method of claim 1 above, wherein attributes and methods associated with the corresponding specialized data type are preserved in the defined object classes.
5. The method of claim 4 above, wherein the methods emulate semantics of the corresponding specialized data types.
6. The method of claim 4 above, wherein the methods produce similar results as equivalent expressions evaluated by a database manager for the database.
7. The method of claim 1 above, wherein a public interface of the defined object classes matches characteristics and usage of the specialized data type in the database.
8. The method of claim 1 above, wherein the specialized data types are selected from a group comprising date, decimal, duration, time, and timestamp.
9. The method of claim 1 above, wherein the defined object classes are selected from a group comprising date class, decimal class, duration class, time class, and timestamp class.
10. The method of claim 9 above, wherein the date class stores a calendar date value.
11. The method of claim 9 above, wherein the decimal class stores a decimal value.
12. The method of claim 9 above, wherein the duration class stores a duration value.
13. The method of claim 9 above, wherein the time class stores a time-of-day value.
14. The method of claim 9 above, wherein the timestamp class stores a timestamp value.
15. A computer-implemented system for accessing a database, comprising:
(a) a processor having a memory;
(b) one or more instructions, performed by the processor, for defining one or more object classes in the memory of the processor to match one or more corresponding specialized data types stored in the database and for creating one or more instances of the defined object classes in the memory of the processor to represent data in the database that comprise the corresponding specialized data types.
16. The system of claim 15 above, wherein the instructions for defining further comprise instructions for defining the object classes within a Component Broker.
17. The system of claim 15 above, wherein the defined object class includes one or more member functions selected from a group comprising object initialization, comparisons, query functions, and manipulation functions.
18. The system of claim 15 above, wherein attributes and member functions associated with the corresponding specialized data type are preserved in the defined object classes.
19. The system of claim 18 above, wherein the member functions emulate semantics of the corresponding specialized data types.
20. The system of claim 18 above, wherein the member functions produce similar results as equivalent expressions evaluated by a database manager for the database.
21. The system of claim 15 above, wherein a public interface of the defined object classes matches characteristics and usage of the specialized data type in the database.
22. The system of claim 15 above, wherein the specialized data types are selected from a group comprising date, decimal, duration, time, and timestamp.
23. The system of claim 15 above, wherein the defined object classes are selected from a group comprising date class, decimal class, duration class, time class, and timestamp class.
24. The system of claim 23 above, wherein the date class stores a calendar date value.
25. The system of claim 23 above, wherein the decimal class stores a decimal value.
26. The system of claim 23 above, wherein the duration class stores a duration value.
27. The system of claim 23 above, wherein the time class stores a time-of-day value.
28. The system of claim 23 above, wherein the timestamp class stores a timestamp value.
29. An article of manufacture comprising a carrier embodying logic for accessing a database, the method comprising the steps of:
(a) defining one or more object classes in a memory of a processor to match one or more corresponding specialized data types stored in the database; and
(b) creating one or more instances of the defined object classes in the memory of the processor to represent data in the database that comprise the corresponding specialized data types.
30. The method of claim 29 above, wherein the defining step further comprises the step of defining the object classes within a Component Broker.
31. The method of claim 29 above, wherein the defined object class includes one or more methods selected from a group comprising object initialization, comparisons, query functions, and manipulation functions.
32. The method of claim 29 above, wherein attributes and methods associated with the corresponding specialized data type are preserved in the defined object classes.
33. The method of claim 32 above, wherein the methods emulate semantics of the corresponding specialized data types.
34. The method of claim 32 above, wherein the methods produce similar results as equivalent expressions evaluated by a database manager for the database.
35. The method of claim 29 above, wherein a public interface of the defined object classes matches characteristics and usage of the specialized data type in the database.
36. The method of claim 29 above, wherein the specialized data types are selected from a group comprising date, decimal, duration, time, and timestamp.
37. The method of claim 29 above, wherein the defined object classes are selected from a group comprising date class, decimal class, duration class, time class, and timestamp class.
38. The method of claim 37 above, wherein the date class stores a calendar date value.
39. The method of claim 37 above, wherein the decimal class stores a decimal value.
40. The method of claim 37 above, wherein the duration class stores a duration value.
41. The method of claim 37 above, wherein the time class stores a time-of-day value.
42. The method of claim 37 above, wherein the timestamp class stores a timestamp value.
US09/163,505 1998-09-30 1998-09-30 Defining object classes to match corresponding specialized data types in a relational database Expired - Lifetime US6397203B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US09/163,505 US6397203B1 (en) 1998-09-30 1998-09-30 Defining object classes to match corresponding specialized data types in a relational database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US09/163,505 US6397203B1 (en) 1998-09-30 1998-09-30 Defining object classes to match corresponding specialized data types in a relational database

Publications (2)

Publication Number Publication Date
US20020046201A1 true US20020046201A1 (en) 2002-04-18
US6397203B1 US6397203B1 (en) 2002-05-28

Family

ID=22590309

Family Applications (1)

Application Number Title Priority Date Filing Date
US09/163,505 Expired - Lifetime US6397203B1 (en) 1998-09-30 1998-09-30 Defining object classes to match corresponding specialized data types in a relational database

Country Status (1)

Country Link
US (1) US6397203B1 (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6546359B1 (en) 2000-04-24 2003-04-08 Sun Microsystems, Inc. Method and apparatus for multiplexing hardware performance indicators
US6647546B1 (en) 2000-05-03 2003-11-11 Sun Microsystems, Inc. Avoiding gather and scatter when calling Fortran 77 code from Fortran 90 code
US20030223552A1 (en) * 2001-12-05 2003-12-04 Gustav Schoeman Means and method for computerized call logging
US20040015474A1 (en) * 2002-07-22 2004-01-22 Anonsen Steven P. Database simulation of data types
US20040049544A1 (en) * 2002-09-05 2004-03-11 Hitachi, Ltd. In-context launch management method, system therefor, and computer-readable storage medium
US6802057B1 (en) 2000-05-03 2004-10-05 Sun Microsystems, Inc. Automatic generation of fortran 90 interfaces to fortran 77 code
US20060106756A1 (en) * 2004-09-30 2006-05-18 Zimmerer Peter K Normalization of a multi-dimensional set object
US20060288018A1 (en) * 2005-06-20 2006-12-21 Afshan Ally Loose coupling of Web services
US20090171625A1 (en) * 2008-01-02 2009-07-02 Beehive Engineering Systems, Llc Statement-Based Computing System
US20110213808A1 (en) * 2010-02-26 2011-09-01 Gm Global Technology Operations, Inc. Terms management system (tms)
US8909722B2 (en) 2007-03-07 2014-12-09 True Engineering Technology, Llc System and method of supporting constructive discourse on computers and mobile devices
US20150095403A1 (en) * 2013-09-27 2015-04-02 Rolan Abdukalykov Business object attachments and expiring urls
CN109956850A (en) * 2017-12-26 2019-07-02 信越化学工业株式会社 The production method of 3,7- dimethyl -7- matsutake alcohol and 3,7- dimethyl -7- octenyl carboxylate compound
US20220245261A1 (en) * 2021-02-01 2022-08-04 Protegrity Corporation Parallel tokenization of date and time information in a distributed network environment
US11809432B2 (en) 2002-01-14 2023-11-07 Awemane Ltd. Knowledge gathering system based on user's affinity
US12093420B2 (en) 2020-10-16 2024-09-17 Protegrity Us Holding, Llc Data tokenization and search in a distributed network

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6574635B2 (en) * 1999-03-03 2003-06-03 Siebel Systems, Inc. Application instantiation based upon attributes and values stored in a meta data repository, including tiering of application layers objects and components
US7000194B1 (en) 1999-09-22 2006-02-14 International Business Machines Corporation Method and system for profiling users based on their relationships with content topics
US6700590B1 (en) * 1999-11-01 2004-03-02 Indx Software Corporation System and method for retrieving and presenting data using class-based component and view model
US7007035B2 (en) * 2001-06-08 2006-02-28 The Regents Of The University Of California Parallel object-oriented decision tree system
JP2003186855A (en) * 2001-12-20 2003-07-04 Fujitsu Ltd System and method for object cooperation by type collation
US9288000B2 (en) 2003-12-17 2016-03-15 International Business Machines Corporation Monitoring a communication and retrieving information relevant to the communication
US20060149731A1 (en) * 2005-01-05 2006-07-06 Schirmer Andrew L System and method for deriving affinity relationships between objects
US20080016041A1 (en) * 2006-07-14 2008-01-17 Frost Brandon H Spreadsheet-based relational database interface

Family Cites Families (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4930071A (en) 1987-06-19 1990-05-29 Intellicorp, Inc. Method for integrating a knowledge-based system with an arbitrary database system
US5794001A (en) * 1989-06-30 1998-08-11 Massachusetts Institute Of Technology Object-oriented computer user interface
US5297279A (en) * 1990-05-30 1994-03-22 Texas Instruments Incorporated System and method for database management supporting object-oriented programming
US5295256A (en) 1990-12-14 1994-03-15 Racal-Datacom, Inc. Automatic storage of persistent objects in a relational schema
EP0620520A1 (en) * 1993-03-30 1994-10-19 AT&T Corp. Method for making persistent data objects having hidden pointers
US5550971A (en) * 1993-06-30 1996-08-27 U S West Technologies, Inc. Method and system for generating a user interface adaptable to various database management systems
US5504886A (en) 1993-07-02 1996-04-02 International Business Machines Corporation System and method for applying user supplied relation definitions to application files for a relational database
WO1995003586A1 (en) 1993-07-21 1995-02-02 Persistence Software, Inc. Method and apparatus for generation of code for mapping relational data to objects
US6061515A (en) * 1994-07-18 2000-05-09 International Business Machines Corporation System and method for providing a high level language for mapping and accessing objects in data stores
FR2724471B1 (en) * 1994-09-13 1996-10-25 Bull Sa DEVICE FOR GENERATION OF OBJECT-ORIENTED INTERFACES FOR RELATIONAL DATABASES AND METHOD IMPLEMENTED BY SUCH DEVICE
US5684984A (en) * 1994-09-29 1997-11-04 Apple Computer, Inc. Synchronization and replication of object databases
US5542078A (en) 1994-09-29 1996-07-30 Ontos, Inc. Object oriented data store integration environment for integration of object oriented databases and non-object oriented data facilities
US5625818A (en) * 1994-09-30 1997-04-29 Apple Computer, Inc. System for managing local database updates published to different online information services in different formats from a central platform
US5694598A (en) * 1994-10-12 1997-12-02 U S West Technologies, Inc. Method for mapping data between a relational format and an object-oriented format
US5752027A (en) 1994-11-30 1998-05-12 Dun & Bradstreet Software Services, Inc. Apparatus and process for creating and accessing a database centric object
US5893108A (en) * 1994-12-29 1999-04-06 International Business Machines Corporation System, method, and computer program product for efficiently translating relational tuples to object-oriented objects
US5799309A (en) * 1994-12-29 1998-08-25 International Business Machines Corporation Generating an optimized set of relational queries fetching data in an object-relational database
US5682524A (en) 1995-05-26 1997-10-28 Starfish Software, Inc. Databank system with methods for efficiently storing non-uniform data records
US5829006A (en) * 1995-06-06 1998-10-27 International Business Machines Corporation System and method for efficient relational query generation and tuple-to-object translation in an object-relational gateway supporting class inheritance
US6272501B1 (en) * 1995-08-30 2001-08-07 Peter Baumann Database system for management of arrays
US5872973A (en) * 1995-10-26 1999-02-16 Viewsoft, Inc. Method for managing dynamic relations between objects in dynamic object-oriented languages
US6032144A (en) * 1996-05-29 2000-02-29 Lucent Technologies Inc. Optimization of queries using relational algebraic theta-semijoin operator
US5890160A (en) * 1997-05-06 1999-03-30 International Business Machines Corp. Object representation of relational database cells having nontraditional large object datatypes
US5960438A (en) * 1997-05-06 1999-09-28 International Business Machines Corp. Class hierarchy for object aggregation representation of relational database rows with cells having nontraditional datatypes
US6134540A (en) * 1997-05-09 2000-10-17 International Business Machines Corporation System, method, and program for applying query rewrite technology to object building
US6122627A (en) * 1997-05-09 2000-09-19 International Business Machines Corporation System, method, and program for object building in queries over object views
US5897634A (en) * 1997-05-09 1999-04-27 International Business Machines Corporation Optimized caching of SQL data in an object server system
US6047284A (en) * 1997-05-14 2000-04-04 Portal Software, Inc. Method and apparatus for object oriented storage and retrieval of data from a relational database
US5878411A (en) * 1997-06-27 1999-03-02 International Business Machines Corporation Dependent object class and subclass mapping to relational data store
US5937409A (en) * 1997-07-25 1999-08-10 Oracle Corporation Integrating relational databases in an object oriented environment
US5956730A (en) * 1997-08-15 1999-09-21 International Business Machines Corporation Legacy subclassing
EP1068577A1 (en) * 1997-09-26 2001-01-17 Ontos, Inc. Object model mapping and runtime engine for employing relational database with object oriented software
US6076090A (en) * 1997-11-26 2000-06-13 International Business Machines Corporation Default schema mapping
US6003083A (en) * 1998-02-19 1999-12-14 International Business Machines Corporation Workload management amongst server objects in a client/server network with distributed objects

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6546359B1 (en) 2000-04-24 2003-04-08 Sun Microsystems, Inc. Method and apparatus for multiplexing hardware performance indicators
US6647546B1 (en) 2000-05-03 2003-11-11 Sun Microsystems, Inc. Avoiding gather and scatter when calling Fortran 77 code from Fortran 90 code
US6802057B1 (en) 2000-05-03 2004-10-05 Sun Microsystems, Inc. Automatic generation of fortran 90 interfaces to fortran 77 code
US20030223552A1 (en) * 2001-12-05 2003-12-04 Gustav Schoeman Means and method for computerized call logging
US11809432B2 (en) 2002-01-14 2023-11-07 Awemane Ltd. Knowledge gathering system based on user's affinity
US7711675B2 (en) * 2002-07-22 2010-05-04 Microsoft Corporation Database simulation of data types
US20040015474A1 (en) * 2002-07-22 2004-01-22 Anonsen Steven P. Database simulation of data types
US20040049544A1 (en) * 2002-09-05 2004-03-11 Hitachi, Ltd. In-context launch management method, system therefor, and computer-readable storage medium
US7165251B2 (en) 2002-09-05 2007-01-16 Hitachi, Ltd. In-context launch management method, system therefor, and computer-readable storage medium
US7765221B2 (en) * 2004-09-30 2010-07-27 Sap Ag Normalization of a multi-dimensional set object
US20060106756A1 (en) * 2004-09-30 2006-05-18 Zimmerer Peter K Normalization of a multi-dimensional set object
US20060288018A1 (en) * 2005-06-20 2006-12-21 Afshan Ally Loose coupling of Web services
US9276888B2 (en) 2007-03-07 2016-03-01 True Engineering Technology, Llc System and method of supporting constructive discourse on computers and mobile devices
US8909722B2 (en) 2007-03-07 2014-12-09 True Engineering Technology, Llc System and method of supporting constructive discourse on computers and mobile devices
US20090171625A1 (en) * 2008-01-02 2009-07-02 Beehive Engineering Systems, Llc Statement-Based Computing System
US9779082B2 (en) * 2008-01-02 2017-10-03 True Engineering Technology, Llc Portable self-describing representations of measurements
US20110213808A1 (en) * 2010-02-26 2011-09-01 Gm Global Technology Operations, Inc. Terms management system (tms)
US8375352B2 (en) * 2010-02-26 2013-02-12 GM Global Technology Operations LLC Terms management system (TMS)
US20150095403A1 (en) * 2013-09-27 2015-04-02 Rolan Abdukalykov Business object attachments and expiring urls
US9854052B2 (en) * 2013-09-27 2017-12-26 Sap Se Business object attachments and expiring URLs
CN109956850A (en) * 2017-12-26 2019-07-02 信越化学工业株式会社 The production method of 3,7- dimethyl -7- matsutake alcohol and 3,7- dimethyl -7- octenyl carboxylate compound
US12093420B2 (en) 2020-10-16 2024-09-17 Protegrity Us Holding, Llc Data tokenization and search in a distributed network
US20220245261A1 (en) * 2021-02-01 2022-08-04 Protegrity Corporation Parallel tokenization of date and time information in a distributed network environment
US11962699B2 (en) 2021-02-01 2024-04-16 Protegrity Corporation Parallel tokenization of decimal information in a distributed network environment

Also Published As

Publication number Publication date
US6397203B1 (en) 2002-05-28

Similar Documents

Publication Publication Date Title
US6397203B1 (en) Defining object classes to match corresponding specialized data types in a relational database
US5926819A (en) In-line triggers
US6363389B1 (en) Technique for creating a unique quasi-random row identifier
US9384222B2 (en) Database system that provides for history-enabled tables
US7461097B2 (en) Method, system, and computer program for migrating content from source database to target database
US6366917B1 (en) Method of modifying a populated database structure by modifying metadata describing the database structure
US6574631B1 (en) Methods and systems for runtime optimization and customization of database applications and application entities
US6341289B1 (en) Object identity and partitioning for user defined extents
US8924384B2 (en) Upgrading column-based databases
US5485610A (en) Physical database design system
US6944845B2 (en) Implementation for an object oriented run-time extensible item
US8387028B2 (en) Determining a target data type in a heterogeneous multi-level environment
EP2017748B1 (en) Method and system for managing complex database information
US20050262165A1 (en) Data storage system
EP1068577A1 (en) Object model mapping and runtime engine for employing relational database with object oriented software
JP2003517650A (en) Integrate changes to the object model and changes to the database into the source code using an object-relational mapping tool
CA2079131A1 (en) Change definition language for computer database system
Eisenberg et al. SQL standardization: the next steps
Soo et al. Mixed calendar query language support for temporal constants
Ryan et al. Package ‘xts’
US20240134833A1 (en) Relational database system
Bales JDBC pocket reference
Roddick et al. Transaction time support
Celko Joe Celko's SQL for smarties
Davidson et al. Physical Model Case Study

Legal Events

Date Code Title Description
AS Assignment

Owner name: INTERNATIONAL BUSINESS MACHINES CORPORATION, NEW Y

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:HEMBRY, DOUGLAS MICHAEL;REEL/FRAME:009486/0667

Effective date: 19980929

STCF Information on status: patent grant

Free format text: PATENTED CASE

FPAY Fee payment

Year of fee payment: 4

FPAY Fee payment

Year of fee payment: 8

REMI Maintenance fee reminder mailed
FPAY Fee payment

Year of fee payment: 12

SULP Surcharge for late payment

Year of fee payment: 11