dbgobottom() en SQL

Post Reply
User avatar
Mauricio
Posts: 199
Joined: Thu Oct 06, 2005 9:07 pm
Location: San Diego, CA

dbgobottom() en SQL

Post by Mauricio »

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
horacio
Posts: 1270
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: dbgobottom() en SQL

Post by horacio »

Si trabajas con ado podés usar esta función oRecordSet : MoveLast()
User avatar
compubrion
Posts: 130
Joined: Thu Mar 08, 2007 6:12 pm
Location: Miranda - Venezuela
Contact:

Re: dbgobottom() en SQL

Post by compubrion »

Si usas TMysQl Prueba usando cQuery:RecCount() + 1
Espero que te sirva
Harbour / Bcc / MinGW / Fwh 13.9
ricardog
Posts: 149
Joined: Tue Oct 11, 2005 3:10 pm

Re: dbgobottom() en SQL

Post by ricardog »

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
xmanuel
Posts: 613
Joined: Sun Jun 15, 2008 7:47 pm
Location: Sevilla
Contact:

Re: dbgobottom() en SQL

Post by xmanuel »

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
______________________________________________________________________________
Sevilla - Andalucía
User avatar
Mauricio
Posts: 199
Joined: Thu Oct 06, 2005 9:07 pm
Location: San Diego, CA

Re: dbgobottom() en SQL

Post by Mauricio »

Gracias a todos,

probare las soluciones que comentan,

saludos,
Mauricio
Post Reply