如何把SQLServer的存储过程改成MYSQL的存储过程

--把购物车中的信息导入到订单中,并且删除购物车信息--------
create proc createForm
(@customerID int,@totalPrice float)
as
begin
declare @orderID varchar(40)
--根据用户ID获取购物车的carId--
set @orderID=(select carID from ShoppingCar where customerID=@customerID)
--向OrderForm表中插入数据--
insert into OrderForm values (@orderID,@customerID,getdate(),@totalPrice)
--把用户的ShoppingCarDetails数据保存到OrderFormDetails表中--
insert into OrderFormDetails select * from ShoppingCarDetails where carID=@orderID
--删除购物车相关数据--
delete from ShoppingCarDetails where carID=@orderID
delete from ShoppingCar where carID=@orderID
end

这个实现得追查一下才能解决。实际mysql的存储过程想在sqlserver里面运行本身还是需要处理一下的。OPENQUERY(pidb,'callapi_pidb_real(20100)')函数和函数体内部调用别的函数或者存储过程。都需要进一步确认并且在数据库中创建和执行才能确保你现在这句话能通
温馨提示:答案为网友推荐,仅供参考
相似回答