ROOT
6.30.04
Reference Guide
All
Namespaces
Files
Pages
TSQLColumnInfo.h
Go to the documentation of this file.
1
// @(#)root/net:$Id$
2
// Author: Sergey Linev 31/05/2006
3
4
/*************************************************************************
5
* Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
#ifndef ROOT_TSQLColumnInfo
13
#define ROOT_TSQLColumnInfo
14
15
#include "
TNamed.h
"
16
17
class
TSQLColumnInfo :
public
TNamed {
18
19
protected
:
20
// Database specific fields
21
TString fTypeName;
//! sql type name, as reported by DB. Should be as much as close to declaration of column in CREATE TABLE query
22
23
// Database independent fields
24
Int_t fSQLType;
//! datatype code (see TSQLServer::ESQLDataTypes constants), -1 if not defeined
25
Int_t fSize;
//! size of column in bytes, -1 if not defing
26
Int_t fLength;
//! datatype length definition, for instance VARCHAR(len) or FLOAT(len), -1 if not defined
27
Int_t fScale;
//! datatype scale factor, used for instance in NUMBER(len,scale) definition. -1 if not defined
28
Int_t fSigned;
//! if datatype signed or not, 0 - kFALSE, 1 - kTRUE, -1 - unknown
29
Bool_t fNullable;
//! identify if value can be NULL
30
31
public
:
32
TSQLColumnInfo();
33
TSQLColumnInfo(
const
char
* columnname,
34
const
char
* sqltypename =
"unknown"
,
35
Bool_t nullable = kFALSE,
36
Int_t sqltype = -1,
37
Int_t size = -1,
38
Int_t length = -1,
39
Int_t scale = -1,
40
Int_t sign = -1);
41
virtual
~TSQLColumnInfo() {}
42
43
const
char
* GetTypeName()
const
{
return
fTypeName.Data(); }
44
Bool_t IsNullable()
const
{
return
fNullable; }
45
Int_t GetSQLType()
const
{
return
fSQLType; }
46
Int_t GetSize()
const
{
return
fSize; }
47
Int_t GetLength()
const
{
return
fLength; }
48
Int_t GetScale()
const
{
return
fScale; }
49
Int_t GetSigned()
const
{
return
fSigned; }
50
Bool_t IsSigned()
const
{
return
fSigned==1; }
51
Bool_t IsUnsigned()
const
{
return
fSigned==0; }
52
53
virtual
void
Print(Option_t* option =
""
)
const
;
54
55
ClassDef(TSQLColumnInfo, 0)
// Summury information about column from SQL table
56
};
57
58
#endif
TNamed.h
net
net
inc
TSQLColumnInfo.h
Generated on Tue May 5 2020 14:03:12 for ROOT by
1.8.5