SQL SERVER数据库

<< Click to Display Table of Contents >>

Current:  Create Data Set > SQL Data Set > Data Set for Stored Procedure 

SQL SERVER数据库

Previous pageReturn to chapter overviewNext page

SQL Server Database with Parameters

The way of accessing the SQL Server database is the same as the way of accessing the DB2 database. If the SQL statements for the stored procedure created in the database are as follows:

create procedure testsp

@jiu int

AS

select * from student where consume_number=@jiu

Go

 

The big parentheses on the SQL statements in the SQL Server database are necessary, whereas the big parentheses in the Oracle and DB2 databases are not. Therefore the SQL statement for running the stored procedure in Yonghong Z-Suite should be: {Call mydb.dbo.testsp (?{jiu})}. As shown in the figure below:

clip0401

In addition, it is necessary to set the parameter @jiu in the "Edit Parameters" dialog shown in the following figure during parameter transferring.

clip0402

Refresh metadata to preview the data.

 

SQL Server Database Without Parameters

The syntax used in the stored procedure of database without parameter is as follows:

create procedure uui

as

select * from student

go

 

The SQL statement written in Yonghong Z-Suite is: {Call mydb.dbo.uui ()}. At this time, no parameter needs to be configured. Refresh metadata to preview the data.