How to migrate Link Fields ('title' and 'url') involving local variables?
The link.migrate.inc file is not included in the Migrate Extras module, it's part of the Link module.

The file doesn't exist in the stable version of Link, but it does exist in the dev release. I think you're going to have to install the dev version of Link if you want this to work.

If you install the dev version and still get the error it's most likely because the file is not being automatically included. If that's the case try adding this to the top of your code:

module_load_include('inc', 'link', 'link.migrate');


EDIT

As I mentioned in your other question there's a slight error in your code, you should change this line:

$result = $query-&gt;execute();


to:

$result = $query-&gt;execute()-&gt;fetchObject();


That will return an object representing the first result that was returned by the query.