How to force a database schema name assignment in CA Aion Business Rules Expert?

Document ID : KB000022466
Last Modified Date : 14/02/2018
Show Technical Document Details

Question:

Database schema names, otherwise known as the OwnerID, are important when making queries and stored procedures in CA Aion Business Rules Expert. In the rare event that the OwnerID is not automatically set from within the Connection instance, it is possible to programmatically force the assignment to OwnerID to ensure a successful connection, and consequently also a Query and a Stored Procedure.

Answer:

Sample code on how to programmatically force a schema name, in case the Connection properties fail to do so.

//Note that ConnectionName is the name of the user-defined Connection instance to the database.
var dummy Integer //output for the returned number of rows (this is a placeholder used in the Execute request)
var RCode boolean //for whether the connection has successfully connected

RCode = ConnectionName.Connect(FALSE)   
 
if Platform = OS_UNIX   
then
  RCode = ConnectionName.Execute("Set current schema " & <String object>,dummy) 
  if retcode <> 0 then   
    MessageBox("Set current schema " & <String object> & " was unsuccessful")
    // ...discontinue processing, or try another <String object>   
   end   
   
end

// Your <String object> can be a string, or any operation that constructs a string,

// preferably one that corresponds to an existing schema in the database.