Jump to content

Store Procedure Variables


attock

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.