User`s guide
runstoredprocedure
7-209
Examples
Call a Stored Procedure Without Input and Output Arguments
Define a stored procedure named create_table that creates a table named
test_table by executing this code. This procedure has no input or output arguments.
This code assumes you are using a Microsoft SQL Server database.
CREATE PROCEDURE create_table
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
create table test_table
(
CATEGORY_ID INTEGER IDENTITY PRIMARY KEY,
CATEGORY_DESC CHAR(50) NOT NULL
);
END
GO
Create a Microsoft SQL Server database connection conn using the JDBC driver. For
details, see “Connecting to a Database”. Then, call the stored procedure create_table
using the database connection conn.
results = runstoredprocedure(conn,'create_table')
results =
0
results returns 0 because calling create_table does not return a data set.
Check your database for a new table named test_table.
Close the database connection conn.