DROP PROCEDURE SampleCase_GET_Customer go DROP PROCEDURE SampleCase_DELETE_Customer go DROP PROCEDURE SampleCase_INSERT_Customer go DROP PROCEDURE SampleCase_GET_Orderline go DROP PROCEDURE SampleCase_DELETE_Orderline go DROP PROCEDURE SampleCase_INSERT_Orderline go DROP PROCEDURE SampleCase_GET_Ordertotal go DROP PROCEDURE SampleCase_DELETE_Ordertotal go DROP PROCEDURE SampleCase_INSERT_Ordertotal go DROP PROCEDURE SampleCase_GET_Product go DROP PROCEDURE SampleCase_DELETE_Product go DROP PROCEDURE SampleCase_INSERT_Product go -- *********************************************************************************************************************************** -- SampleCase_GET_Customer -- -- *********************************************************************************************************************************** -- Gets a specific entry based on values passed through parameters. -- *********************************************************************************************************************************** -- copyright 2000 Customer -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- When: 24-01-2001 -- Who: -- What: Initial release --************************************************************************************************************************************ CREATE PROCEDURE SampleCase_GET_Customer( @customerid NUMERIC) AS BEGIN SELECT customerid, firstname, lastname, company, address, city, zipcode, state, country FROM Customer WHERE (customerid = @customerid) RETURN(0) END go -- *********************************************************************************************************************************** -- SampleCase_DELETE_Customer -- -- *********************************************************************************************************************************** -- Deletes a specific Customer entry based on values passed through parameters. -- *********************************************************************************************************************************** -- copyright 2000 -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- When: 24-01-2001 -- Who: -- What: Initial release --************************************************************************************************************************************ CREATE PROCEDURE SampleCase_DELETE_Customer( @customerid NUMERIC) AS BEGIN --************************************************************************************************************************************ -- Declare Variables [Start] Declare @CurrentError int -- Declare Variables [End] --************************************************************************************************************************************ -- Begin Procedure Body DELETE FROM Customer WHERE (customerid = @customerid ) BEGIN SELECT @CurrentError= @@error IF (@CurrentError <> 0) RETURN @CurrentError END RETURN(0) END go -- *********************************************************************************************************************************** -- SampleCase_INSERT_Customer -- -- *********************************************************************************************************************************** -- Inserts a new Customer entry based on values passed through parameters. -- *********************************************************************************************************************************** -- copyright 2000 -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- When: 24-01-2001 -- Who: -- What: Initial release --************************************************************************************************************************************ CREATE PROCEDURE SampleCase_INSERT_Customer( @customerid NUMERIC, @firstname VARCHAR, @lastname VARCHAR, @company VARCHAR, @address VARCHAR, @city VARCHAR, @zipcode VARCHAR, @state VARCHAR, @country VARCHAR) AS BEGIN --************************************************************************************************************************************ -- Declare Variables [Start] Declare @CurrentError int -- Declare Variables [End] --************************************************************************************************************************************ -- Begin Procedure Body INSERT INTO Customer( customerid, firstname, lastname, company, address, city, zipcode, state, country) VALUES ( @customerid, @firstname, @lastname, @company, @address, @city, @zipcode, @state, @country) BEGIN SELECT @CurrentError = @@error IF (@CurrentError <> 0) RETURN @CurrentError END END go -- *********************************************************************************************************************************** -- SampleCase_GET_Orderline -- -- *********************************************************************************************************************************** -- Gets a specific entry based on values passed through parameters. -- *********************************************************************************************************************************** -- copyright 2000 Orderline -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- When: 24-01-2001 -- Who: -- What: Initial release --************************************************************************************************************************************ CREATE PROCEDURE SampleCase_GET_Orderline( @orderlineid NUMERIC) AS BEGIN SELECT orderlineid, amount, price, productid, ordertotalid FROM Orderline WHERE (orderlineid = @orderlineid) RETURN(0) END go -- *********************************************************************************************************************************** -- SampleCase_DELETE_Orderline -- -- *********************************************************************************************************************************** -- Deletes a specific Orderline entry based on values passed through parameters. -- *********************************************************************************************************************************** -- copyright 2000 -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- When: 24-01-2001 -- Who: -- What: Initial release --************************************************************************************************************************************ CREATE PROCEDURE SampleCase_DELETE_Orderline( @orderlineid NUMERIC) AS BEGIN --************************************************************************************************************************************ -- Declare Variables [Start] Declare @CurrentError int -- Declare Variables [End] --************************************************************************************************************************************ -- Begin Procedure Body DELETE FROM Orderline WHERE (orderlineid = @orderlineid ) BEGIN SELECT @CurrentError= @@error IF (@CurrentError <> 0) RETURN @CurrentError END RETURN(0) END go -- *********************************************************************************************************************************** -- SampleCase_INSERT_Orderline -- -- *********************************************************************************************************************************** -- Inserts a new Orderline entry based on values passed through parameters. -- *********************************************************************************************************************************** -- copyright 2000 -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- When: 24-01-2001 -- Who: -- What: Initial release --************************************************************************************************************************************ CREATE PROCEDURE SampleCase_INSERT_Orderline( @orderlineid NUMERIC, @amount NUMERIC, @price NUMERIC, @productid NUMERIC, @ordertotalid NUMERIC) AS BEGIN --************************************************************************************************************************************ -- Declare Variables [Start] Declare @CurrentError int -- Declare Variables [End] --************************************************************************************************************************************ -- Begin Procedure Body INSERT INTO Orderline( orderlineid, amount, price, productid, ordertotalid) VALUES ( @orderlineid, @amount, @price, @productid, @ordertotalid) BEGIN SELECT @CurrentError = @@error IF (@CurrentError <> 0) RETURN @CurrentError END END go -- *********************************************************************************************************************************** -- SampleCase_GET_Ordertotal -- -- *********************************************************************************************************************************** -- Gets a specific entry based on values passed through parameters. -- *********************************************************************************************************************************** -- copyright 2000 Ordertotal -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- When: 24-01-2001 -- Who: -- What: Initial release --************************************************************************************************************************************ CREATE PROCEDURE SampleCase_GET_Ordertotal( @ordertotalid NUMERIC) AS BEGIN SELECT ordertotalid, totalprice, orderdate, remarks, customerid FROM Ordertotal WHERE (ordertotalid = @ordertotalid) RETURN(0) END go -- *********************************************************************************************************************************** -- SampleCase_DELETE_Ordertotal -- -- *********************************************************************************************************************************** -- Deletes a specific Ordertotal entry based on values passed through parameters. -- *********************************************************************************************************************************** -- copyright 2000 -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- When: 24-01-2001 -- Who: -- What: Initial release --************************************************************************************************************************************ CREATE PROCEDURE SampleCase_DELETE_Ordertotal( @ordertotalid NUMERIC) AS BEGIN --************************************************************************************************************************************ -- Declare Variables [Start] Declare @CurrentError int -- Declare Variables [End] --************************************************************************************************************************************ -- Begin Procedure Body DELETE FROM Ordertotal WHERE (ordertotalid = @ordertotalid ) BEGIN SELECT @CurrentError= @@error IF (@CurrentError <> 0) RETURN @CurrentError END RETURN(0) END go -- *********************************************************************************************************************************** -- SampleCase_INSERT_Ordertotal -- -- *********************************************************************************************************************************** -- Inserts a new Ordertotal entry based on values passed through parameters. -- *********************************************************************************************************************************** -- copyright 2000 -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- When: 24-01-2001 -- Who: -- What: Initial release --************************************************************************************************************************************ CREATE PROCEDURE SampleCase_INSERT_Ordertotal( @ordertotalid NUMERIC, @totalprice NUMERIC, @orderdate DATETIME, @remarks TEXT, @customerid NUMERIC) AS BEGIN --************************************************************************************************************************************ -- Declare Variables [Start] Declare @CurrentError int -- Declare Variables [End] --************************************************************************************************************************************ -- Begin Procedure Body INSERT INTO Ordertotal( ordertotalid, totalprice, orderdate, remarks, customerid) VALUES ( @ordertotalid, @totalprice, @orderdate, @remarks, @customerid) BEGIN SELECT @CurrentError = @@error IF (@CurrentError <> 0) RETURN @CurrentError END END go -- *********************************************************************************************************************************** -- SampleCase_GET_Product -- -- *********************************************************************************************************************************** -- Gets a specific entry based on values passed through parameters. -- *********************************************************************************************************************************** -- copyright 2000 Product -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- When: 24-01-2001 -- Who: -- What: Initial release --************************************************************************************************************************************ CREATE PROCEDURE SampleCase_GET_Product( @productid NUMERIC) AS BEGIN SELECT productid, productname, description, price FROM Product WHERE (productid = @productid) RETURN(0) END go -- *********************************************************************************************************************************** -- SampleCase_DELETE_Product -- -- *********************************************************************************************************************************** -- Deletes a specific Product entry based on values passed through parameters. -- *********************************************************************************************************************************** -- copyright 2000 -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- When: 24-01-2001 -- Who: -- What: Initial release --************************************************************************************************************************************ CREATE PROCEDURE SampleCase_DELETE_Product( @productid NUMERIC) AS BEGIN --************************************************************************************************************************************ -- Declare Variables [Start] Declare @CurrentError int -- Declare Variables [End] --************************************************************************************************************************************ -- Begin Procedure Body DELETE FROM Product WHERE (productid = @productid ) BEGIN SELECT @CurrentError= @@error IF (@CurrentError <> 0) RETURN @CurrentError END RETURN(0) END go -- *********************************************************************************************************************************** -- SampleCase_INSERT_Product -- -- *********************************************************************************************************************************** -- Inserts a new Product entry based on values passed through parameters. -- *********************************************************************************************************************************** -- copyright 2000 -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- When: 24-01-2001 -- Who: -- What: Initial release --************************************************************************************************************************************ CREATE PROCEDURE SampleCase_INSERT_Product( @productid NUMERIC, @productname VARCHAR, @description TEXT, @price NUMERIC) AS BEGIN --************************************************************************************************************************************ -- Declare Variables [Start] Declare @CurrentError int -- Declare Variables [End] --************************************************************************************************************************************ -- Begin Procedure Body INSERT INTO Product( productid, productname, description, price) VALUES ( @productid, @productname, @description, @price) BEGIN SELECT @CurrentError = @@error IF (@CurrentError <> 0) RETURN @CurrentError END END go