Subject | Re: [firebird-support] cursor in a Firebird StoredProc |
---|---|
Author | Martijn Tonies |
Post date | 2005-08-22T20:01:37Z |
Hi,
DO BEGIN
... something with data ...
END
With regards,
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> I always use cursors in MSSQL.FOR SELECT Codigo, Nombre, idMedicoSolicitante
> 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 ?
> >From Maestro_Medicos mmINTO :variable1, :variable2
> Inner Join Especialidad_Medico em On em.Medico = mm.Codigo
> Where Not mm.idMedicoSolicitante is Null
DO BEGIN
... something with data ...
END
With regards,
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com