into Clause Usage

The into clause specifies that SAP ASE returns column data into the specified variables.

The fetch_target_list must consist of previously declared Transact-SQL parameters or local variables.

For example, after declaring the @name, @city, and @state variables, you can fetch rows from the pubs_crsr cursor as follows:

fetch pubs_crsr into @name, @city, @state

You can also fetch only the columns of the first row from the result set. To place the fetch columns in a list, enter:

fetch first from <cursor_name> into <fetch_target_list>