Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating variables to field values

Status
Not open for further replies.

AdamP

Programmer
Feb 12, 2002
13
0
0
US
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 = ???? *****

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top