Binary large objects  clr()

Chapter 5: General Objects and Methods

add()

Description

Appends data in an item to a blob.

Syntax

add(string item);
add(string &item);
add(blob &item);

Parameter

Description

item or &item

Data (or the address of the data) to append to the current blob. Can be the address of a blob or a string, the string itself, or a literal value.

Return value

If successful, returns a blob containing the existing and appended data. If failed, returns a blob containing the existing data before the blob() method was called.

Examples

Example 41

blob my_blob; //current blob object
string new_stuff; //string to hold data to append
my_blob = “a bunch of data”;
new_stuff = “append this stuff”;
my_blob.add(new_stuff); //appends data in new_stuff to my_blob

Usage

Pointer to object

Object

pb->add(“this is new data”);

myblob.add(“this is new data”);

pb->add(&patient_name);

myblob.add(patient_name);

blob more_blob;

blob more_blob;

pb->add(&more_blob);

myblob.add(&more_blob);

NoteThe add() method does not support using the blob itself as an argument. You must use the blob address.





Copyright © 2005. Sybase Inc. All rights reserved. clr()

View this book as PDF