10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

How You Can Work with Text StringsHow You Can Replace the Contents of an External FileYou can replace an old string in the database with the contents of an externalfile. To replace an old string with the contents of an external file, you wouldperform the following basic steps:1. Set the value of the DBHandle attribute to the DBHandle for the string youwant to replace.2. Set the FileHandle attribute to the file name that contains the new string.OpenROAD copies the new string into the StringObject object.3. Use the UpdateInDB method to remove the old string from the databaseand add the new string (the current value of the StringObject object) in itsplace.4. Commit the changes to the database.How You Can Delete Strings from a DatabaseTo remove a string from the database, use the DeleteFromDB method, whichdeletes the string that has the current value of the DBHandle attribute.To remove a string, you would perform the following basic steps:1. Set the value of the DBHandle attribute to the DBHandle for the string youwant to delete.2. Use the DeleteFromDB method to remove the string.3. Commit changes to the database.The DeleteFromDB method returns ER_OK if successful or a nonzero value ifthere is an error.For more information about error handling for the DeleteFromDB method, seeWorking with a Database (see page 147).Working with Images and Text Strings 291

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!