public CodeParser(Enums.ModeType mode, List <Control> ctrls, LayerMemberEntity objectEntity) { tables = new List <TableControl>(); joins = new List <JoinControl>(); ClassifyControlTypes(ctrls); if (mode == Enums.ModeType.Transformation_View) { this.code = GenerateViewCode(this.tables, this.joins); } else if (mode == Enums.ModeType.Table) { this.code = GenerateTableCode(this.tables); } else if (mode == Enums.ModeType.Extraction_Procedure) { this.code = GenerateExtractionProcedureCode(this.tables, objectEntity); } else { this.code = ""; } }
private string GenerateExtractionProcedureCode(List <TableControl> tables, LayerMemberEntity procedure) { StringBuilder sb = new StringBuilder(); int i = 0; sb.AppendLine("CREATE OR REPLACE PROCEDURE " + procedure.GetMemberName() + "( IMPORT_ID IN NUMBER )"); sb.AppendLine("IS"); sb.AppendLine("BEGIN"); // sb.AppendLine("/* here will be the control procedure start call */"); // // sb.AppendLine("/* here will be the control procedure finish call */"); // sb.AppendLine("EXCEPTION"); sb.AppendLine("\t WHEN OTHERS THEN NULL; -- exception handling"); sb.AppendLine("END;"); return(sb.ToString()); }