フィルターのクリア

DB Toolbox: Calling Store Procedure

3 ビュー (過去 30 日間)
Pete sherer
Pete sherer 2021 年 4 月 26 日
回答済み: Pete sherer 2021 年 4 月 27 日
Hi,
I am using the Database toolbox to execute the store procedure.
tSQL = ['{call LiveCAT.dbo.[nameOfSP]('input1','input2')}'];
execute( connDB, tSQL)
info = fetch(connDB, ' SELECT * FROM #Results')
or
curs = exec( conn, tSQL);
dbList= fetch( curs);
I didn't get any return result. I think it didn't work because there're interim SQL statement in between before final SELECT query. Please provide suggestion.
The SP looks like this
ALTER PROCEDURE [dbo].[nameOfSP] (@peril varchar(255), @name varchar(255))
AS
BEGIN
create table #Results
(Exposure_BaseId bigint null, Company varchar(400))
INSERT INTO #Results(Exposure_BaseId, Company )
Exec(@myQuery)
Select distinct Exposure_BaseId,Company ,
from #Results
END

回答 (1 件)

Pete sherer
Pete sherer 2021 年 4 月 27 日
I tried to use command 'runstoredprocedure' but it seems that function doesn't exist anymore.

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by