Hi,
If I understand the question correctly, you need to execute a SQL query on a command. First, try sending a command manually by a user. Note that SetData() function does not send a command. To send commands according to conditions, use Automatic Control Module.