attock Posted September 15, 2009 Share Posted September 15, 2009 I know we can use 'set @myVar = "blah" ' to store a value to @myVar. Similarly we can also do: set @myVar = 'Select * from xyz'; and then execure the string stored in @myVar as: PREPARE sql FROM @myVar; EXECUTE sql; // this would execute the query However, my question is there a way to do sumthing like this: set @myVar = EXECUTE('Select * from xyz' I wana store the results of execution into a variable. Thanks Link to comment https://forums.phpfreaks.com/topic/174334-store-procedure-variables/ Share on other sites More sharing options...
tekrscom Posted September 17, 2009 Share Posted September 17, 2009 Some really good information on that here... http://www.sqlteam.com/article/stored-procedures-returning-data Link to comment https://forums.phpfreaks.com/topic/174334-store-procedure-variables/#findComment-919902 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.