Examples: Explorer_Set_SQL_Join_Info


The following example is the Explorer_Get_SQL_Join_Info procedure for the sample integrating application, which adds additional columns to the Customers SmartList object. This procedure adds a join to create the relationship between the RM_Customer_MSTR table and IG_Contact_History_MSTR table.

in integer IN_Object_Dict_ID;
in integer IN_Object_Type;
in Explorer_INT_List IN_Field_Dict_ID;
in Explorer_INT_List IN_Field;
inout integer Document_Type;

local string l_From_Table, l_From_Field, l_To_Table, l_To_Field;
local integer l_From_Table_Dict_ID, l_To_Table_Dict_ID, l_Join_Type, l_Error;

if IN_Object_Dict_ID = DYNAMICS then
	if IN_Object_Type = SMARTLIST_OBJECTTYPE_CUSTOMERS then

		{Set the characteristics of the join}
		l_From_Table = "RM_Customer_MSTR";
		l_From_Table_Dict_ID = DYNAMICS;
		l_From_Field = "Customer Number";
		l_To_Table = "IG_Contact_History_MSTR";
		l_To_Table_Dict_ID = IG_PROD_ID;
		l_To_Field = "Customer Number";
		l_Join_Type = SMARTLIST_JOINTYPE_LEFTOUTER;

		{Add the join}
		call with name "Explorer_Set_SQL_Join_Info" in dictionary SMARTLIST,
			l_From_Table,
			l_From_Table_Dict_ID,
			l_From_Field,
			l_To_Table,
			l_To_Table_Dict_ID,
			l_To_Field,
			l_Join_Type,
			l_Error;

		{Check for a join error}
		if l_Exp_Error <> 0 then
			warning "SQL join error: " + str(l_Exp_Error);
		end if;
	end if;
end if;


Documentation Feedback