I think that depending on result of lim as in
z=. sqlgetdata get
lim=. a:{ >{:z NB. last item of first get is data length
may not be reliable, because odbc allows the driver to return SQL_NO_TOTAL
(cannot determine length to be sent) in stead of the actual lengh.
please try if the following works for postgresql+linux or not. Or you may
report it to the developer of postgresql odbc driver in case you suspect that
there is a bug in postgresql odbc driver.
datlong=: 3 : 0"1
sc=. b0 y
get=. sc,SQL_BINARY;(LONGBUF$' ');LONGBUF;,0
rc=. >@{. z=. sqlgetdata get
dat=. ''
whilst. SQL_NO_DATA~: rc=. >@{. z do.
if. sqlbad rc do. SQL_ERROR;'';0 return.
elseif. SQL_NO_DATA= rc do. break.
elseif. SQL_SUCCESS_WITH_INFO= rc do.
dat=. dat , LONGBUF{. >4{z
elseif. SQL_SUCCESS= rc do.
dat=. dat , (0>.>{:z){. >4{z
elseif. do.
SQL_ERROR;'';0 return.
end.
z=. sqlgetdata get
end.
DD_OK ; dat ; #dat
)
--
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm