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的求解。

解决方案 »

  1.   

    create proc getAllGoods
    (GoodsType1 varchar(50))
    as
      select * from Goods
      where GoodsType like @GoodsType1
      

  2.   

    不会MYSQL别怕,参考一下MYSQL官方免费手册的语法和例子就行了。 并不复杂。
      

  3.   

    create proc getAllGoods
    (GoodsType varchar(50))
    as
      select * from Goods
      where GoodsType like @GoodsType1;
      

  4.   

    create proc getAllGoods
    (GoodsType varchar(50))
    as
      select * from Goods
      where GoodsType like @GoodsType;