This question has been flagged
3160 Views

Hi everyone : I have function :

   def _getvalue_byIdquotations(self,req,dbname,Id_child):
    resgister=RegistryManager.get(dbname)
    sql= """
        SELECT cvs_chil.codeproduct
        FROM cvs_quotations_cutproduct cvs_cut
        join cvs_quotations_product_child cvs_chil on cvs_cut.codeproduct_id=cvs_chil.codesystemdoor
        WHERE
          (cvs_cut.id_quotations = %d)
        """%(Id_child)

    with resgister.cursor() as cr:
        cr.execute(sql)
        restul=cr.fetchall()

        sql_exccute='''
        SELECT cvs_cut.codeproduct_id
        FROM product_category cate
        where (cate.id in %s)
        '''%(restul)
        cr.execute(sql_exccute)
        restul_excute=cr.fetchall()
    return restul_excute

But when i excute ,it error "ProgrammingError: syntax error at or near "[""

can you help me ?

Avatar
Discard