Hello,
I am trying to update a variable to the value of a field in row in a cursor. I know about the "Into" statement that allows you to line up the variables with the columns in the select statement, but what if I only have one variable, and it doesn't match up with the first column? I don't want to change my select statement all the time, based on the number of variables I am using. The code in the stored procedure looks like this:
declare @myVariable nvarchar(50)
declare My_Cursor scroll cursor for
Select Vend_Num, Inv_num, Inv_date
from SampleEDI
open My_Cursor
fetch first from My_Cursor
****Set @myvariable = ???? *****
I am trying to update a variable to the value of a field in row in a cursor. I know about the "Into" statement that allows you to line up the variables with the columns in the select statement, but what if I only have one variable, and it doesn't match up with the first column? I don't want to change my select statement all the time, based on the number of variables I am using. The code in the stored procedure looks like this:
declare @myVariable nvarchar(50)
declare My_Cursor scroll cursor for
Select Vend_Num, Inv_num, Inv_date
from SampleEDI
open My_Cursor
fetch first from My_Cursor
****Set @myvariable = ???? *****