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
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'proc getAllGoods
(@GoodsType varchar(50))
as
select * from Goods
where GoodsType like @GoodsType at line 1
表示不会Mysql的求解。
(@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
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'proc getAllGoods
(@GoodsType varchar(50))
as
select * from Goods
where GoodsType like @GoodsType at line 1
表示不会Mysql的求解。
(GoodsType1 varchar(50))
as
select * from Goods
where GoodsType like @GoodsType1
(GoodsType varchar(50))
as
select * from Goods
where GoodsType like @GoodsType1;
(GoodsType varchar(50))
as
select * from Goods
where GoodsType like @GoodsType;