Sure, works that way too. Just make sure the temp-tables definition comes first from the param statement.
There's no need for the return statement either. Since it's an output param, it get filled when you assign something to it.
And I made a mistake, the temp-table cannot by declare inside the...