Page 1 of 1

revDatabaseColumnNames and AltSqlite3

Posted: Wed Mar 28, 2007 2:07 pm
by rolandw
Has anyone succeeded in getting this function to work? At the moment following:

Code: Select all

put revQueryDatabase(dbID,theQuery) into tCursor
the following work:

Code: Select all

put revNumberOfRecords(tCursor) into tRecordCount
put revDatabaseColumnCount(tCursor) into tColumnCount
but:

Code: Select all

put revDatabaseColumnNames(tCursor) in tColumns
returns an error "Handler:can't find handler"

I'm trying to identify the names of the columns being returned and of course, this command is vital.

Anyone else got any bright ideas for obtaining the correct column names regardless of what someone puts in as a query from AltSqlite3?

Posted: Wed Mar 28, 2007 3:46 pm
by Mark
Hi Roland,

Apparently, something went wrong when the Rev engine was compiled and the revDatabaseColumnnames function was not included.

You can use revdb_columnnames instead.

Best regards,

Mark

Posted: Wed Mar 28, 2007 4:23 pm
by rolandw
Hi Mark,

Thanks for that but I think that revdb_columnnames got missed at compile as well! I get the same error!


Roland

Posted: Wed Mar 28, 2007 4:57 pm
by Mark
Hi Roland,

Here it works, but if you can't get it to work, use the SQL command DESCRIBE:

put revDataFromQuery(tab,return,theID,"describe" && theTabe & ";") into myColumns


theID is a number and theTable is a table name. You might want to check a SQL manual for DESCRIBE.

Best,

Mark

Posted: Wed Mar 28, 2007 5:31 pm
by rolandw
Hi Mark,

Thanks again but that's the wrong answer in this issue. "Describe Table XXX" would privde a full description of table XXX regardless of the query. What I am trying to get is the names of the columns in the current cursor as a result of a select statement. OK, I should know this (because I wrote the select statement) but I am assuming that my user has written the statement, that I don't know what it is but that I need it in order to parse the rows returned.

Equally unfortunately SQLite doesn't support "Describe".

There is a way to get SQLite to return the column names by running a different execute call but unless I wan't to recompile the rev db engine to get it to work, I don't think that this is going to happen...

Roland