Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics

How to display data returned by stored procedure

Scroll Prev Next More

 

The following SQL Server stored procedure example returns data from the "test" table.

 

CREATE PROCEDURE [dbo].[test_proc]
AS
BEGIN
SET NOCOUNT ON;
SELECT * from test
END

 

1. Add the test table or any other table to the project.

 

2. Add the following code to the List page: CustomQuery event:

 

return DB.Query( "EXEC test_proc" );

 

3. Add the following code to the List page: FetchRecords event:

 

return rs.fetchAssoc();

 

4. Add the following code to the ListGetRowCount event:

 

return DBLookup("select count(*) from test");

See also:

Database API:Query()

QueryResult object: fetchAssoc()

Event: ListQuery

Event: ListFetchArray

Event: ListGetRowCount

How to execute stored procedures