Example DB Injector
The following provides an example of a very simple MySQL stored procedure which can be used to inject leads.
Two stored procedures are required by the lead injector.
Each stored proc is called in turn each time the lead injector fires (based on the configured frequency).
The first stored proc retrieves the list of field names which are to be imported.
It is important that the order of the field names is the same as the order of the actual columns returned in the second call.
Example Header procedure
delimiter $ #drop procedure `headerProcName`$ create PROCEDURE `headerProcName`() BEGIN select phone, name,id from testdata limit 0 ; END$ delimiter ;
The second request returns all of the lead data.
The argument 'maxIdImporteddelimiter' is passed with a value the represents the last lead id returned when this stored procedure was last called and successfully inserted into a Campaign.
#drop procedure `procName`$ create PROCEDURE `procName`(maxIdImported varchar(100)) BEGIN select phone, name,id from testdata where testdata.id > maxIdImported limit 1 ; END$ delimiter ;