createprocgetAllGoods(@GoodsTypevarchar(50))asselect*fromGoodswhereGoodsTypelike@GoodsType--------------------------------------------createprocgetCarGoodsDetails(@carIDv...
create proc getAllGoods
(@GoodsType varchar(50))
as
select * from Goods
where GoodsType like @GoodsType
--------------------------------------------
create proc getCarGoodsDetails
(@carID varchar(40))
as
select g.goodsID,goodsName,goodsPrice,quantity from Goods g,ShoppingCarDetails s
where g.goodsID=s.goodsID and s.carID=@carID
---------------------------------------------------
create proc createForm
(@customerID int,@totalPrice float)
as
begin
declare @orderID varchar(40)
set @orderID=(select carID from ShoppingCar where customerID=@customerID)
insert into OrderForm values (@orderID,@customerID,getdate(),@totalPrice)
insert into OrderFormDetails select * from ShoppingCarDetails where carID=@orderID
delete from ShoppingCarDetails where carID=@orderID
delete from ShoppingCar where carID=@orderID
end
表示不会Mysql求解。。。。
展开