Teradata Database. SQL Reference. Data Types and Literals

Size: px
Start display at page:

Download "Teradata Database. SQL Reference. Data Types and Literals"

Transcription

1 Teradata Database SQL Reference Data Types and Literals Release 12.0 B A November 2009

2 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, BYNET, DBC/1012, DecisionCast, DecisionFlow, DecisionPoint, Eye logo design, InfoWise, Meta Warehouse, MyCommerce, SeeChain, SeeCommerce, SeeRisk, Teradata Decision Experts, Teradata Source Experts, WebAnalyst, and You ve Never Seen Your Business Like This Before are trademarks or registered trademarks of Teradata Corporation or its affiliates. Adaptec and SCSISelect are trademarks or registered trademarks of Adaptec, Inc. AMD Opteron and Opteron are trademarks of Advanced Micro Devices, Inc. BakBone and NetVault are trademarks or registered trademarks of BakBone Software, Inc. EMC, PowerPath, SRDF, and Symmetrix are registered trademarks of EMC Corporation. GoldenGate is a trademark of GoldenGate Software, Inc. Hewlett-Packard and HP are registered trademarks of Hewlett-Packard Company. Intel, Pentium, and XEON are registered trademarks of Intel Corporation. IBM, CICS, DB2, MVS, RACF, Tivoli, and VM are registered trademarks of International Business Machines Corporation. Linux is a registered trademark of Linus Torvalds. LSI and Engenio are registered trademarks of LSI Corporation. Microsoft, Active Directory, Windows, Windows NT, and Windows Server are registered trademarks of Microsoft Corporation in the United States and other countries. Novell and SUSE are registered trademarks of Novell, Inc., in the United States and other countries. QLogic and SANbox trademarks or registered trademarks of QLogic Corporation. SAS and SAS/C are trademarks or registered trademarks of SAS Institute Inc. SPARC is a registered trademarks of SPARC International, Inc. Sun Microsystems, Solaris, Sun, and Sun Java are trademarks or registered trademarks of Sun Microsystems, Inc., in the United States and other countries. Symantec, NetBackup, and VERITAS are trademarks or registered trademarks of Symantec Corporation or its affiliates in the United States and other countries. Unicode is a collective membership mark and a service mark of Unicode, Inc. UNIX is a registered trademark of The Open Group in the United States and other countries. Other product and company names mentioned herein may be the trademarks of their respective owners. THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED ON AN AS-IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY NOT APPLY TO YOU. IN NO EVENT WILL TERADATA CORPORATION BE LIABLE FOR ANY INDIRECT, DIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS OR LOST SAVINGS, EVEN IF EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. The information contained in this document may contain references or cross-references to features, functions, products, or services that are not announced or available in your country. Such references do not imply that Teradata Corporation intends to announce such features, functions, products, or services in your country. Please consult your local Teradata Corporation representative for those features, functions, products, or services available in your country. Information contained in this document may contain technical inaccuracies or typographical errors. Information may be changed or updated without notice. Teradata Corporation may also make improvements or changes in the products or services described in this information at any time without notice. To maintain the quality of our products and services, we would like your comments on the accuracy, clarity, organization, and value of this document. Please teradata-books@lists.teradata.com Any comments or materials (collectively referred to as Feedback ) sent to Teradata Corporation will be deemed non-confidential. Teradata Corporation will have no obligation of any kind with respect to Feedback and will be free to use, reproduce, disclose, exhibit, display, transform, create derivative works of, and distribute the Feedback and derivative works thereof without limitation on a royalty-free basis. Further, Teradata Corporation will be free to use any ideas, concepts, know-how, or techniques contained in such Feedback for any purpose whatsoever, including developing, manufacturing, or marketing products or services incorporating Feedback. Copyright by Teradata Corporation. All Rights Reserved.

3 Preface Purpose SQL Reference: Data Types and Literals describes how to use data types and literals within Teradata SQL. Use this book in conjunction with the other books in the SQL Reference book set. Audience System administrators, database administrators, and security administrators are the principal audience for this book. Teradata field engineers and other technical personnel responsible for designing and maintaining Teradata Database may also find this book useful. Supported Software Release This book supports Teradata Database Prerequisites You should be familiar with basic relational database management technology and SQL. This manual is not an SQL primer. If you are not familiar with Teradata Database, you may find it useful to read Introduction to Teradata Warehouse before reading this document. For additional information about developing applications using embedded SQL, see Teradata Preprocessor2 for Embedded SQL Programmer Guide. Changes to This Book This book includes the following changes to support the current release: Date November 2009 Description Clarified rounding of FLOAT, REAL, DOUBLE PRECISION data types. SQL Reference: Data Types and Literals 3

4 Preface Additional Information Date Description September 2007 Addition of material to support Unicode character string literals, hexadecimal name literals, and Unicode delimited identifiers Addition of material to explain the use of the DECIMALDIGITS BTEQ command to set the maximum precision for decimal values Addition of material to support implicit conversion of DateTime data types September 2006 Addition of material to support BIGINT data type Modification of DECIMAL data type to support a maximum of 38 digits November 2005 Addition of material to support UDT data types Additional Information Additional information that supports this product and Teradata Database is available at the following Web sites. Type of Information Description Source Overview of the release Information too late for the manuals Additional information related to this product The Release Definition provides the following information: Overview of all the products in the release Information received too late to be included in the manuals Operating systems and Teradata Database versions that are certified to work with each product Version numbers of each product and the documentation for each product Information about available training and support center Use the Teradata Information Products Web site to view or download the most recent versions of all manuals. Specific manuals that supply related or additional information to this manual are listed. Click General Search. In the Publication Product ID field, enter 1725 and click Search to bring up the following Release Definition: Base System Release Definition B K Click General Search, and do one of the following: In the Product Line field, select Software - Teradata Database for a list of all of the publications for this release, In the Publication Product ID field, enter a book number. 4 SQL Reference: Data Types and Literals

5 Preface References to Microsoft Windows and Linux Type of Information Description Source CD-ROM images Ordering information for manuals General information about Teradata This site contains a link to a downloadable CD-ROM image of all customer documentation for this release. Customers are authorized to create CD-ROMs for their use from this image. Use the Teradata Information Products Web site to order printed versions of manuals. The Teradata home page provides links to numerous sources of information about Teradata. Links include: Executive reports, case studies of customer experiences with Teradata, and thought leadership Technical information, solutions, and expert advice Press releases, mentions and media resources Click General Search. In the Title or Keyword field, enter CD-ROM, and Click Search. Click How to Order under Print & CD Publications. Teradata.com References to Microsoft Windows and Linux This book refers to Microsoft Windows and Linux. For Teradata Database 12.0, these references mean the following: Windows is Microsoft Windows Server bit and Microsoft Windows Server bit. Linux is SUSE Linux Enterprise Server 9 and SUSE Linux Enterprise Server 10. Teradata plans to release Teradata Database support for SUSE Linux Enterprise Server 10 before the next major or minor release of the database. Therefore, information about this SUSE release is included in this document. The announcement regarding availability of SUSE Linux Enterprise Server 10 will be made after Teradata Database 12.0 GCA. Please check with your account representative regarding SUSE Linux Enterprise Server 10 availability in your location. SQL Reference: Data Types and Literals 5

6 Preface References to Microsoft Windows and Linux 6 SQL Reference: Data Types and Literals

7 Table of Contents Preface Purpose Audience Supported Software Release Prerequisites Changes to This Book Additional Information References to Microsoft Windows and Linux Chapter 1: SQL Data Definition Data Definition in SQL Data Definition Phrases Data Conversion Constraint Attributes Uniqueness Constraints CHECK Constraints Referential Constraints Chapter 2: Data Literals Hexadecimal Byte Literals Overview of Numeric Literals Integer Literals Hexadecimal Integer Literals Decimal Literals Floating Point Literals Overview of Date and Time Literals DateTime Literals Date Literals Time Literals SQL Reference: Data Types and Literals 7

8 Table of Contents Timestamp Literals Overview of Interval Literals INTERVAL YEAR Literals INTERVAL YEAR TO MONTH Literals INTERVAL MONTH Literals INTERVAL DAY Literals INTERVAL DAY TO HOUR Literals INTERVAL DAY TO MINUTE Literals INTERVAL DAY TO SECOND Literals INTERVAL HOUR Literals INTERVAL HOUR TO MINUTE Literals INTERVAL HOUR TO SECOND Literals INTERVAL MINUTE Literals INTERVAL MINUTE TO SECOND Literals INTERVAL SECOND Literals Character String Literals Hexadecimal Character Literals Unicode Character String Literals Graphic Literals Object Name Literals Hexadecimal Name Literals Unicode Delimited Identifier Chapter 3: Decimal/Numeric Data Types ANSI/Teradata Synonyms for Numeric Types BYTEINT Data Type SMALLINT Data Type INTEGER Data Type BIGINT Data Type DECIMAL/NUMERIC Data Types FLOAT/REAL/DOUBLE PRECISION Data Types Floating Point Values are Inexact Rounding SQL Reference: Data Types and Literals

9 Table of Contents Chapter 4: DateTime and Interval Data Types DateTime Fields Time Zones DATE Data Type DATE Formats TIME Data Type TIMESTAMP Data Type TIME WITH TIME ZONE Data Type TIMESTAMP WITH TIME ZONE Data Type TIME and TIMESTAMP Formats INTERVAL YEAR Data Type INTERVAL YEAR TO MONTH Data Type INTERVAL MONTH Data Type INTERVAL DAY Data Type INTERVAL DAY TO HOUR Data Type INTERVAL DAY TO MINUTE Data Type INTERVAL DAY TO SECOND Data Type INTERVAL HOUR Data Type INTERVAL HOUR TO MINUTE Data Type INTERVAL HOUR TO SECOND Data Type INTERVAL MINUTE Data Type INTERVAL MINUTE TO SECOND Data Type INTERVAL SECOND Data Type Chapter 5: Character and CLOB Data Types Character Data CHARACTER Data Type VARCHAR Data Type LONG VARCHAR Data Type CLOB Data Type Default Case Sensitivity of Character Columns CASESPECIFIC Phrase UPPERCASE Phrase Teradata SQL Character Strings and Client Physical Bytes CHARACTER SET Phrase SQL Reference: Data Types and Literals 9

10 Table of Contents LATIN Server Character Set UNICODE Server Character Set GRAPHIC Server Character Set KANJISJIS Server Character Set KANJI1 Server Character Set Chapter 6: Byte and BLOB Data Types Data Storage of Byte and BLOB Types BYTE Data Type VARBYTE Data Type BLOB Data Type Chapter 7: UDT Data Types UDT Data Type Chapter 8: Default Value Control Phrases Using Default Value Control Phrases COMPRESS Phrase NOT NULL Phrase DEFAULT Phrase WITH DEFAULT Phrase Chapter 9: Output Format Phrases Data Display Default Formats FORMAT FORMAT Phrase and Character Formats FORMAT Phrase and NUMERIC Formats FORMAT Phrase and DateTime Formats FORMAT Phrase, DateTime Formats, and Japanese Character Sets Naming Columns and Expressions AS SQL Reference: Data Types and Literals

11 Table of Contents NAMED TITLE Appendix A: Notation Conventions Syntax Diagram Conventions Character Shorthand Notation Used In This Book Predicate Calculus Notation Used in This Book Glossary Index SQL Reference: Data Types and Literals 11

12 Table of Contents 12 SQL Reference: Data Types and Literals

13 CHAPTER 1 SQL Data Definition This chapter describes some of the general principles of SQL data definition. The specific topics described in the chapter are: Data definition in SQL, including: Data type phrases Data type attributes: ANSI and Teradata mode Column and table constraints, including: Uniqueness constraints CHECK constraints Referential constraints Data Definition in SQL Introduction Data definition phrases, also referred to as data description phrases, appear in CREATE TABLE or ALTER TABLE statements to define how to store data in the columns of a table, how to present the data in the results of queries, and whether to apply column-level integrity constraints. You can also use data definition phrases in expressions to convert data to another type or modify data attributes. Syntax column_name data_type_declaration data_type_attribute column_storage_attribute column_constraint_attribute FF07D233 SQL Reference: Data Types and Literals 13

14 Chapter 1: SQL Data Definition Data Definition in SQL where: Syntax element data_type_declaration data_type_attribute column_storage_attribute column_constraint_attribute Specifies the data type of a column, such as BYTE or FLOAT. For more information, see Data Type Phrases on page 15. attributes for a column, such as a default value to insert when an INSERT statement omits the value. For more information, see Core Data Type Attributes on page 17. to compress certain values and nulls for one or more columns of a table. For more information, see: Storage and Constraint Attributes on page 18. COMPRESS Phrase on page 222. column-level integrity constraints, such as PRIMARY KEY. For more information, see: Storage and Constraint Attributes on page 18. Column and Table Constraints on page 20. ALTER TABLE and CREATE TABLE in SQL Reference: Data Definition Statements. Using Data Definition The following CREATE TABLE statement uses Teradata SQL data definition phrases to define the columns of the Employee table: CREATE TABLE Employee (EmpNo PRIMARY KEY SMALLINT FORMAT '9(5)' CHECK(EmpNo BETWEEN 1000 AND 32001), Name VARCHAR(12) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL, DeptNo SMALLINT FORMAT '999' CHECK (DeptNo BETWEEN 100 AND 900), JobTitle VARCHAR(12) CHARACTER SET LATIN NOT CASESPECIFIC, Salary DECIMAL(8,2) FORMAT 'ZZZ,ZZ9.99' CHECK (Salary BETWEEN 1.00 AND ), YrsExp BYTEINT FORMAT 'Z9' CHECK (YrsExp BETWEEN -99 AND 99), DOB DATE FORMAT MMMbDDbYYYY NOT NULL, Sex CHAR CHARACTER SET LATIN UPPERCASE NOT NULL, Race CHAR CHARACTER SET LATIN UPPERCASE, MStat CHAR CHARACTER SET LATIN UPPERCASE, EdLev BYTEINT FORMAT 'Z9' CHECK (EdLev BETWEEN 0 AND 2) NOT NULL, HCap BYTEINT FORMAT 'Z9' CHECK (HCap BETWEEN -99 AND 99) INDEX (Name) ; 14 SQL Reference: Data Types and Literals

15 Chapter 1: SQL Data Definition Data Definition Phrases The following SELECT statement uses Teradata SQL data definition phrases to modify the heading of the EmpNo column and the format of the results of the Salary column: SELECT EmpNo (TITLE 'Employee Number'), Salary (FORMAT 'GLLZ(I)D9(F)') FROM Employee; Data Definition Phrases Data Type Phrases A data type phrase determines the type of data to store in a column of a table on Teradata Database. When you create a table, you must specify a data type phrase for each column. A column does not have a default data type. You can also use data type phrases to specify data conversions in expressions. Use the data type phrases in the following table to define the data type as numeric, character, datetime, interval, byte, or user-defined type (UDT). Data Type Byte BLOB[(n)] BYTE[(n)] VARBYTE[(n)] Numeric BIGINT BYTEINT DATE a DECIMAL [(n[,m])] DOUBLE PRECISION FLOAT [n] INTEGER NUMERIC [(n[,m])] REAL SMALLINT ANSI SQL X X X X X X X X X Teradata Extension to ANSI SQL X X X X SQL Reference: Data Types and Literals 15

16 Chapter 1: SQL Data Definition Data Definition Phrases Data Type DateTime DATE a TIME [(n)] TIME [(n)] WITH TIME ZONE TIMESTAMP [(n)] TIMESTAMP [(n)] WITH TIME ZONE Interval INTERVAL INTERVAL DAY [(n)] INTERVAL DAY [(n)] TO HOUR INTERVAL DAY [(n)] TO MINUTE INTERVAL DAY [(n)] TO SECOND INTERVAL HOUR [(n)] INTERVAL HOUR [(n)] TO MINUTE INTERVAL HOUR [(n)] TO SECOND INTERVAL MINUTE [(n)] INTERVAL MINUTE [(n)] TO SECOND [(m)] INTERVAL MONTH INTERVAL SECOND [(n,[m])] INTERVAL YEAR [(n)] INTERVAL YEAR [(n)] TO MONTH Character CHAR[(n)] CLOB CHAR VARYING(n) LONG VARCHAR VARCHAR(n) ANSI SQL X X X X X X X X X X X X X X X X X X X X X X X Teradata Extension to ANSI SQL X 16 SQL Reference: Data Types and Literals

17 Chapter 1: SQL Data Definition Data Definition Phrases Data Type ANSI SQL Teradata Extension to ANSI SQL Graphic b GRAPHIC[(n)] LONG VARGRAPHIC VARGRAPHIC(n) UDT udt_name c X X X X Core Data Type Attributes a. DATE is supported both in its Teradata form and in the preferred ANSI DateTime form. For new development, define DATE using ANSI DATE type. b. The GRAPHIC types are equivalent to the type CHARACTER CHARACTER SET GRAPHIC, which is the form to use for all new development. c. The CREATE TYPE statement determines the name of a UDT. For details on the different level of ANSI compliance in this release, see SQL Reference: Fundamentals. The following table lists the main Teradata SQL data type attributes. Data Type Attribute ANSI Teradata Extension to ANSI NOT NULL X UPPERCASE [NOT] CASESPECIFIC FORMAT quote_string TITLE quote_string X X X X AS name X NAMED name X DEFAULT value X DEFAULT USER DEFAULT DATE DEFAULT TIME X X X DEFAULT NULL X SQL Reference: Data Types and Literals 17

18 Chapter 1: SQL Data Definition Data Definition Phrases Data Type Attribute ANSI Teradata Extension to ANSI WITH DEFAULT X CHARACTER SET X Restrictions apply to some attributes. For example, you cannot use the WITH DEFAULT attribute with UDT data types. For further details, see: Chapter 8: Default Value Control Phrases Chapter 9: Output Format Phrases SQL Reference: Data Definition Statements Storage and Constraint Attributes The following table lists Teradata SQL storage and constraint attributes. Attribute Family Data Type Attribute ANSI Teradata Extension to ANSI Column Storage COMPRESS COMPRESS NULL COMPRESS constant_value COMPRESS (value_list) X X X X Column Constraints Table Constraints CONSTRAINT CONSTRAINT UNIQUE CONSTRAINT PRIMARY KEY CONSTRAINT CHECK (boolean_condition) CONSTRAINT REFERENCES table_name column_name FOREIGN KEY (column_name_list) PRIMARY KEY UNIQUE CHECK (boolean_expression) REFERENCES table_name [(column_name_list)] X X X X X X X X X X 18 SQL Reference: Data Types and Literals

19 Chapter 1: SQL Data Definition Data Conversion Restrictions apply to some attributes. For example, you cannot use the COMPRESS attribute with LOB, INTERVAL, TIME, TIMESTAMP, VARBYTE, VARCHAR, or UDT data types. For further details, see: Chapter 8: Default Value Control Phrases SQL Reference: Data Definition Statements Data Conversion Introduction You can use data definition phrases in expressions to convert data to another type or modify data attributes. When used to modify the attributes of returned values, the data description phrase immediately follows the column being modified. expression ( data_type_list ) HH01A019 This syntax is called Teradata conversion syntax, and is non-ansi. For example, in the following SELECT statement, a TITLE phrase overrides the default heading (the column name) for EmpNo, and a FORMAT phrase modifies the display format defined for Salary data in the CREATE TABLE statement. SELECT EmpNo (TITLE 'Emp#'), Salary (FORMAT '$$$,$$9.99') FROM Employee; The expression data type attributes is non-ansi, as are attributes such as TITLE and FORMAT. You cannot use Teradata conversion syntax to convert data to a UDT type. ANSI SQL-compliant Data Conversion Further Information For applications that need to conform to ANSI as well as to modify attributes of a value, use the CAST function instead of Teradata conversion syntax. In this case, the modification is restricted to converting to an ANSI defined type. To select Name as a fixed length field and Salary as an integer value: SELECT CAST (Name AS CHAR(12)), CAST (Salary AS INTEGER) FROM Employee ; For information on Teradata conversion syntax and the CAST function, see SQL Reference: Functions and Operators. SQL Reference: Data Types and Literals 19

20 Chapter 1: SQL Data Definition Constraint Attributes Constraint Attributes Introduction Constraint attributes specify integrity rules. Constraints can be any of the following types: Uniqueness (see Uniqueness Constraints on page 20). CHECK (see CHECK Constraints on page 21). Referential integrity (see Referential Constraints on page 22). Column and Table Constraints You can specify constraints during table creation and modification. Column constraints apply to single columns as a part of the column definition. Column constraints include: CHECK constraint definition clause on a single column PRIMARY KEY constraint definition clause on a single column REFERENCES constraint definition clause on a single column UNIQUE constraint definition clause Table constraints apply to multiple columns. Table-level constraints include: CHECK constraint definition clause on multiple columns REFERENCES constraint definition clause on multiple columns PRIMARY KEY constraint definition clause on multiple columns UNIQUE constraint definition clause on multiple columns FOREIGN KEY constraint definition clause FOREIGN KEY constraint definitions must also specify a REFERENCES clause. The full syntax for constraints is in ALTER TABLE and CREATE TABLE in SQL Reference: Data Definition Statements. Uniqueness Constraints Definition A uniqueness constraint means the table cannot include two or more rows in which the values for the column or set of columns are identical. Teradata Database supports the following uniqueness constraints: PRIMARY KEY UNIQUE 20 SQL Reference: Data Types and Literals

21 Chapter 1: SQL Data Definition CHECK Constraints PRIMARY KEY Constraint UNIQUE Constraint A column or set of columns defined as PRIMARY KEY must also be NOT NULL. Teradata Database instantiates a PRIMARY KEY as a UNIQUE [PRIMARY] INDEX. Only one PRIMARY KEY can be defined for a table. For more details, see: CREATE TABLE in SQL Reference: Data Definition Statements. Keys in SQL Reference: Fundamentals. Constraint Specifications in Database Design. A UNIQUE column definition requires that data cannot be NULL. Queries are flagged as nonentry-level ANSI when the SQL flagger is enabled if any listed column is not also defined as NOT NULL. Teradata Database instantiates UNIQUE as a unique primary or secondary index. Also see Constraint Specifications in Database Design. CHECK Constraints Purpose Usage Notes CHECK constraints compare values of a field or fields in the same row with constants or other fields. CHECK constraints are applied to rows generated as candidates for INSERT and UPDATE operations. You cannot specify CHECK constraints for Identity columns. If the condition is met or the proposed INSERT or UPDATE contains NULLs, the operation is permitted. If the condition is not met, an error is reported as a constraint violation. For details on the syntax, see CREATE TABLE in SQL Reference: Data Definition Statements. Also see Constraint Specifications in Database Design. SQL Reference: Data Types and Literals 21

22 Chapter 1: SQL Data Definition Referential Constraints Examples CREATE TABLE stats_tbl (Id INTEGER,Sex CHAR(1),EdLev INTEGER,CHECK (Sex = 'F' OR Sex = 'M'),CHECK ((EdLev >= 0) AND (EdLev <= 22))); Referential Constraints Purpose Use referential constraints to indicate relationships between columns of different tables. There are three specific types of referential constraints. Referential Constraint Type DDL Definition Does It Enforce Referential Integrity? Level of Referential Integrity Enforcement Referential constraint REFERENCES WITH NO CHECK OPTION No None Batch referential integrity constraint REFERENCES WITH CHECK OPTION Yes Transaction Referential integrity constraint REFERENCES Yes Row Notes You cannot specify REFERENCES constraints for Identity columns. For additional information about REFERENCES constraints, see: ALTER TABLE and CREATE TABLE in SQL Reference: Data Definition Statements. Referential Integrity in SQL Reference: Fundamentals. Constraint Specifications in Database Design. 22 SQL Reference: Data Types and Literals

23 CHAPTER 2 Data Literals Literals are values coded directly in the text of an SQL statement, view or macro definition text, or CHECK constraint definition text. In general, the system is able to determine the type of a literal by its form. Literals are also referred to as constants. Topics described in this chapter include: Hexadecimal Byte Literals Numeric Literals Date and Time Literals Interval Literals Character Data Literals Graphic Literals Object Name Literals SQL Reference: Data Types and Literals 23

24 Chapter 2: Data Literals Hexadecimal Byte Literals Hexadecimal Byte Literals Purpose Declares a hexadecimal byte literal value. Syntax 'hexadecimal digits' XB V F 1101A391 where: This syntax element hexadecimal digits V F Specifies a string of hexadecimal digits, where a hexadecimal digit is a character from 0 to 9, a to f, or A to F. the hexadecimal literal is in byte variable format. the hexadecimal literal is in byte fixed format. This is the default if F or V is not specified. ANSI Compliance Hexadecimal byte literals are Teradata extensions to the ANSI SQL-2003 standard. Definition Data Types Hexadecimal literals consist of 0 to hexadecimal digits delimited by a matching pair of single quotes, where a hexadecimal digit is a character from 0 to 9, a to f, or A to F. The modifier following the XB determines the hexadecimal literal data type. IF a hexadecimal literal uses this form 'hexadecimal digits'xbv 'hexadecimal digits'xb 'hexadecimal digits'xbf THEN the data type is VARBYTE BYTE 24 SQL Reference: Data Types and Literals

25 Chapter 2: Data Literals Hexadecimal Byte Literals Usage Notes Rules Hexadecimal byte literal is the only form for entering a byte string. Hexadecimal byte literals are represented by an even number of hexadecimal digits. Hexadecimal literals are extended on the right with zeros when required. Consider the following table: CREATE TABLE bvalues (b1 BYTE(2)); Suppose you insert the hexadecimal byte literal 'C1C'XB into column b1: INSERT bvalues ('C1C'XB); The value is extended on the right with zeros: SELECT * FROM bvalues; b C1C0 Example Suppose the column CodeVal has been defined as BYTE(2). CREATE TABLE bvalues (IDVal INTEGER, CodeVal BYTE(2)); To insert a BYTE string as a hexadecimal literal, use the following form: INSERT bvalues (112193, '7879'XB) ; To select those rows from CodeVal, specify the conditional like this: SELECT IDVal FROM bvalues WHERE CodeVal = '7879'XB ; SQL Reference: Data Types and Literals 25

26 Chapter 2: Data Literals Overview of Numeric Literals Overview of Numeric Literals Definition A numeric literal is a string of 1 to 40 characters selected from the following: plus sign minus sign digits 0 through 9 decimal point Numeric literals are also referred to as numeric constants. Note: Teradata Database also supports a hexadecimal form of numeric literals to represent integer values. For details, see Hexadecimal Integer Literals on page 31. Types of Numeric Literals There are three kinds of numeric literals: Integers (see Integer Literals and Hexadecimal Integer Literals ) Decimals (see Decimal Literals ) Floating point numbers (see Floating Point Literals ) Examples The following are examples of valid numeric literals. Type BYTEINT SMALLINT INTEGER DECIMAL FLOATING POINT Examples E1 1.4E6 18E-3 26 SQL Reference: Data Types and Literals

27 Chapter 2: Data Literals Overview of Numeric Literals Examples of Nonvalid Numeric Literals The following are examples of nonvalid numeric literals. This literal is not valid Because it contains more than 38 digits. $20, a dollar sign and a comma E2945 four digits following the E. For the rules on what constitutes valid numeric literals, see the following sections: Integer Literals on page 29 Decimal Literals on page 33 Floating Point Literals on page 35 Determining the Data Type of a Numeric Literal The data type of a numeric literal is determined by the range of the literal value. The type used is the smallest that can contain the value. For example, the data type of the numeric literal 127 is BYTEINT because it is the smallest type that can fit the value 127. For decimal literals, the total number of digits determine the precision and the number of digits to the right of the decimal point determine the scale. FOR details on SEE the range of values of integer literals Integer Literal Data Types on page 29. determining the scale and precision of a decimal literal Scale and Precision on page 33. Implicit Conversion of Numeric Literals Depending on the kind of operation performed or the type of column in which a value is to be stored, SQL may convert numeric literal constants from one numeric data type to another. If a literal is outside the range for its required type, an error is reported during conversion. For more information on numeric to numeric data type conversions, see SQL Reference: Functions and Operators. Converting Character Strings to Numeric Literals Character data can contain a string that is intended to be interpreted as a numeric value (for example, '15'). In such cases, Teradata Database attempts to convert the string to a numeric value whenever the context makes such a conversion necessary. If the character string does not represent a valid numeric value, an error is reported. SQL Reference: Data Types and Literals 27

28 Chapter 2: Data Literals Overview of Numeric Literals When data in a character column must be compared with data in a numeric column, the character data is converted to numeric before the comparison is made. Note that this can result in repeated conversions during data access. If numeric data is defined and stored as a character string in a character column, and a SELECT operation uses a full table scan to compare the character column with a numeric literal, then the character column is converted to numeric in every row of the table. For more information on character to numeric data type conversions, see SQL Reference: Functions and Operators. 28 SQL Reference: Data Types and Literals

29 Chapter 2: Data Literals Integer Literals Integer Literals Purpose Declares literal strings of integer numbers in an expression. Syntax ± n where: ±n KR01A141 Syntax element Specifies ± an optional sign. The default is +. n any valid integer. Components of Integer Literals Integer Literal Data Types Integer literals consist of an optional sign followed by a sequence of digits. The data type of an integer literal is determined by the range of the literal value. The type used is the smallest that can contain the value. IF an integer literal fits in this range of values THEN the data type of the integer literal is -128 to 127 BYTEINT to -129 SMALLINT 128 to to INTEGER to A numeric literal that is outside the range of the INTEGER type is assigned to the DECIMAL type, unless it is outside the range of values that a DECIMAL type can represent. For more information, see Decimal Literals on page 33. SQL Reference: Data Types and Literals 29

30 Chapter 2: Data Literals Integer Literals If you need a numeric literal that is outside the range of the INTEGER type to be of a type other than DECIMAL, you can explicitly cast the literal to the desired type. For example, you can use the CAST function to explicitly cast a numeric literal to BIGINT: SELECT ProdID FROM PartsTbl WHERE CustID = CAST( AS BIGINT); Examples The following numbers are examples of integer literals Related Topics FOR information on SEE BYTEINT data types BYTEINT Data Type on page 84. SMALLINT data types SMALLINT Data Type on page 86. INTEGER data types INTEGER Data Type on page SQL Reference: Data Types and Literals

31 Chapter 2: Data Literals Hexadecimal Integer Literals Hexadecimal Integer Literals Purpose Declares a hexadecimal integer literal value. Syntax where: 'hexadecimal digits' X I A390 This syntax element hexadecimal digits Specifies a string of hexadecimal digits, where a hexadecimal digit is a character from 0 to 9, a to f, or A to F. 1 that the hexadecimal literal represents integers with a BYTEINT data type. 2 that the hexadecimal literal represents integers with a SMALLINT data type. 4 that the hexadecimal literal represents integers with an INTEGER data type. This is the default if 1, 2, or 4 is not specified. 8 that the hexadecimal literal represents integers with a BIGINT data type. ANSI Compliance Hexadecimal literals are Teradata extensions to the ANSI SQL-2003 standard. Definition Hexadecimal literals consist of 0 to hexadecimal digits delimited by a matching pair of single quotes, where a hexadecimal digit is a character from 0 to 9, a to f, or A to F. SQL Reference: Data Types and Literals 31

32 Chapter 2: Data Literals Hexadecimal Integer Literals Data Types The modifiers following the X determine the hexadecimal literal data type. IF a hexadecimal literal uses this form 'hexadecimal digits'x 'hexadecimal digits'xi 'hexadecimal digits'xi4 'hexadecimal digits'xi2 'hexadecimal digits'xi1 'hexadecimal digits'xi8 THEN the data type is INTEGER SMALLINT BYTEINT BIGINT Rules Hexadecimal integer literals are represented by an odd or even number of hexadecimal digits. The hexadecimal literal is right-justified. For example, the value 1000 can be expressed as any of the following: '3e8'X '0003e8'X '000003e8'X Example Consider the following table: CREATE TABLE id_pairs (region_id INTEGER, region CHAR(20)); Submit the following statement to find the value of the region column where the region_id is a hexadecimal value of 3e8: SELECT region FROM id_pairs WHERE region_id = '3e8'X; 32 SQL Reference: Data Types and Literals

33 Chapter 2: Data Literals Decimal Literals Decimal Literals Purpose Declares literal strings of decimal numbers in an expression. Syntax where: ± n. ±.n ±n.n KR01A143 Syntax element Specifies ± an optional sign. The default is +. n any valid integer. Components of Decimal Literals Decimal literals consist of the following components, reading from left-to-right: 1 Optional sign 2 Sequence of digits (including none) 3 Decimal point 4 Optional sequence of digits. Decimal Literal Data Types Decimal literals include the following types: DECIMAL NUMERIC Scale and Precision The total number of digits in a decimal literal determine the precision and the number of digits to the right of the decimal point determine the scale. Leading and trailing zeros are included in the counts. The precision cannot exceed 38. A numeric literal that is outside the range of the INTEGER type is assigned to DECIMAL(n,0), where n is the number of digits in the literal, excluding leading zeros. SQL Reference: Data Types and Literals 33

34 Chapter 2: Data Literals Decimal Literals Examples The following numbers are examples of decimal literals. Related Topics FOR information on SEE DECIMAL data types DECIMAL/NUMERIC Data Types on page SQL Reference: Data Types and Literals

35 Chapter 2: Data Literals Floating Point Literals Floating Point Literals Purpose Declares literal strings of floating point numbers in an expression. Syntax ± ne±m ± n.e±m ±.ne±m ±n.ne±m KR01A142 where: Syntax element Specifies ± an optional sign. The default is +. n E m any valid integer representing the whole and, optionally, fractional component of the mantissa. The total number of digits cannot exceed 15, excluding leading zeros in the whole component of the mantissa. the symbol indicating that what follows is the exponent for the number. any valid integer number representing the exponent for the number. The total number of digits cannot exceed three, including leading zeros. Components of Floating Point Literals Floating point literals consist of the following components, reading from left-to-right: 1 Optional sign 2 Sequence of digits (including none) representing the whole number portion of the mantissa 3 Optional decimal point 4 Sequence of digits (including none) representing the fractional portion of the mantissa 5 Literal character E 6 Optional sign 7 Sequence of digits (including none) representing the exponent SQL Reference: Data Types and Literals 35

36 Chapter 2: Data Literals Overview of Date and Time Literals Floating Point Literal Data Types Floating point literals are treated as having a FLOAT data type, which is treated as equivalent to: REAL DOUBLE PRECISION Examples The following numbers are examples of floating point literals. 1E E E23 Related Topics FOR information on FLOAT data types REAL data types DOUBLE PRECISION data types potential problems associated with floating point values in comparisons and computations SEE FLOAT/REAL/DOUBLE PRECISION Data Types on page 97. Floating Point Values are Inexact on page 100. Overview of Date and Time Literals Date and time literals declare date, time, or timestamp values in an SQL expression. ANSI DateTime Literals ANSI SQL provides DateTime literals to represent date, time, and timestamp values. There are three types of ANSI SQL DateTime literals: DATE TIME TIMESTAMP Teradata SQL Date and Time Literals Teradata also provides a non-ansi extension to DateTime functionality. Teradata SQL literals used with date or time values are simple quote strings and are interpreted as character data. These are converted to a date or time value based on the context, which is usually provided by a FORMAT clause. 36 SQL Reference: Data Types and Literals

37 Chapter 2: Data Literals DateTime Literals The existing Teradata SQL operations on character string literals used to represent date and time values are supported as a non-ansi extension to DateTime functionality. While Teradata SQL date and time literals come in a variety of formats for the character representations of date and time values, and so cannot be restricted to a default or standard format, ANSI DateTime literals are restricted to a strict set of formats. Existing functionality for Teradata SQL date literals is preserved. For example, suppose a column is defined as DATE with a format of 'YY/MM/DD'. If the value '97/12/31' is encountered as a character literal assigned to a DATE column, the process works just as it did prior to the introduction of ANSI DateTime formats because the character literal is implicitly cast to the DATE format. Unless explicitly stated, this chapter only discusses ANSI DateTime literals. DateTime Literals Introduction The ANSI SQL DateTime literals provide DateTime values in source text, supporting a means for declaring values for DATE, TIME, and TIMESTAMP data types. ANSI DateTime Literals Require a Keyword ANSI SQL DateTime literals differ from other SQL literals in that they are always prefaced by a keyword or keywords. Here is an example showing the TIMESTAMP keyword prefacing a timestamp literal: TIMESTAMP ' :00:00-08:00' Literals expressed in this format are interpreted exclusively as ANSI DateTime values. SQL Reference: Data Types and Literals 37

38 Chapter 2: Data Literals Date Literals Date Literals Purpose Declares a date value in ANSI DATE format in an expression. ANSI DATE literal is the preferred format for date constants. All date operations accept this format. Syntax DATE ' string ' 1101A036 where: Syntax element string Specifies a 10-character string enclosed in single quotes in the following form: YYYY-MM-DD This string YYYY MM DD Represents year. The valid range is 0001 through 9999, inclusive. You must specify all four digits. month. The valid range is 01 through 12, inclusive. You must specify both digits. day. The valid range is 01 through 31, inclusive, constrained by Gregorian calendar definitions. You must specify both digits. Usage Notes Date literals consist of the word DATE followed by a character string literal. This character string specifies the date value. The year, month, and day components of the quotestring literal must be separated by hyphens. 38 SQL Reference: Data Types and Literals

39 Chapter 2: Data Literals Date Literals Data Type Example DATE The following example selects all classes from the Classes table that start on January 6, SELECT * FROM CLASSES WHERE startdate = DATE ' '; Related Topics FOR information on SEE DATE data types DATE Data Type on page 109. SQL Reference: Data Types and Literals 39

40 Chapter 2: Data Literals Time Literals Time Literals Purpose Declares a time value in an expression. Syntax TIME ' string ' 1101A021 where string specifies an 8- to 21-character string enclosed in single quotes in one of four formats. This format... hh:mi:ss Represents... time with no fractional seconds digits or Time Zone. This string... hh mi ss Represents... hour of the day. The valid range is 00 23, inclusive. You must specify both digits. minute of the hour. The valid range is 00 59, inclusive. You must specify both digits. seconds. The valid range is You must specify both digits. 40 SQL Reference: Data Types and Literals

41 Chapter 2: Data Literals Time Literals This format... hh:mi:sssignhh:mi Represents... time with a specified Time Zone, but no fractional seconds digits. This string... hh mi ss signhh:mi Represents... hour of the day. The valid range is 00 23, inclusive, and you must specify both digits. minute of the hour. The valid range is 00 59, inclusive, and you must specify both digits. seconds. The valid range is 00 61, and you must specify both digits. hours and minutes in the Time Zone offset. The valid range is -12:59 through +13:00, inclusive. sign is + or - hh:mi:ss.ssssss time with up to six fractional seconds digits, but no Time Zone. This string... hh mi ss.ssssss Represents... hour of the day. The valid range is 00 23, inclusive, and you must specify both digits. minute of the hour. The valid range is 00 59, inclusive, and you must specify both digits. seconds. The valid range for the first two digits is You must specify both digits. You can specify from one to six fractional digits. SQL Reference: Data Types and Literals 41

Teradata Business Intelligence Optimizer. Release Definition

Teradata Business Intelligence Optimizer. Release Definition Teradata Business Intelligence Optimizer Release Definition Release 13.00 B035-4104-099C March 2010 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Business Intelligence Optimizer. Release Definition

Teradata Business Intelligence Optimizer. Release Definition Teradata Business Intelligence Optimizer Release Definition Release 13.01 B035-4104-060C June 2010 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Database. SQL Reference. Stored Procedures and Embedded SQL

Teradata Database. SQL Reference. Stored Procedures and Embedded SQL Teradata Database SQL Reference Stored Procedures and Embedded SQL Release 12.0 B035-1148-067A October 2007 The product or products described in this book are licensed products of Teradata Corporation

More information

Teradata Database. SQL Fundamentals

Teradata Database. SQL Fundamentals Teradata Database SQL Fundamentals Release 13.0 B035-1141-098A March 2010 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, BYNET,

More information

Teradata Tools and Utilities. Installation Guide for Microsoft Windows

Teradata Tools and Utilities. Installation Guide for Microsoft Windows Teradata Tools and Utilities Installation Guide for Microsoft Windows Release 12.00.00 B035-2407-067A December 2007 The product or products described in this book are licensed products of Teradata Corporation

More information

Teradata SQL Assistant/Web Edition. User Guide

Teradata SQL Assistant/Web Edition. User Guide Teradata SQL Assistant/Web Edition User Guide Release 12.00.00 B035-2505-067A July 2007 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata SQL Assistant for Microsoft Windows. User Guide

Teradata SQL Assistant for Microsoft Windows. User Guide Teradata SQL Assistant for Microsoft Windows User Guide Release 12.00.00 B035-2430-067A July 2007 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Database. Security Administration

Teradata Database. Security Administration Teradata Database Security Administration Release 13.0 B035-1100-098A November 2009 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata Manager. User Guide

Teradata Manager. User Guide Teradata Manager User Guide Release 12.0 B035-2428-067A July 2007 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, BYNET, DBC/1012,

More information

OpenSSL Heartbleed Vulnerability Fix Procedure for Aster Database Versions 5.0.2x, 5.0.1, 5.0.0 and 4.6.3x

OpenSSL Heartbleed Vulnerability Fix Procedure for Aster Database Versions 5.0.2x, 5.0.1, 5.0.0 and 4.6.3x OpenSSL Heartbleed Vulnerability Fix Procedure for Aster Database Versions 5.0.2x, 5.0.1, 5.0.0 and 4.6.3x Product ID: B700-6070-502K Aster Database version: 5.0.2x, 5.0.1, 5.0.0 and 4.6.3x Summary This

More information

Teradata Query Scheduler. User Guide

Teradata Query Scheduler. User Guide Teradata Query Scheduler User Guide Release 14.00 B035-2512-071A November 2011 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata AWS. User Guide

Teradata AWS. User Guide Teradata AWS User Guide Release 4.5 B035-5220-089A August 2009 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, BYNET, DBC/1012,

More information

Teradata Workload Analyzer. User Guide

Teradata Workload Analyzer. User Guide Teradata Workload Analyzer User Guide Release 13.10 B035-2514-020A February 2010 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata Preprocessor2 for Embedded SQL. Programmer Guide

Teradata Preprocessor2 for Embedded SQL. Programmer Guide Teradata Preprocessor2 for Embedded SQL Programmer Guide Release 12.00.00 B035-2446-067A February 2009 The product or products described in this book are licensed products of Teradata Corporation or its

More information

Teradata Database. Introduction to Teradata Warehouse

Teradata Database. Introduction to Teradata Warehouse Teradata Database Introduction to Teradata Warehouse Release 12.0 B035-1091-067A March 2010 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Database. Introduction to Teradata

Teradata Database. Introduction to Teradata Teradata Database Introduction to Teradata Release 13.0 B035-1091-098A March 2010 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata Database. Introduction to Teradata

Teradata Database. Introduction to Teradata Teradata Database Introduction to Teradata Release 13.10 B035-1091-109A August 2010 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata,

More information

Teradata SQL Assistant for Microsoft Windows. User Guide

Teradata SQL Assistant for Microsoft Windows. User Guide Teradata SQL Assistant for Microsoft Windows User Guide Release 14.01 B035-2430-032A March 2012 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Open Distribution for Hadoop 1.3.2. Release Definition

Teradata Open Distribution for Hadoop 1.3.2. Release Definition Teradata Open Distribution for Hadoop 1.3.2 Release Definition Release 1.3.2 B035-5552-113C November 2013 The product or products described in this book are licensed products of Teradata Corporation or

More information

Teradata SQL Assistant for Microsoft Windows. User Guide

Teradata SQL Assistant for Microsoft Windows. User Guide Teradata SQL Assistant for Microsoft Windows User Guide Release 14.10 B035-2430-082K February 2013 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Aster Express Getting Started Guide

Aster Express Getting Started Guide Aster Express Getting Started Guide Release Number 6.00 Product ID: B700-6050-600K April 2014 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

Teradata Alerts Installation, Configuration, and Upgrade Guide Release 14.10 B035-2211-053K May 2013

Teradata Alerts Installation, Configuration, and Upgrade Guide Release 14.10 B035-2211-053K May 2013 Teradata Alerts Installation, Configuration, and Upgrade Guide Release 14.10 B035-2211-053K May 2013 The product or products described in this book are licensed products of Teradata Corporation or its

More information

How To Create A Table In Sql 2.5.2.2 (Ahem)

How To Create A Table In Sql 2.5.2.2 (Ahem) Database Systems Unit 5 Database Implementation: SQL Data Definition Language Learning Goals In this unit you will learn how to transfer a logical data model into a physical database, how to extend or

More information

Using SQL Server Management Studio

Using SQL Server Management Studio Using SQL Server Management Studio Microsoft SQL Server Management Studio 2005 is a graphical tool for database designer or programmer. With SQL Server Management Studio 2005 you can: Create databases

More information

ERserver. DB2 Universal Database for iseries SQL Programming with Host Languages. iseries. Version 5

ERserver. DB2 Universal Database for iseries SQL Programming with Host Languages. iseries. Version 5 ERserver iseries DB2 Universal Database for iseries SQL Programming with Host Languages Version 5 ERserver iseries DB2 Universal Database for iseries SQL Programming with Host Languages Version 5 Copyright

More information

DB2 Database Demonstration Program Version 9.7 Installation and Quick Reference Guide

DB2 Database Demonstration Program Version 9.7 Installation and Quick Reference Guide DB2 Database Demonstration Program Version 9.7 Installation and Quick Reference Guide George Baklarz DB2 Worldwide Technical Sales Support IBM Toronto Laboratory DB2 Demonstration Program Version 9.7 Usage

More information

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement

More information

Migrating Non-Oracle Databases and their Applications to Oracle Database 12c O R A C L E W H I T E P A P E R D E C E M B E R 2 0 1 4

Migrating Non-Oracle Databases and their Applications to Oracle Database 12c O R A C L E W H I T E P A P E R D E C E M B E R 2 0 1 4 Migrating Non-Oracle Databases and their Applications to Oracle Database 12c O R A C L E W H I T E P A P E R D E C E M B E R 2 0 1 4 1. Introduction Oracle provides products that reduce the time, risk,

More information

Teradata Viewpoint. Configuration Guide

Teradata Viewpoint. Configuration Guide Teradata Viewpoint Configuration Guide Release 13.0.1 B035-2207-059A May 2009 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, BYNET,

More information

SQL Server An Overview

SQL Server An Overview SQL Server An Overview SQL Server Microsoft SQL Server is designed to work effectively in a number of environments: As a two-tier or multi-tier client/server database system As a desktop database system

More information

Aster SQL and Function Reference

Aster SQL and Function Reference Teradata Aster MapReduce Appliance 2 Database SQL and Function Reference Version 4.6.2 December 14, 2011 Updated versions of this guide: http://tays.teradata.com Contents Preface... V--v Conventions Used

More information

MS ACCESS DATABASE DATA TYPES

MS ACCESS DATABASE DATA TYPES MS ACCESS DATABASE DATA TYPES Data Type Use For Size Text Memo Number Text or combinations of text and numbers, such as addresses. Also numbers that do not require calculations, such as phone numbers,

More information

Data Transfer Tips and Techniques

Data Transfer Tips and Techniques Agenda Key: Session Number: System i Access for Windows: Data Transfer Tips and Techniques 8 Copyright IBM Corporation, 2008. All Rights Reserved. This publication may refer to products that are not currently

More information

Teradata Data Warehouse Appliance. 2650 Platform. Customer Guide for Hardware Replacement

Teradata Data Warehouse Appliance. 2650 Platform. Customer Guide for Hardware Replacement Teradata Data Warehouse Appliance 2650 Platform Customer Guide for Hardware Replacement B035-5437-080K September 2011 The product or products described in this book are licensed products of Teradata Corporation

More information

Appliance Backup Utility Installation and User Guide Release 14.00 B035-3134-121A December 2011

Appliance Backup Utility Installation and User Guide Release 14.00 B035-3134-121A December 2011 Appliance Backup Utility Installation and User Guide Release 14.00 B035-3134-121A December 2011 The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

More information

4 Simple Database Features

4 Simple Database Features 4 Simple Database Features Now we come to the largest use of iseries Navigator for programmers the Databases function. IBM is no longer developing DDS (Data Description Specifications) for database definition,

More information

Advanced SQL. Jim Mason. www.ebt-now.com Web solutions for iseries engineer, build, deploy, support, train 508-728-4353. jemason@ebt-now.

Advanced SQL. Jim Mason. www.ebt-now.com Web solutions for iseries engineer, build, deploy, support, train 508-728-4353. jemason@ebt-now. Advanced SQL Jim Mason jemason@ebt-now.com www.ebt-now.com Web solutions for iseries engineer, build, deploy, support, train 508-728-4353 What We ll Cover SQL and Database environments Managing Database

More information

Connectivity Pack for Microsoft Guide

Connectivity Pack for Microsoft Guide HP Vertica Analytic Database Software Version: 7.0.x Document Release Date: 2/20/2015 Legal Notices Warranty The only warranties for HP products and services are set forth in the express warranty statements

More information

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T) Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating

More information

Working with DB2 UDB objects

Working with DB2 UDB objects Working with DB2 UDB objects http://www7b.software.ibm.com/dmdd/ Table of Contents If you're viewing this document online, you can click any of the topics below to link directly to that section. 1. Introduction...

More information

Oracle Database 12c: Introduction to SQL Ed 1.1

Oracle Database 12c: Introduction to SQL Ed 1.1 Oracle University Contact Us: 1.800.529.0165 Oracle Database 12c: Introduction to SQL Ed 1.1 Duration: 5 Days What you will learn This Oracle Database: Introduction to SQL training helps you write subqueries,

More information

An Oracle White Paper June 2013. Migrating Applications and Databases with Oracle Database 12c

An Oracle White Paper June 2013. Migrating Applications and Databases with Oracle Database 12c An Oracle White Paper June 2013 Migrating Applications and Databases with Oracle Database 12c Disclaimer The following is intended to outline our general product direction. It is intended for information

More information

Symantec Data Center Security: Server Advanced v6.0. Agent Guide

Symantec Data Center Security: Server Advanced v6.0. Agent Guide Symantec Data Center Security: Server Advanced v6.0 Agent Guide Symantec Data Center Security: Server Advanced Agent Guide The software described in this book is furnished under a license agreement and

More information

A Joint Oracle Teradata White Paper March 2012. Configuring Oracle Business Intelligence Enterprise Edition for Teradata Temporal Tables

A Joint Oracle Teradata White Paper March 2012. Configuring Oracle Business Intelligence Enterprise Edition for Teradata Temporal Tables A Joint Oracle Teradata White Paper March 2012 Configuring Oracle Business Intelligence Enterprise Edition for Teradata Temporal Tables Executive Overview... 2 Introduction... 2 As-is and As-was Example...

More information

A Brief Introduction to MySQL

A Brief Introduction to MySQL A Brief Introduction to MySQL by Derek Schuurman Introduction to Databases A database is a structured collection of logically related data. One common type of database is the relational database, a term

More information

Choosing a Data Model for Your Database

Choosing a Data Model for Your Database In This Chapter This chapter describes several issues that a database administrator (DBA) must understand to effectively plan for a database. It discusses the following topics: Choosing a data model for

More information

1 Changes in this release

1 Changes in this release Oracle SQL Developer Oracle TimesTen In-Memory Database Support Release Notes Release 4.0 E39883-01 June 2013 This document provides late-breaking information as well as information that is not yet part

More information

CSC 443 Data Base Management Systems. Basic SQL

CSC 443 Data Base Management Systems. Basic SQL CSC 443 Data Base Management Systems Lecture 6 SQL As A Data Definition Language Basic SQL SQL language Considered one of the major reasons for the commercial success of relational databases SQL Structured

More information

Teradata SQL Assistant Version 13.0 (.Net) Enhancements and Differences. Mike Dempsey

Teradata SQL Assistant Version 13.0 (.Net) Enhancements and Differences. Mike Dempsey Teradata SQL Assistant Version 13.0 (.Net) Enhancements and Differences by Mike Dempsey Overview SQL Assistant 13.0 is an entirely new application that has been re-designed from the ground up. It has been

More information

DB2 Database Demonstration Program Version 10.5 Installation and Quick Reference Guide

DB2 Database Demonstration Program Version 10.5 Installation and Quick Reference Guide DB2 Database Demonstration Program Version 10.5 Installation and Quick Reference Guide George Baklarz, PhD Worldwide DB2 Technical Sales Support IBM Toronto Laboratory DB2 Demonstration Program Version

More information

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Oracle University Contact Us: 1.800.529.0165 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This course is designed to deliver the fundamentals of SQL and PL/SQL along

More information

CA Nimsoft Monitor. Probe Guide for NT Event Log Monitor. ntevl v3.8 series

CA Nimsoft Monitor. Probe Guide for NT Event Log Monitor. ntevl v3.8 series CA Nimsoft Monitor Probe Guide for NT Event Log Monitor ntevl v3.8 series Legal Notices Copyright 2013, CA. All rights reserved. Warranty The material contained in this document is provided "as is," and

More information

Embedded SQL programming

Embedded SQL programming Embedded SQL programming http://www-136.ibm.com/developerworks/db2 Table of contents If you're viewing this document online, you can click any of the topics below to link directly to that section. 1. Before

More information

Teradata Tools and Utilities for Microsoft Windows Installation Guide Release 14.10 B035-2407-082K March 2013

Teradata Tools and Utilities for Microsoft Windows Installation Guide Release 14.10 B035-2407-082K March 2013 Teradata Tools and Utilities for Microsoft Windows Installation Guide Release 14.10 B035-2407-082K March 2013 The product or products described in this book are licensed products of Teradata Corporation

More information

IT2305 Database Systems I (Compulsory)

IT2305 Database Systems I (Compulsory) Database Systems I (Compulsory) INTRODUCTION This is one of the 4 modules designed for Semester 2 of Bachelor of Information Technology Degree program. CREDITS: 04 LEARNING OUTCOMES On completion of this

More information

An Oracle White Paper June 2014. RESTful Web Services for the Oracle Database Cloud - Multitenant Edition

An Oracle White Paper June 2014. RESTful Web Services for the Oracle Database Cloud - Multitenant Edition An Oracle White Paper June 2014 RESTful Web Services for the Oracle Database Cloud - Multitenant Edition 1 Table of Contents Introduction to RESTful Web Services... 3 Architecture of Oracle Database Cloud

More information

.NET Standard DateTime Format Strings

.NET Standard DateTime Format Strings .NET Standard DateTime Format Strings Specifier Name Description d Short date pattern Represents a custom DateTime format string defined by the current ShortDatePattern property. D Long date pattern Represents

More information

2874CD1EssentialSQL.qxd 6/25/01 3:06 PM Page 1 Essential SQL Copyright 2001 SYBEX, Inc., Alameda, CA www.sybex.com

2874CD1EssentialSQL.qxd 6/25/01 3:06 PM Page 1 Essential SQL Copyright 2001 SYBEX, Inc., Alameda, CA www.sybex.com Essential SQL 2 Essential SQL This bonus chapter is provided with Mastering Delphi 6. It is a basic introduction to SQL to accompany Chapter 14, Client/Server Programming. RDBMS packages are generally

More information

Once the schema has been designed, it can be implemented in the RDBMS.

Once the schema has been designed, it can be implemented in the RDBMS. 2. Creating a database Designing the database schema... 1 Representing Classes, Attributes and Objects... 2 Data types... 5 Additional constraints... 6 Choosing the right fields... 7 Implementing a table

More information

Release Notes. IBM Tivoli Identity Manager Oracle Database Adapter. Version 5.0.1. First Edition (December 7, 2007)

Release Notes. IBM Tivoli Identity Manager Oracle Database Adapter. Version 5.0.1. First Edition (December 7, 2007) IBM Tivoli Identity Manager Version 5.0.1 First Edition (December 7, 2007) This edition applies to version 5.0 of Tivoli Identity Manager and to all subsequent releases and modifications until otherwise

More information

Guide to SQL Programming: SQL:1999 and Oracle Rdb V7.1

Guide to SQL Programming: SQL:1999 and Oracle Rdb V7.1 Guide to SQL Programming: SQL:1999 and Oracle Rdb V7.1 A feature of Oracle Rdb By Ian Smith Oracle Rdb Relational Technology Group Oracle Corporation 1 Oracle Rdb Journal SQL:1999 and Oracle Rdb V7.1 The

More information

PeopleSoft Customer Relationship Management 9.1 Hardware and Software Requirements Guide

PeopleSoft Customer Relationship Management 9.1 Hardware and Software Requirements Guide PeopleSoft Customer Relationship Management 9.1 Hardware and Software Requirements Guide June 2012 PeopleSoft Customer Relationship Management 9.1 Hardware and Software Requirements Guide SKU crm91hwsw

More information

Oracle Database 10g Express

Oracle Database 10g Express Oracle Database 10g Express This tutorial prepares the Oracle Database 10g Express Edition Developer to perform common development and administrative tasks of Oracle Database 10g Express Edition. Objectives

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle University Contact Us: + 38516306373 Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training delivers the

More information

Oracle Database 10g: Introduction to SQL

Oracle Database 10g: Introduction to SQL Oracle University Contact Us: 1.800.529.0165 Oracle Database 10g: Introduction to SQL Duration: 5 Days What you will learn This course offers students an introduction to Oracle Database 10g database technology.

More information

sqlite driver manual

sqlite driver manual sqlite driver manual A libdbi driver using the SQLite embedded database engine Markus Hoenicka mhoenicka@users.sourceforge.net sqlite driver manual: A libdbi driver using the SQLite embedded database engine

More information

Financial Data Access with SQL, Excel & VBA

Financial Data Access with SQL, Excel & VBA Computational Finance and Risk Management Financial Data Access with SQL, Excel & VBA Guy Yollin Instructor, Applied Mathematics University of Washington Guy Yollin (Copyright 2012) Data Access with SQL,

More information

IBM Lotus Enterprise Integrator (LEI) for Domino. Version 8.5.2. August 17, 2010

IBM Lotus Enterprise Integrator (LEI) for Domino. Version 8.5.2. August 17, 2010 IBM Lotus Enterprise Integrator (LEI) for Domino Version 8.5.2 August 17, 2010 A) What's new in LEI V8.5.2 B) System requirements C) Installation considerations D) Operational considerations E) What's

More information

How to Configure Access Control for Exchange using PowerShell Cmdlets A Step-by-Step guide

How to Configure Access Control for Exchange using PowerShell Cmdlets A Step-by-Step guide SAP How-to Guide Mobile Device Management SAP Afaria How to Configure Access Control for Exchange using PowerShell Cmdlets A Step-by-Step guide Applicable Releases: SAP Afaria 7 SP3 HotFix 06, SAP Afaria

More information

Microsoft SQL Server Connector for Apache Hadoop Version 1.0. User Guide

Microsoft SQL Server Connector for Apache Hadoop Version 1.0. User Guide Microsoft SQL Server Connector for Apache Hadoop Version 1.0 User Guide October 3, 2011 Contents Legal Notice... 3 Introduction... 4 What is SQL Server-Hadoop Connector?... 4 What is Sqoop?... 4 Supported

More information

CA Workload Automation Agent for Databases

CA Workload Automation Agent for Databases CA Workload Automation Agent for Databases Implementation Guide r11.3.4 This Documentation, which includes embedded help systems and electronically distributed materials, (hereinafter referred to as the

More information

2/3/04 Doc 7 SQL Part 1 slide # 1

2/3/04 Doc 7 SQL Part 1 slide # 1 2/3/04 Doc 7 SQL Part 1 slide # 1 CS 580 Client-Server Programming Spring Semester, 2004 Doc 7 SQL Part 1 Contents Database... 2 Types of Databases... 6 Relational, Object-Oriented Databases and SQL...

More information

RNDr. Michal Kopecký, Ph.D. Department of Software Engineering, Faculty of Mathematics and Physics, Charles University in Prague

RNDr. Michal Kopecký, Ph.D. Department of Software Engineering, Faculty of Mathematics and Physics, Charles University in Prague course: Database Applications (NDBI026) WS2015/16 RNDr. Michal Kopecký, Ph.D. Department of Software Engineering, Faculty of Mathematics and Physics, Charles University in Prague student duties final DB

More information

JP1/IT Desktop Management 2 - Agent (For UNIX Systems)

JP1/IT Desktop Management 2 - Agent (For UNIX Systems) JP1 Version 11 JP1/IT Desktop Management 2 - Agent (For UNIX Systems) 3021-3-B62(E) Notices Relevant program products JP1/IT Desktop Management 2 - Additional License for Linux P-8142-7GBL JP1/IT Desktop

More information

3.GETTING STARTED WITH ORACLE8i

3.GETTING STARTED WITH ORACLE8i Oracle For Beginners Page : 1 3.GETTING STARTED WITH ORACLE8i Creating a table Datatypes Displaying table definition using DESCRIBE Inserting rows into a table Selecting rows from a table Editing SQL buffer

More information

SQL. Short introduction

SQL. Short introduction SQL Short introduction 1 Overview SQL, which stands for Structured Query Language, is used to communicate with a database. Through SQL one can create, manipulate, query and delete tables and contents.

More information

RealShot Manager Compression Server software

RealShot Manager Compression Server software RealShot Manager Compression Server software User Guide Software Version 1.0 RealShot Manager 2004 Sony Corporation Copyright Notice 2004 Sony Corporation. All rights reserved. This manual may not be reproduced,

More information

Active Directory Synchronization with Lotus ADSync

Active Directory Synchronization with Lotus ADSync Redbooks Paper Active Directory Synchronization with Lotus ADSync Billy Boykin Tommi Tulisalo The Active Directory Synchronization tool, or ADSync, allows Active Directory administrators to manage (register,

More information

Siebel Installation Guide for Microsoft Windows. Siebel Innovation Pack 2013 Version 8.1/8.2, Rev. A April 2014

Siebel Installation Guide for Microsoft Windows. Siebel Innovation Pack 2013 Version 8.1/8.2, Rev. A April 2014 Siebel Installation Guide for Microsoft Windows Siebel Innovation Pack 2013 Version 8.1/8.2, Rev. A April 2014 Copyright 2005, 2014 Oracle and/or its affiliates. All rights reserved. This software and

More information

Firebird. Embedded SQL Guide for RM/Cobol

Firebird. Embedded SQL Guide for RM/Cobol Firebird Embedded SQL Guide for RM/Cobol Embedded SQL Guide for RM/Cobol 3 Table of Contents 1. Program Structure...6 1.1. General...6 1.2. Reading this Guide...6 1.3. Definition of Terms...6 1.4. Declaring

More information

Field Properties Quick Reference

Field Properties Quick Reference Field Properties Quick Reference Data types The following table provides a list of the available data types in Microsoft Office Access 2007, along with usage guidelines and storage capacities for each

More information

Database Migration from MySQL to RDM Server

Database Migration from MySQL to RDM Server MIGRATION GUIDE Database Migration from MySQL to RDM Server A Birdstep Technology, Inc. Raima Embedded Database Division Migration Guide Published: May, 2009 Author: Daigoro F. Toyama Senior Software Engineer

More information

Number Representation

Number Representation Number Representation CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Topics to be Discussed How are numeric data

More information

Release Bulletin Sybase ETL Small Business Edition 4.2

Release Bulletin Sybase ETL Small Business Edition 4.2 Release Bulletin Sybase ETL Small Business Edition 4.2 Document ID: DC00737-01-0420-02 Last revised: November 16, 2007 Topic Page 1. Accessing current release bulletin information 2 2. Product summary

More information

Progress Embedded SQL-92 Guide and Reference

Progress Embedded SQL-92 Guide and Reference Progress Embedded SQL-92 Guide and Reference 2001 Progress Software Corporation. All rights reserved. Progress software products are copyrighted and all rights are reserved by Progress Software Corporation.

More information

ORACLE GOLDENGATE BIG DATA ADAPTER FOR HIVE

ORACLE GOLDENGATE BIG DATA ADAPTER FOR HIVE ORACLE GOLDENGATE BIG DATA ADAPTER FOR HIVE Version 1.0 Oracle Corporation i Table of Contents TABLE OF CONTENTS... 2 1. INTRODUCTION... 3 1.1. FUNCTIONALITY... 3 1.2. SUPPORTED OPERATIONS... 4 1.3. UNSUPPORTED

More information

Teach Yourself InterBase

Teach Yourself InterBase Teach Yourself InterBase This tutorial takes you step-by-step through the process of creating and using a database using the InterBase Windows ISQL dialog. You learn to create data structures that enforce

More information

Programming with SQL

Programming with SQL Unit 43: Programming with SQL Learning Outcomes A candidate following a programme of learning leading to this unit will be able to: Create queries to retrieve information from relational databases using

More information

Oracle Migration Workbench

Oracle Migration Workbench Oracle Migration Workbench Reference Guide for SQL Server and Sybase Adaptive Server Migrations Release 9.2.0 for Microsoft Windows 98/2000/NT and Microsoft Windows XP September 2002 Part Number: B10254-01

More information

Oracle Database: Introduction to SQL

Oracle Database: Introduction to SQL Oracle University Contact Us: +381 11 2016811 Oracle Database: Introduction to SQL Duration: 5 Days What you will learn Understanding the basic concepts of relational databases ensure refined code by developers.

More information

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Oracle University Contact Us: +966 12 739 894 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training is designed to

More information

Ascential DataStage. Oracle OCI Load Stage Guide. Version 1.0

Ascential DataStage. Oracle OCI Load Stage Guide. Version 1.0 Ascential DataStage Oracle OCI Load Stage Guide Version 1.0 Part No. 74-0141 December 2004 This document, and the software described or referenced in it, are confidential and proprietary to Ascential Software

More information

Mini User's Guide for SQL*Plus T. J. Teorey

Mini User's Guide for SQL*Plus T. J. Teorey Mini User's Guide for SQL*Plus T. J. Teorey Table of Contents Oracle/logging-in 1 Nested subqueries 5 SQL create table/naming rules 2 Complex functions 6 Update commands 3 Save a query/perm table 6 Select

More information

Introduction to PL/SQL Programming

Introduction to PL/SQL Programming Introduction to PL/SQL Programming Introduction to PL/SQL Programming i-ii Introduction to PL/SQL Programming 1997-2001 Technology Framers, LLC Introduction to PL/SQL Programming This publication is protected

More information

Symantec Critical System Protection 5.2.9 Agent Guide

Symantec Critical System Protection 5.2.9 Agent Guide Symantec Critical System Protection 5.2.9 Agent Guide Symantec Critical System Protection Agent Guide The software described in this book is furnished under a license agreement and may be used only in

More information

Nimsoft Monitor. ntevl Guide. v3.6 series

Nimsoft Monitor. ntevl Guide. v3.6 series Nimsoft Monitor ntevl Guide v3.6 series Legal Notices Copyright 2012, CA. All rights reserved. Warranty The material contained in this document is provided "as is," and is subject to being changed, without

More information

Schema Evolution in SQL-99 and Commercial (Object-)Relational DBMS

Schema Evolution in SQL-99 and Commercial (Object-)Relational DBMS Schema Evolution in SQL-99 and Commercial (Object-)Relational DBMS Can Türker Swiss Federal Institute of Technology (ETH) Zurich Institute of Information Systems, ETH Zentrum CH 8092 Zurich, Switzerland

More information

Symantec Mobile Management for Configuration Manager

Symantec Mobile Management for Configuration Manager Symantec Mobile Management for Configuration Manager Replication Services Installation Guide 7.5 Symantec Mobile Management for Configuration Manager: Replication Services Installation Guide The software

More information

Oracle Database: Introduction to SQL

Oracle Database: Introduction to SQL Oracle University Contact Us: 1.800.529.0165 Oracle Database: Introduction to SQL Duration: 5 Days What you will learn View a newer version of this course This Oracle Database: Introduction to SQL training

More information

Microsoft Dynamics GP. SmartList Builder User s Guide With Excel Report Builder

Microsoft Dynamics GP. SmartList Builder User s Guide With Excel Report Builder Microsoft Dynamics GP SmartList Builder User s Guide With Excel Report Builder Copyright Copyright 2008 Microsoft Corporation. All rights reserved. Complying with all applicable copyright laws is the responsibility

More information