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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

store sql result to a variable 2

Status
Not open for further replies.

mcginty

IS-IT--Management
Mar 14, 2001
35
IE
Hi,

Can I store the result of a sql statement to a variable and if so how? eg.

store select max(field) from table to variable

Rgds,
Ted
 
You can store your results into a cursor, a table or an array according to the MSDN.

So if you wish to store your result into a variable, I suggest you use an array.

SELECT * FROM myTable INTO ARRAY MyArray.

HTH,
Weedz (Wietze Veld)
veld4663@exact.nl
The Netherlands

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
Hi Ted,

The CALCULATE statement may be what you want. In your example you could say

CALCULATE MAX(field) TO variable

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top