Hi,
I would look into using **cursors** to process a SELECT statement and store the results. This involves the following steps:
* Start by defining a cursor-type variable in the declaration area using the syntax `CURSORÂ <cursorName:literal>Â ISÂ '<SELECTÂ statement>'`.
* After the cursor has been defined, if you want to fetch the results of the SELECT statement, you have to open the cursor with `OPENÂ <cursorName>`. If your cursor is created with a parameterized SELECT query, specify the value for the parameterized value. For example:`OPENÂ <cursorName>Â PARAMETERSÂ (param1)Â VALUESÂ (<literal>)`.
* Once the cursor is open, you can begin fetching the results with the command `FETCH <cursorName> INTO variables/list of variables`. This command allows you to fetch row values by inserting the values of various columns into a variable list.
* Finally, when you're done using the cursor, close it using the `CLOSEÂ <cursorName>`Â command.
For more details and examples on using cursors, please refer to **Example 2** in the [Developing VQL Stored Procedures](https://community.denodo.com/docs/html/browse/8.0/en/vdp/developer/developing_extensions/developing_stored_procedures/developing_vql_stored_procedures) guide.
Hope this helps!