Skip to content

SqlContext Error on PreparedSQL for update statement #76

@rachmadideni

Description

@rachmadideni

Why im getting Request Error SqlContext Error on PreparedSQL for my update statement.
log shows message :

must declare the scalar variabel @IDINVO

 
these array data retrieve from express request object :
NOBLAN = ['1234','2345']
IDINVO = [1,2]


sql.execute({
            query:"update DB_REPORT..DT_INVOICE_COBA_02 SET NOBLAN=@NOBLAN WHERE IDINVO=@IDINVO",
            params:{                          
                NOBLAN:{
                    type:sql.NVarChar,
                    val: NOBLAN,
                    asTable:true
                },
                IDINVO:{
                    type:sql.Int,
                    val: IDINVO,
                    asTable:true
                }
            },
            multiple:true
        }).then(function(result){

        },function(err){
            console.log(err);
        });

maybe this isn't an issue but i need guidance how to solve error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions