deletet whit editor

deletet whit editor

rrzavaletarrzavaleta Posts: 78Questions: 52Answers: 2

tengo un problema para borrar desde el editor. normalmente se elimina una registro udando un campo "id". en caso de que quiera usar una sentencia mas grande como por ejemplo :
DELETE from ING_VALOR_CAMPO
WHERE ID_ASEGURADORA='4' AND ID_CAMPO='38' AND VAL_CAMPO='CAM' AND DESC_VALOR='DESC' AND SECUENCIA='2' "
How I can interpret this in the datatable editor?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Typically Editor is only required to perform a simple DELETE for each row to be deleted. If you need to add additional where parameters you could use the where() method of the Editor class.

    A final option would be to use the sql() method to directly trigger the query yourself - that way you have complete control over it.

    Allan

  • rrzavaletarrzavaleta Posts: 78Questions: 52Answers: 2

    will have an example that I can use displayed using the where () method of the class Editor

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    I'm afraid I don't understand - sorry. Are you asking for an example showing the use of where()? Its simply a case of adding ->where( 'myColumn', 'myValue', '=' ) to your Editor code.

    Allan

This discussion has been closed.