Reads part of a text or image value from SQL Server.
DBINT dbreadtext (
PDBPROCESS dbproc,
LPVOID buf,
DBINT bufsize );
where
Returns | Description |
---|---|
>0 | The number of bytes put into the caller's buffer. |
0 | The end of a row. |
-1 | An error. |
NO_MORE_ROWS | All rows read. |
Use dbreadtext instead of dbnextrow to read SQLTEXT and SQLIMAGE values.
This function takes a large SQLTEXT or SQLIMAGE value from SQL Server and breaks it into several smaller chunks. A buffer cannot be larger than 64K although the text or image value can be much larger.
To read successive chunks of the same SQLTEXT or SQLIMAGE value, call dbreadtext until it returns 0 (end of row).
The dbreadtext function processes the results of Transact-SQL queries if those queries return only one column containing either text or image data. The Transact-SQL READTEXT statement returns results of this type.
dbmoretext, dbnextrow, dbwritetext; Bulk-Copy Functions