Will someone please give me an example of reading an entity from a database table? I have the following:
const string MY_SQL = "SELECT * FROM MyTable WHERE Attrib IS NULL";
DatabaseProvider dbProvider = DatabaseAccess.ForExternalDatabase("My DataBase");
// Use a user managed transaction
using (CommittableTransaction commitableTransaction = dbProvider.GetCommittableTransaction())
{
using (Command cmd = commitableTransaction.CreateCommand(MY_SQL))
using (IDataReader reader = cmd.ExecuteReader())
while (reader.Read())
ENMyTableEntityRecord entityRecord = new ENMyTableEntityRecord();
entityRecord.ReadDB(reader);
}
It seems to be choking when trying to read a boolean column from the database. This is just a guess as to how this might work, so this may be totally off. Can you use select * and still use the ReadDB method, or do you have to select the columns explicitly in the order that the ReadDB method expects them?
Hello Jim
Have you checked the related knowledge base from OutSystems?
https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/Integrate_with_an_External_Database
https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/Extend_Logic_with_Your_Own_Code/Managing_Extensions/Define_Extension_Entities
Can't they help you?
Hi Jim,
You can directly connect external database with outsystems and use its entities in our application
Integrate with an External Database - OutSystems