
je je je , tengo un error en mi codigo de mi boton dice lo siguiente:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
''9>17' (de cuando agrego ma pasteles a mi tabla)Where codigo=1' at line 1.
Codigo de Roman:
UPDATE pasteles
SET
stock = if(stock + :agregar > :maximo, :maximo, stock + :agregar)
WHERE
codigo = :codigo
El codigo que he implementado en mi boton es:
QueryRefresh.SQL.Text:='UPDATE pasteles SET stock=IF '+QuotedStr(inttostr(strtoint(
DBedit3.Text)+strtoint(
txtagregar.Text)))+'>'+QuotedStr(inttostr(strtoint(
DBEDIT.TEXT)+strtoint(DBedit3.Text)+strtoint(txtagregar.Text)))+' WHERE codigo='+txtcodigo.Text;
el DBEDIT es el limite permitido a agregar de este pastel
Pienso que esta mal implementado el codigo en mi boton, ya que lo ejecute directamente en SQL y funciona sin problemas, me podrian orientar por favor.
Ya cheque con mi F5 y active el DeBUG de my query a true, y sigo haciendo pruebas. Karla
