Home > database >  Sybase 12.5 perform dynamic SQL and obtain a result, how to deal with?
Sybase 12.5 perform dynamic SQL and obtain a result, how to deal with?

Time:09-18

I wrote a stored procedure, you need to perform in the process of dynamic SQL, and to the SQL execution results stored in the subsequent use in a variable, could you tell me how to solve this problem?

CodePudding user response:

Declare @ CMDSTR varchar (100)
The create table cmdresult (... )
Select @ CMDSTR='insert cmdresult select... '
Execute (@ CMDSTR)

Select * from cmdresult

  • Related