From: Jack Tanner

Subject: ODBC: column names, row values

Date: 2003-11-13 16:29

Is there a way of examining a query object to get the columns in it? 
That is, I know I can use dbi:list-all-table-columns to get the column 
names for a given table, but when my query object (from dbi:sql :query 
t) is a join of several tables, I'd like to use a corresponding 
dbi:list-all-query-columns. Is there such a beast?

Also, for the rows returned by dbi:fetch-row, I'd like to parse the row 
by column name. For example, in Visual Basic 6 + ADO, you could do this:

Dim RecordSet As ADODB.RecordSet
Dim s as String
[connect to db via ODBC and bind RecordSet to an SQL query...]
Do Until RecordSet.EOF
	s = RecordSet("FIRST_NAME")
	RecordSet.MoveNext
Loop

That is, if the SQL query you bound to the RecordSet contained a column 
called FIRST_NAME, you could ask the RecordSet for the value of that 
column in the current row, and you could identify the column by name. Is 
there anything like this in ACL?

(If you asked the RecordSet for the value of a column that didn't exist 
in the result set of the SQL query, you'd get an error.)

Thanks,
JT