Subject | cursor in a Firebird StoredProc |
---|---|
Author | diegodelafuente |
Post date | 2005-08-22T18:32:55Z |
Hy:
I always use cursors in MSSQL.
an example:
--------------------------------------------------------------------
Declare curMedicos Cursor local Fast_Forward for
Select Codigo, Nombre, idMedicoSolicitante
From Maestro_Medicos mm
Inner Join Especialidad_Medico em On em.Medico = mm.Codigo
Where Not mm.idMedicoSolicitante is Null
Open CurMedicos
Fetch From CurMedicos Into @idMedico, @NombreMedico, @idMedsol
While @@Fetch_status = 0
Begin
"do something with the cursor"
Fetch From CurMedicos Into @idMedico, @NombreMedico, @idMedsol
End
Close CurMedicos
Deallocate CurMedicos
---------------------------------------------------------------
Can somebody send me an example of the use of cursors in Firebird ?
I always use cursors in MSSQL.
an example:
--------------------------------------------------------------------
Declare curMedicos Cursor local Fast_Forward for
Select Codigo, Nombre, idMedicoSolicitante
From Maestro_Medicos mm
Inner Join Especialidad_Medico em On em.Medico = mm.Codigo
Where Not mm.idMedicoSolicitante is Null
Open CurMedicos
Fetch From CurMedicos Into @idMedico, @NombreMedico, @idMedsol
While @@Fetch_status = 0
Begin
"do something with the cursor"
Fetch From CurMedicos Into @idMedico, @NombreMedico, @idMedsol
End
Close CurMedicos
Deallocate CurMedicos
---------------------------------------------------------------
Can somebody send me an example of the use of cursors in Firebird ?