I have an object Reportwhose values ββI want to insert into the database table. The following attributes Reportmust be inserted:
reportID - int
RoleID - int
Created_BY = SYSTEM(default)
CURRENT_TIMESTAMP
Now the problem is with the second attribute. I have a report with attributes LIST<ROLES>. ROLES- This is a clearly defined object that has IDa NAME. From this list I have to extract each role and insert each role identifier into the table.
So my query looks like this:
INSERT INTO REPORT_MARJORIE_ROLE(REPORT_ID, ROLE_ID, CREATED_BY, CREATED)
VALUES({0}, {1}, 'SYSTEM', CURRENT_TIMESTAMP)
The C # code where I am parsing these values ββis as follows:
try
{
StringBuilder _objSQL = new StringBuilder();
_objSQL.AppendFormat(Queries.Report.ReportQueries.ADD_NEW_ROLES, report.ID, "report.MarjorieRoles.Add(MarjorieRole"));
_objDBWriteConnection.ExecuteQuery(_objSQL.ToString());
_objDBWriteConnection.Commit();
_IsRolesAdded = true;
}
So please tell me how to add roles from a C # function
source
share