Hi,
Don’t you have to execute the statement first before you can return anything? i.e.
odbc SQLAllocHandle SQL_HANDLE_STMT $hdbc hstmt
odbc SQLExecDirect $hstmt $sql SQL_NTS
# mapeando campos
odbc SQLNumResultCols $hstmt ColumnCountPtr
for {set x 1} {$x<=$ColumnCountPtr} {incr x} {
set valRes [concat val$x]
odbc SQLBindCol $hstmt $x SQL_C_CHAR $valRes 200 pcbValue1
Regards
Garry