From: Benjamin F. <ben...@he...> - 2011-09-03 20:23:26
|
Am Samstag, 3. September 2011, um 21:53:46 schrieb Benjamin Franksen: > Am Samstag, 3. September 2011, um 14:32:26 schrieb Benjamin Franksen: > > Am Freitag, 2. September 2011, um 17:09:05 schrieb White, Greg: > > > I'm thinking > > > about the common class we've found, of which returning data from *any* > > > SQL database query is a good example. Until runtime, you don't know the > > > number of rows, nor the number or type of columns that must be > > > returned. > > > > This is the perfect example where you do *not* need heterogenous arrays. > > I have thought some more about this and I understand now what you want to > achieve. This is something where you need dynamic typing, but not > heterogeneous arrays. ...but it might indeed be a case for arrays of arrays, for instance if the database is untyped (like sqlite, where all columns are strings). However, if I have understood things right, it is easy to emulate arrays of arrays on top of pvData by using a structureArray where the structure contains just one array, i.e. structure resultSet string[] columnNames string "id" string "value" structure[] rows structure /* do I need a name here? which one? */ string[] string "398576" string "first value" structure /* do I need a name here? which one? */ string[] string "273465" string "second value" ... (I hope I have got the data specification syntax right; in the examples I have seen there is always a name attached to a structure but I would not know what structure name to use here nor why it would be expected.) Cheers Ben > See ChannelRPC... > > Cheers > Ben > > > Each single SQL query returns a homogeneous array. A generic client that > > wants to support arbitrary SQL queries needs to initiate a new request > > for each new SQL query, of course. The server responds with a > > description of how the result set is structured (i.e. what type the rows > > have). > > > > > Server > > > side code has to dynamically construct the single return structure, > > > composed of either, an array of structures (little used we found), or > > > an array of differently typed arrays. In a full implementation, the > > > leaf node structures, may themselves be structures (that is, one of > > > the db table columns is of structure type). My point is, what's > > > returned was dynamically constructed, and heterogenous. > > > > I don't know what SQL dialect you are using but I have never seen a > > relational database where the result set of a query was not a homogeneous > > array of structures. > > > > Cheers > > Ben > > > > ________________________________ > > > > Helmholtz-Zentrum Berlin für Materialien und Energie GmbH > > > > Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher > > Forschungszentren e.V. > > > > Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. > > Vorsitzende Dr. Beatrix Vierkorn-Rudolph Geschäftsführer: Prof. Dr. Anke > > Rita Kaysser-Pyzalla, Dr. Ulrich Breuer > > > > Sitz Berlin, AG Charlottenburg, 89 HRB 5583 > > > > Postadresse: > > Hahn-Meitner-Platz 1 > > D-14109 Berlin > > > > http://www.helmholtz-berlin.de > > > > ------------------------------------------------------------------------- > > -- --- Special Offer -- Download ArcSight Logger for FREE! > > Finally, a world-class log management solution at an even better > > price-free! And you'll get a free "Love Thy Logs" t-shirt when you > > download Logger. Secure your free ArcSight Logger TODAY! > > http://p.sf.net/sfu/arcsisghtdev2dev > > ________________________________ > > Helmholtz-Zentrum Berlin für Materialien und Energie GmbH > > Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren > e.V. > > Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. > Vorsitzende Dr. Beatrix Vierkorn-Rudolph Geschäftsführer: Prof. Dr. Anke > Rita Kaysser-Pyzalla, Dr. Ulrich Breuer > > Sitz Berlin, AG Charlottenburg, 89 HRB 5583 > > Postadresse: > Hahn-Meitner-Platz 1 > D-14109 Berlin > > http://www.helmholtz-berlin.de > > --------------------------------------------------------------------------- > --- Special Offer -- Download ArcSight Logger for FREE! > Finally, a world-class log management solution at an even better > price-free! And you'll get a free "Love Thy Logs" t-shirt when you > download Logger. Secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsisghtdev2dev ________________________________ Helmholtz-Zentrum Berlin für Materialien und Energie GmbH Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V. Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph Geschäftsführer: Prof. Dr. Anke Rita Kaysser-Pyzalla, Dr. Ulrich Breuer Sitz Berlin, AG Charlottenburg, 89 HRB 5583 Postadresse: Hahn-Meitner-Platz 1 D-14109 Berlin http://www.helmholtz-berlin.de |