BLOB SIZE()

From Lianjapedia
Revision as of 06:44, 11 April 2013 by Yvonne.milne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PURPOSE

Return the size of a blob

SYNONYM

api_blob_size()

SYNOPSIS

#include "lianja_api.h"
 
int	BLOB_SIZE(fldname)
 
<input parameters>
char	*fldname;	/* Address of a buffer containing a blob field name	*/
 
<output parameters>
none

DESCRIPTION

The BLOB_SIZE() function will return the number of bytes the blob occupies in the memo file for the specified field in the current record.

It will return -1 if the blob field is empty on the current record.

EXAMPLE

The following example will return the size of a blob field specified as the first parameter for the current record of the database.

#include "lianja_api.h"
 
lianjaapi_blob_size()
{
    int	rc;
 
    if (_parinfo(1) == API_CTYPE) {
       rc = BLOB_SIZE( _parc(1) );
    } else {
       rc = -1;
    }
 
    _retni( rc );
}

SEE ALSO

BLOB_READ(), BLOB_RECLAIM(), BLOB_UPDATE(), BLOB_WRITE()