Apr 25, 2001 #1 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
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
Apr 25, 2001 1 #2 weedz Programmer Dec 5, 2000 718 NL 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) http://www.crowncap.demon.nlveld4663@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 Upvote 0 Downvote
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) http://www.crowncap.demon.nlveld4663@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
Apr 25, 2001 1 #3 jimstarr Programmer Feb 6, 2001 975 US Hi Ted, The CALCULATE statement may be what you want. In your example you could say CALCULATE MAX(field) TO variable Jim Upvote 0 Downvote
Hi Ted, The CALCULATE statement may be what you want. In your example you could say CALCULATE MAX(field) TO variable Jim