Visual Basic - SQL - UPDATE

Life is soft - evento anual de software empresarial
 
Vista:

SQL - UPDATE

Publicado por Alexandre (19 intervenciones) el 29/06/2005 19:47:40
Estimados Latinos:

Estoy con dificultades de hacer que dos instrucciones update (sql), sea hecha en una solo linea:

Hoy tengo

selecao = "UPDATE TABELA_PEDIDOSDETALHESLOTEfat set loteroths='" & TxtNLote.Text & "' WHERE loteroths='" & TxtLotRoths.Text & "'"
bd.Execute (selecao)

selecao = "UPDATE TABELA_PEDIDOSDETALHESLOTEFAT set loteband='" & TxtNBand.Text & "' WHERE loteband='" & TxtBand.Text & "'"
bd.Execute (selecao)

¿Es possible hacer las dos instrucciones con un “AND” ?

selecao = "UPDATE TABELA_PEDIDOSDETALHESLOTEfat set loteroths='" & TxtNLote.Text & "' WHERE loteroths='" & TxtLotRoths.Text & "' AND UPDATE TABELA_PEDIDOSDETALHESLOTEFAT set loteband='" & TxtNBand.Text & "' WHERE loteband='" & TxtBand.Text & "'"

Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:SQL - UPDATE

Publicado por ch@osoft® (63 intervenciones) el 30/06/2005 13:18:04
como es la misma tabla haz esto, despues del 1er set pones una coma y la otra condicion la conectas con un AND

selecao = "UPDATE TABELA_PEDIDOSDETALHESLOTEfat set loteroths='" & TxtNLote.Text & "' ,loteband='" & TxtNBand.Text & "' WHERE loteroths='" & TxtLotRoths.Text & "' and loteband='" & TxtBand.Text & "'"

salu2 y suerte

ch@osoft®



Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar