Ashley Cambrell wrote: > Hi Ashley, it's off-topic. For a simple (readonly db)-driven website I'd prefer to use file catalog based on ROOT I/O. Check how it's done at: http://carrot.cern.ch/index_C.so?demos=InstallPage Regards. Valeriy > Hi ROOTers, > > I am trying to do a comparison between Carrot and PHP, and I'm filling > in some gaps in Root and Carrot from a webdevelopers perspective (only a > conceptually small change! [I know root's main purpose is physics and > not web development]) and I need to know if TTreeRow does, would or > could have any concept of a "field name". > > As a webdeveloper is it best often best (in my view) to use field name > instead of field numbers for sql query returns so you can change the > statement (add an extra column) without ferreting around and changing > row->GetField(1) to row->GetField(2) etc. So.. I've been adding the > ability to do row->GetField("customerid"). I have changed the various > database drivers (mysql, sapdb, pgsql) BUT, I didn't know TTreeRow used > TSQLRow as it's base class. (I soon found out when I tried to compile it) > > What should I do? I don't know /how/ TTreeRow is used so I can't tell if > it's beneficial to add the concept of field names, or should I just make > it return nothing? > > There are actually a couple of functions I have added > > class TSQLRow : public TObject { > > protected: > TSQLRow() { } > > public: > virtual ~TSQLRow() { } > > virtual void Close(Option_t *option="") = 0; > virtual ULong_t GetFieldLength(Int_t field) = 0; > virtual const char *GetField(Int_t field) = 0; > virtual Int_t GetFieldPosition(const char* fieldName) = 0; > virtual const char *GetFieldName(Int_t field) = 0; > const char *GetField(const char* fieldName) { return > GetField(GetFieldPosition(fieldName)); } > const char *operator[](const char* fieldName) { return > GetField(GetFieldPosition(fieldName)); } > const char *operator[](Int_t field) { return GetField(field); } > > ClassDef(TSQLRow,0) // One row of an SQL query result > }; > > Thanks for your help. > > Ashley Cambrell
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:52 MET