En Clipper/FW para llegar al final del dbf e incrementar por ejemplo el folio haciamos algo asi.
base->( dbgobottom())
nRegistro := base->registro+1
y listo, teniamos el siguiente folio, pero en MySql como se hace?
Saludos,
Mauricio
dbgobottom() en SQL
Re: dbgobottom() en SQL
Si trabajas con ado podés usar esta función oRecordSet : MoveLast()
- compubrion
- Posts: 130
- Joined: Thu Mar 08, 2007 6:12 pm
- Location: Miranda - Venezuela
- Contact:
Re: dbgobottom() en SQL
Si usas TMysQl Prueba usando cQuery:RecCount() + 1
Espero que te sirva
Espero que te sirva
Harbour / Bcc / MinGW / Fwh 13.9
Re: dbgobottom() en SQL
Modifica el campo para que tenga las propiedades
"NOT NULL"
"AUTO INC"
Y asi cada que insertes un registro en esa tabla, tu ya no te preocupas por ese dato.
Saludos
"NOT NULL"
"AUTO INC"
Y asi cada que insertes un registro en esa tabla, tu ya no te preocupas por ese dato.
Saludos
Re: dbgobottom() en SQL
En Eagle1 sería así:
nRegistro := oBase:LastRec() + 1
o de una forma análoga como tú lo hacias:
oBase:gobottom()
nRegistro := oBase:RecNo() + 1
Aunque tal vez lo mejor sea crear un campo auto-incremental, hay que saber el contexto.
Para más información sobre Eagle1 mira aquí: http://es.groups.yahoo.com/group/eagle1
nRegistro := oBase:LastRec() + 1
o de una forma análoga como tú lo hacias:
oBase:gobottom()
nRegistro := oBase:RecNo() + 1
Aunque tal vez lo mejor sea crear un campo auto-incremental, hay que saber el contexto.
Para más información sobre Eagle1 mira aquí: http://es.groups.yahoo.com/group/eagle1
______________________________________________________________________________
Sevilla - Andalucía
Sevilla - Andalucía
Re: dbgobottom() en SQL
Gracias a todos,
probare las soluciones que comentan,
saludos,
Mauricio
probare las soluciones que comentan,
saludos,
Mauricio