library: libCore
#include "TSQLColumnInfo.h"

TSQLColumnInfo


class description - header file - source file - inheritance tree (.pdf)

class TSQLColumnInfo : public TNamed

Inheritance Chart:
TObject
<-
TNamed
<-
TSQLColumnInfo

    public:
TSQLColumnInfo() TSQLColumnInfo(const char* columnname, const char* sqltypename = "unknown", Bool_t nullable = kFALSE, Int_t sqltype = -1, Int_t size = -1, Int_t length = -1, Int_t scale = -1, Int_t sign = -1) TSQLColumnInfo(const TSQLColumnInfo&) virtual ~TSQLColumnInfo() static TClass* Class() Int_t GetLength() const Int_t GetScale() const Int_t GetSigned() const Int_t GetSize() const Int_t GetSQLType() const const char* GetTypeName() const virtual TClass* IsA() const Bool_t IsNullable() const Bool_t IsSigned() const Bool_t IsUnsigned() const TSQLColumnInfo& operator=(const TSQLColumnInfo&) virtual void Print(Option_t* option = "") const virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members


    protected:
TString fTypeName ! sql type name, as reported by DB. Should be as much as close to declaration of column in CREATE TABLE query Int_t fSQLType ! datatype code (see TSQLServer::ESQLDataTypes constants), -1 if not defeined Int_t fSize ! size of column in bytes, -1 if not defing Int_t fLength ! datatype length definition, for instance VARCHAR(len) or FLOAT(len), -1 if not defined Int_t fScale ! datatype scale factor, used for instance in NUMBER(len,scale) definition. -1 if not defined Int_t fSigned ! if datatype signed or not, 0 - kFALSE, 1 - kTRUE, -1 - unknown Bool_t fNullable ! identify if value can be NULL

Class Description


 TSQLColumnInfo

 Contains information about single column from SQL table
 Has following methods:
   GetTypeName() - field type name in string form as it is reported by correspondent
          database method. Some databases providing full type name like "numeric(20)",
          other showing only "NUMERIC". As a result, one cannot use this string directly
          to create new field of similar types in other table
   IsNullable() - says if field value can be NULL or not
   GetSQLType() - returns kind of sql type. Possible values:
      TSQLServer::kSQL_NONE        data type unknown
      TSQLServer::kSQL_CHAR        CHAR(n) - string with fixed length n
      TSQLServer::kSQL_VARCHAR     VARCHAR(n) - string with variable length upto n
      TSQLServer::kSQL_INTEGER     INTEGER, INT, TINYINT - any integer types
      TSQLServer::kSQL_FLOAT       FLOAT - float value
      TSQLServer::kSQL_DOUBLE      DOUBLE - double precision value
      TSQLServer::kSQL_NUMERIC     NUMERIC(n,s), NUMBER(n,s) - numeric values with length and precion
      TSQLServer::kSQL_BINARY      BLOB, VARBINARY  - binary data (vriable or fixed size)
      TSQLServer::kSQL_TIMESTAMP   TIMESTAMP - time and date stamp
   GetSize() - size of field in database. -1 if not known.
   GetLength() - length argument in type declaration like CHAR(len) or NUMERIC(len), -1 if not defined
   GetScale() - second argument in declarations like NUMERIC(len, s), -1 if not defined
   GetSigned() - is type signed(==1) or unsigned(==0), -1 if not defined


TSQLColumnInfo()
 default contructor
TSQLColumnInfo(const char* columnname, const char* sqltypename, Bool_t nullable, Int_t sqltype, Int_t size, Int_t length, Int_t scale, Int_t sign)
 normal constructor
void Print(Option_t*)
 Prints column information to standard output
TSQLColumnInfo()
virtual ~TSQLColumnInfo()
const char* GetTypeName()
Bool_t IsNullable()
Int_t GetSQLType()
Int_t GetSize()
Int_t GetLength()
Int_t GetScale()
Int_t GetSigned()
Bool_t IsSigned()
Bool_t IsUnsigned()

Author: Sergey Linev 31/05/2006
Last update: root/net:$Name: $:$Id: TSQLColumnInfo.cxx,v 1.1 2006/06/02 14:02:03 brun Exp $
Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.