only build the sql strings if there are ids...

...checked