[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sql-odbc: accessing row elements by column name?
Hi Carl,
I extended our SQL-ODBC library to be able to lookup by column names a
while back, it is still only in our development sources. I also created an
example database viewer using DUIM that used this functionality. At the
time, we discussed a suggestion of mine internally about modeling the
<result-set> as a new kind of collection that obeyed the table and forward
iteration protocols, so you could use it in either way. We created a patch
for a different customer that I think had this functionality in it, so I'll
see if I can dig that up for you.
I think it would be a good idea to come up with a Java-like Open Source
library for Dylan (DDBC?). Ideally we'd use the DUIM model of an abstract
API with multiple backend implementation. Anyone interested in working
together to come up with a design for this?
Thanks,
Andy
P.S. I don't imagine there'd be a problem with distributing the Dylan
SQL-ODBC source code, I'll check into that possibility.
Carl Gay
<carlgay@attb To: info-dylan@ai.mit.edu
i.com> cc:
Sent by: Subject: sql-odbc: accessing row elements by column name?
"Gregory T.
Sullivan"
<gregs@ai.mit
.edu>
09/07/2002
08:00 PM
I've been playing around with FunDev's SQL-ODBC library and I don't
see any way to access row elements by column name. It seems the
returned <result-set> is a collection whos elements are vectors and
you have to index directly into the row vector. It seems to me this
requires that I build into my program the knowledge of what order
the columns are in. (Plus it requires that either I don't ever
"select * ..." or that the database will guarantee that the order
in the "create table" statement is the order in which the columns
are returned in each row. I don't know enough about DBMS's to
know if that's always true.) I like JDBC's ability to access
row elements by name. Is there any way to do that in the SQL-ODBC
library?