Below is a sample script which assigns the output of a stored procedure into a variable and also passes a parameter into a stored procedure. It uses the Stored Procedures "CustOrderHist" and "Ten Most Expensive Products" from the Northwind sample database which ship with MS SQL Server. How to configure your settings to run the sample script: 1) Locate the sample database that ships with Microsoft SQL Server 7/2000 called "Northwind", look at the stored procedures section. 2) Set up an ODBC | SYSTEM DSN on the SilkPerformer machine for the Northwind Database. During the configuration of the System DSN ensure that you have changed the default database from "Master" to "Northwind". Test the data source connection to ensure it is configured correctly 3) In SilkPerformer go to SETTINGS | ACTIVE PROFILE | DATABASE | ODBC HIGH-LEVEL Tab Here enter the Data Source Name that you have just configured along with the appropriate Username and Password. 4) Copy and paste the script below into a BDF script and complete a Try-Script 5) Check the Output file which will verify that you can assign the output of a stored procedure into a variable. benchmark StoredProcedure use "kernel.bdh" var s1,s2,s3 : string; dcluser user VUser transactions TestProc : 1; dcltrans transaction TestProc begin s1 := "AROUT"; c1:SpTest1(); writeln("Return Value :" + s2); c1:SpTest2(); writeln("Return Value :" + s3); end TestProc; dclsql SpTest1 (proc) : { CALL "Ten Most Expensive Products" } INTO :s2 ; SpTest2 (proc) : { CALL CustOrderHist(:s1 IN) } INTO :s3 ; Old KB# 19144
↧