Hello,
I read some threads but I can not find a solution
Hello,
I put a dynamic where sql in my grids. When I do this and use quick search there comes this error:
Fehler beim Datenbankzugriff:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘where vertrag_reparatur_id > 0 and vertrag_id=1’ at line 1
select count(*) from vertrag_reparatur where (vertrag_reparatur_id like ‘%1%’ or vertrag_id in (1,2,3,4,5,6,7,8,9,10,11) or Versorgungsorte like ‘%1%’ or Versorgungszeitraum like ‘%1%’ or Kostenuebernahme_bei_Pauschale like ‘%1%’ or Kostenuebernahme_bei_Bestandskunden like ‘%1%’ or KV_notwendig like ‘%1%’ or VO_notwendig like ‘%1%’ or Besondere_Hinweise like ‘%1%’ or inaktiv like ‘%1%’ or Erstellt_von like ‘%1%’ or Geaendert_von like ‘%1%’)where vertrag_reparatur_id > 0 and vertrag_id=1
My dynamic sql looks like this:
if (isset([v_vertrag_id])){
sc_select_where(add) = “where VA.vertrag_artikel_id > 0 and VA.vertrag_id=[v_vertrag_id]”;
$Vertragname = setTitleContract( [v_vertrag_id]);
[title] = "Vertrag Artikel zu Vertrag: ".$Vertragname;
}
else
{
sc_select_where(add) = "where VA.vertrag_artikel_id > 0 ";
}
Nothing of my grids with search work with this. It seems scriptcase add two where clauses?
Can I ask the search and put it in a if clause?
for example like
if (sc_btn_???) {…