Thursday, September 24, 2009

Conversion Functions

Conversion Functions :

  • In some cases, the PostgreSQL server uses data of one data type where it expects data of a different data type. When this happens, the PostgreSQL server can automatically convert the data to the expected data type. This data type conversion can be done implicitly by the PostgreSQL server or explicitly by the user
  • Conversion functions convert a value from one data type to another


  • Implicit data type conversions work according to the rules that are explained in the next two slides
Implicit Data Type Conversion :
  • The assignment succeeds if the PostgreSQL server can convert the data type of the value used in the assignment to that of the assignment target
  • example, the expression hiredate > '01-JAN-90' results in the implicit conversion from the string '01-JAN-90' to a date


Explicit Data Type Conversion :
  • Explicit data type conversions are done by using the conversion functions

No comments:

Post a Comment

Followers