Undefined binding(s) detected when compiling SELECT


#1

Hello Everyone, could you help me with this error?

Undefined binding(s) detected when compiling SELECT query: select * from [consoresourceprofile] inner join [consoresource] on [consoresourceprofile].[consoresource_id] = [consoresource].[id] inner join [consoprofile] on [consoresourceprofile].[consoprofile_id] = [consoprofile].[id] inner join [consopermission] on [consoresourceprofile].[consopermission_id] = [consopermission].[id] where [consoresourceprofile].[consoprofile_id] = ? and [consoresource].[resourceactive] = ? and [consoprofile].[profileactive] = ? and [consopermission].[permissionactive] = ?


#2

Hey @Mathias.gmz! :wave:

May you share some code?


#3
Hello romain! here is my code:

const user = yield request.auth.getUser()
                const getProfile = yield Database.table('Consousers').where('id', user.id).limit(1)
                console.log('id profile '+getProfile.profile_id)
                const getResources = yield Database.table('consoresourceprofile').where('consoresourceprofile.consoprofile_id', getProfile.profile_id)
                .innerJoin('consoresource', 'consoresourceprofile.consoresource_id', 'consoresource.id').where({'consoresource.resourceactive': '1'})
                .innerJoin('consoprofile', 'consoresourceprofile.consoprofile_id', 'consoprofile.id').where({'consoprofile.profileactive': '1'})
                .innerJoin('consopermission', 'consoresourceprofile.consopermission_id', 'consopermission.id').where({'consopermission.permissionactive': '1'})
                .where({'consoresourceprofile.consoprofile_id': getProfile.profile_id})Preformatted text