Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Stored procedures 存储过程的错误行86_Stored Procedures - Fatal编程技术网

Stored procedures 存储过程的错误行86

Stored procedures 存储过程的错误行86,stored-procedures,Stored Procedures,我正在尝试使此存储过程正常工作。我已经连续工作了一个月,昨晚一直工作到3点,我快要精疲力竭了。我真的很想让这个工作,因为我们有一个广告活动,我们花了数百发送流量到 USE [redhotkitties2005db] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[proc_rhkprod_lock_items_for_paypal] @cfuseridid bigint ,@tr

我正在尝试使此存储过程正常工作。我已经连续工作了一个月,昨晚一直工作到3点,我快要精疲力竭了。我真的很想让这个工作,因为我们有一个广告活动,我们花了数百发送流量到

USE [redhotkitties2005db]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[proc_rhkprod_lock_items_for_paypal]
    @cfuseridid bigint
    ,@transaction_guid uniqueidentifier = NULL
AS
BEGIN
    SET NOCOUNT ON;

    declare @tblcartID          bigint
            ,@cfuserid          bigint
            ,@tblproductsid     bigint
            ,@quantity          bigint
            ,@localInventoryID  varchar(100)
            ,@taxologykey       bigint
            ,@name              varchar(1000)
            ,@shortDescription  varchar(8000)
            ,@productDescription varchar(8000)
            ,@UorLorUL          varchar(2)
            ,@unitPrice         money
            ,@shippingWeight    numeric(6, 2)
            ,@overSize          tinyint
            ,@smallPic1         nvarchar(100)
            ,@largePic1         nvarchar(100)
            ,@smallPic2         nvarchar(100)
            ,@largePic2         nvarchar(100)
            ,@smallPic3         nvarchar(100)
            ,@largePic3         nvarchar(100)

    SET @transaction_guid = coalesce(@transaction_guid,newid())

    declare c1 cursor forward_only for

    select      rhkProd_tblCart.tablePK AS tblcartID
                ,rhkProd_tblProducts.productID as tblproductsid
                ,rhkProd_tblCart.quantity
                ,rhkProd_tblProducts.localInventoryID
                ,rhkProd_tblProducts.name
                ,rhkProd_tblProducts.taxologyKey
                ,rhkProd_tblProducts.shortDescription
                ,rhkProd_tblProducts.productDescription
                ,rhkProd_tblProducts.UorLorUL
                ,rhkProd_tblProducts.unitPrice
                ,rhkProd_tblProducts.shippingWeight
                ,rhkProd_tblProducts.overSize
                ,rhkProd_tblProducts.smallPic1
                ,rhkProd_tblProducts.largePic1
                ,rhkProd_tblProducts.smallPic2
                ,rhkProd_tblProducts.largePic2
                ,rhkProd_tblProducts.smallPic3
                ,rhkProd_tblProducts.largePic3
    from        rhkProd_tblCart
    INNER JOIN  rhkProd_tblProducts
    on          rhkProd_tblCart.tblProductsFK = rhkProd_tblProducts.productID
    where       rhkProd_tblCart = @cfuserid



    open c1

    fetch next
    from    c1
    into    @tblcartID
            ,@cfuserid
            ,@tblproductsid
            ,@quantity
            ,@localinventoryID
            ,@name
            ,@taxologykey
            ,@shortdescription
            ,@productdescription
            ,@UorLorUL
            ,@unitprice
            ,@shippingweight
            ,@oversize
            ,@smallpic1
            ,@largepic1
            ,@smallpic2
            ,@largepic2
            ,@smallpic3
            ,@largepic3
begin
    while @@fetch_status = 0

            insert into rhkprod_tblpaypallock (
                ,[cfuserid]
                ,[transaction_guid]
                ,[timestamp]
                ,[tblproductsFK]
                ,[quantity]
                ,[localInventoryID]
                ,[name]
                ,[taxologykey]
                ,[shortdescription]
                ,[productdescription]
                ,[uorlorul]
                ,[unitprice]
                ,[shippingweight]
                ,[oversize]
                ,[smallpic1]
                ,[largepic1]
                ,[smallpic2]
                ,[largepic2]
                ,[smallpic3]
                ,[largepic3]
            )
            values (
                ,@cfuserid
                ,@transaction_guid
                ,getdate()
                ,@tblproductsid
                ,@quantity
                ,@localinventoryID
                ,@name
                ,@taxologykey
                ,@shortdescription
                ,@productdescription
                ,@UorLorUL
                ,@unitprice
                ,@shippingweight
                ,@oversize
                ,@smallpic1
                ,@largepic1
                ,@smallpic2
                ,@largepic2
                ,@smallpic3
                ,@largepic3
            )

            update  rhkprod_tblproducts
            set     quantity = quantity - @quantity
            where   productid = @tblproductsid
            and     UorLorUL in ('U','L')

            fetch next
            from    c1
            into    @tblcartID
                    ,@cfuserid
                    ,@tblproductsid
                    ,@quantity
                    ,@localinventoryID
                    ,@name
                    ,@taxologykey
                    ,@shortdescription
                    ,@productdescription
                    ,@UorLorUL
                    ,@unitprice
                    ,@shippingweight
                    ,@oversize
                    ,@smallpic1
                    ,@largepic1
                    ,@smallpic2
                    ,@largepic2
                    ,@smallpic3
                    ,@largepic3

    close c1

    deallocate c1
end
END

INSERT
语句的开头有一个逗号:

insert into rhkprod_tblpaypallock (
                ,[cfuserid]
应该是

insert into rhkprod_tblpaypallock (
                [cfuserid]
values (
    @cfuserid
VALUES
子句还有一个逗号:

values (
    ,@cfuserid
应该是

insert into rhkprod_tblpaypallock (
                [cfuserid]
values (
    @cfuserid

这是用于哪个数据库和哪个版本的?请相应地更新您的标签!顺便问一下,您正在使用IDE吗?SQLServerExpress是免费的。我将您的代码粘贴到其中,运行解析器,发现“,”和行号附近的
语法不正确。