Thursday, 4 May 2017

Storing Array values to integer

trying to store array values in integer . this is my code . is it wrong?

db.query('INSERT INTO users(name,student_id) VALUES($1,ARRAY["$2","$3"]::INTEGER[]) RETURNING *', [data.name, data.id]).then(function(user) {
    }).catch(function(err) {
    return callback(null, err);
     })

but i am getting this error

{
 "name": "error",
 "length": 102,
 "severity": "ERROR",
 "code": "42703",
 "position": "70",
 "file": "parse_relation.c",
 "line": "3090",
 "routine": "errorMissingColumn"
}



via rashmi r

No comments:

Post a Comment