MATLAB DATABASE TOOLBOX RELEASE NOTES Guía de usuario Pagina 639

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 684
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 638
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.
Vista de pagina 638
1 2 ... 634 635 636 637 638 639 640 641 642 643 644 ... 683 684

Comentarios a estos manuales

Sin comentarios