Visual Basic para Aplicaciones - UPDATE - SQL

Life is soft - evento anual de software empresarial
 
Vista:

UPDATE - SQL

Publicado por Alexandre BRAZIL (8 intervenciones) el 29/06/2005 19:46:33
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 & "'"
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:UPDATE - SQL

Publicado por yeni (12 intervenciones) el 02/07/2005 04:14:24
ps k yo sepa .. pero no te guies por lo que digo .. ya k tampoco soy un capo en esto..
pero el and no va como quieres hacerlo
...
el and podrias utilizarlo cuando quieres darle una doble condicion
ejm:

UPDATE tabla set cod='01' WHERE nom='pepe' and edad=13

pero si quieres hacer dos uptades a la misma ves ps te recominedo k creas una variable por cada update y luego ejecutalos

ejm

x="UPDATE tabla1 set cod='01' WHERE nom='pepe' and edad=13"
y="UPDATE tabla2 set cod='001' WHERE nom='toto' and edad=15"

cn.execute x
cn.execute y


creo k con esto la haces.. chao nene
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

GRACIAS YENI

Publicado por Alexandre BRAZIL. (1 intervención) el 04/07/2005 18:28:55
OBRIGADO AMOR DIME SI TE ANIMAS TE PUEDO TRAER ACA A BRAZIL PARA PODER PASAR UNAS VACACIONES FORMIDABLES, COSA MAS GRANDE DO MUNDO.
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