Database

public class Database

The Database object provides general information about Databases in the process instance.

 Methods

Schema GetSchema(string name)

Retrieves a schema by name of the associated schema diagram.

Example

This example sets and updates information about a person

s = Database.GetSchema("Datastorage")
hasData = False
with s.Select("select Id, Name, Age from Person") as reader:
   while reader.Read():
      hasData = True
      ProcessInstance.Warn("DBData:"+str(reader.GetValue(1)))
      mId = reader.GetValue(0)
      mAge = reader.GetValue(2)
if hasData:
   s.Execute("UPDATE Person SET Age=%d WHERE ID=%d" % (mAge + 1, mId))
else:
   s.Execute("INSERT INTO Person (Name,Age) VALUES ('Frank',45)")
s.Close()