Overview of SQL datataypes based on SQL 2003 (as it seems most extensive). "x" in column implies it exists also in other SQL versions, or is anticipated by ADQL. VOTable column gives likely mapping to VOTable data type. a "[(P[,S])]" after a datatypeps indicates that a precision (P) and possibly a scale(S) can be provided.

For info on database support this look at JVO presentation during Victoria 2006 interop. Also various JDBC mapping tables such as this.

In table stick to predefined data types. SQL 2003 and 99 also various user defined types such as ROW etc.

NB complete matching to other versions of SQL etc.

SQL 2003 Sort SQL 92 Sort SQL 99 Sort ADQL 2.0 Sort JDBC type Sort VOTable 1.2 (beta) Sort
CHARACTER [(P)] o o o    
CHAR [(P)] o o o    
CHARACTER VARYING[(P)] o o o    
CHAR VARYING [(P)] o o o    
VARCHAR [(P)] o o o    
CHARACTER LARGE OBJECT [(P)]1 x o x    
CHAR LARGE OBJECT [(P)]1 x o x    
CLOB [(P)]1 x o x    
NATIONAL CHARACTER [(P)] o o o    
NATIONAL CHAR [(P)] o o o    
NCHAR [(P)] o o o    
NATIONAL CHARACTER VARYING[(P)] o o o    
NATIONAL CHAR VARYING [(P)] o o o    
NCHAR VARYING [(P)] o o o    
NATIONAL CHARACTER LARGE OBJECT [(P)]1 x o x    
NCHAR LARGE OBJECT [(P)]1 x o x    
NCLOB [(P)]1 x o x    
BINARY LARGE OBJECT [(P)]1 x o x    
BLOB [(P)]1 x o x    
NUMERIC [(P[,S])] o o o    
DECIMAL [(P[,S])] o o o    
DEC [(P[,S])] o o x    
INTEGER o o o    
INT o o o    
SMALLINT o o o    
BIGINT x x x    
FLOAT [(P)] o o o    
REAL o o o    
DOUBLE PRECISION o o o    
BOOLEAN x o x    
DATE o o o    
TIME [(P)]2 o o o    
TIMESTAMP [(P)]2 o o o    
INTERVAL ... 3 o o o    
x BIT [(P)] o o    
x BIT VARYING [(P)] o o    

1 The syntax for sizes of large objects is actually somewhat different from the "[(P)]" applicable to simpler data types.
2 The syntax for sizes of TIME and TIMESTAMP is actually somewhat different from the "[(P)]" applicable to simpler data types.
3 See the SQL 2003 grammar for precise specification of INTERVAL type.


Topic attachments
I Attachment Action Size Date Who Comment
Texttxt adqltypes.txt manage 13.2 K 2009-03-23 - 07:04 GerardLemson  
Edit | Attach | Print version | History: r6 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 2009-03-23 - GerardLemson
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback