Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
My misunderstanding is coming from the 3 lines that read "retcode = qBindCol(hstmt, 4, "colname", 80)". I guess that I don't understand how they work, and where I should insert "a variable that I name here".
;BINDS A COLUMN IN A RESULT SET TO A VARIABLE THAT YOU NAME HERE retcode = qBindCol(hstmt, 4, "colname", 80) retcode = qBindCol(hstmt, 6, "coltype", 80) retcode = qBindCol(hstmt, 8, "collength", 80) If (retcode != @qSuccess) && (retcode != @qSuccessInfo) Message("qBindCol failed", retcode) Exit Endif columns = "" While @TRUE retcode = qFetch(hstmt) If retcode == @qNoData Then Break If (retcode != @qSuccess) && (retcode != @qSuccessInfo) Message("qFetch failed", retcode) Exit Endif columns = StrCat(columns, colname, @TAB, "(", coltype, ")", @TAB, "[",collength, "]", @LF) EndWhile ;DISPLAY COLUMNS IN THE "SAMPLE" DATA SOURCE Message("Columns in 'SAMPLE'", columns)
Notes: qBindCol "col" parameter must be a value between 1 and 50. The "max-size" parameter should be at least 20; if not, it will be set to 20. If the returned data is larger than "max-size", it will be truncated. The third parameter in the function qBindCol is the WIL variable name (This can be any variable name you choose), that you want to 'hold' the 'binded' information to.
Try running the code in debug mode. You will probably see that retcode equals @qNoData, which possibly means there is simply no data to retrieve:
retcode = qFetch(hstmt) If retcode == @qNoData Then Break~~~~~~~~~~~~~~~~~~~~
Article ID: W12534
Filename: How Does qBindCol Work.txt
File Created: 2017:07:28:12:58:32
Last Updated: 2001:01:09:14:40:36