Interested in improving this site? Please check the To Do page.
sqlite.getColumnName
Retrieve the name of a column
Syntax
sqlite.getColumnName(queryID, columnNumber)
Params
queryID is the query ID returned by sqlite.compileQuery. columnNumber is the number of the column.
Returns
A string containing the name of the column
Examples
compiledQuery = sqlite.compileQuery(db, "select * from cities");
result = sqlite.stepQuery(compiledQuery);
columnCount = sqlite.getColumnCount(compiledQuery);
dialog.alert(columnCount);
for i = 1 to columnCount {
result = sqlite.getColumn(compiledQuery, i);
columnName = sqlite.getColumnName(compiledQuery, i);
columnType = sqlite.getColumnType(compiledQuery, i);
dialog.alert(i + ": name=" + columnName + " type=" + columnType);
Notes
Remember that the first column is 1 in the Frontier routine sqlite.getColumnName but is a 0 in the original SQLite sqlite3_column_name function.