Language Reference Guide : System Classes : BitmapObject Class : InsertIntoDB Method
 
Share this page          
InsertIntoDB Method
The InsertIntoDB method puts the bitmap image associated with the BitmapObject object into the specified table and constructs a DBHandle for the bitmap.
This method has the following syntax:
integer = BitmapObject.InsertIntoDB([tablename = varchar])
This method has the following parameter:
tablename
Identifies the table in which you want to store the bitmap. If you do not specify a table name, OpenROAD stores the bitmap in the default system table, II_STORED_BITMAPS. If you specify a different table, ensure that it has the correct structure. (For information about the structure of the table required to store bitmaps, see the Programming Guide.)
After this method is completed, the DBHandle attribute of the BitmapObject contains the constructed DBHandle. The DBHandle and its associated bitmap must be stored in two different tables, so you must also put the DBHandle value into the proper table.
When you use this method, you are interacting directly with the database. Consequently, the work that this method does is part of any ongoing transaction, or, if no transaction is open, it initiates a transaction. The work that the method performs is not permanent until a commit statement is executed. Be sure to commit the changes made by this method.
The InsertIntoDB method returns ER_OK if successful, or a non-zero database error code if not. Descriptions of system constant values and their numeric equivalents are listed in Error Codes.
For information on how to store bitmaps in the database and a discussion of transaction management, see the Programming Guide.
Note:  Do not use this method with autocommit turned on, because the multiple database statements involved in saving a bitmap object can result in incorrect values.