I am writing a stored procedure in MySQL. The following is the code I wrote:

```
SET @qry = 'SELECT id into @wid FROM work_profile where candidate_id = 1223 limit 1';
PREPARE statement FROM @qry;
EXECUTE statement;

```

However, `@wid` is null after execution.

```
SELECT id FROM work_profile where candidate_id = 1223 limit 1 

```

This returns a value of 1443.