podminka:= "SELECT Obj_polozky.id_dobj,SUM(Obj_polozky.mnozstvi) AS SUMA FROM Obj_polozky WHERE id_dobj="+int2str(id_obj)+" GROUP BY `Obj_polozky`.id_dobj";
begin {otev°enφ prom∞nnΘho kurzoru curs}
if not Open_SQL_cursor(curs,podminka) then Rec_cnt(curs, pocet) else chybacgi("Chyba p°i b∞hu procedury zjistiKS");
podminka:= "SELECT SUM(Obj_polozky.mnozstvi*cenik.hmotnost) AS SUMA FROM Obj_polozky, Cenik WHERE (OBJ_POLOZKY.id_cnk=Cenik.id_cenik ) AND id_dobj="+int2str(id_obj);
begin
if not Open_SQL_cursor(curs,podminka) then Rec_cnt(curs, pocet) else chybacgi("Chyba p°i b∞hu procedury zjistiKG");
/* statement:="INSERT INTO obj_header(id_dobj,cis_eob, id_org, obchodnik,ico,datum, datum_d,doprav,sum_cena) SELECT "+pom_str2+",""" +pom_cisobj+""" ,id_org,obchodnik,ico,"+pom_strd +", "+pom_strdd +" ,doprav,sum_cena FROM obj_header WHERE id_dobj="+pom_str;
if SQL_execute(statement) then chybacgi("Nelze vlo₧it nov² zßznam do tabulky obj_header (kopie objednßvky). Zkontrolujte prßva a obsazenφ do roli v aplikaci.");
*/
// tady to nahrazuje SQL_execute(statement) / zaΦßtek
statement:="SELECT id_org,obchodnik,ico,doprav,sum_cena FROM obj_header WHERE id_dobj="+pom_str;
if Open_SQL_cursor(staraobj,statement) then chybacgi("Nelze otev°φt kursor do tab obj_header (kopie objednßvky). ")