LIBPQ - FETCH INTO
"Michael GUIARD" <[email protected]> Thu, 28 Jul 2005 15:55:42 +0200
| Newsgroups | gmane.comp.db.postgresql.devel.win32 |
|---|---|
| Message-ID | <017101c5937c$0f0f35d0$027ba8c0@NSTMike> |
This is a multi-part message in MIME format. ------=_NextPart_000_016E_01C5938C.CEBCEE80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi ! first, thank you Magnus for your help :) the use of cursors and fetch commands works fine for me.=20 Is it possible to know the result length (rows count) before any = retreive ? Another thing, now I'd like to retreive the results, using FETCH = command, into a structure. For example I ask for selecting 2 fields, = instead of using PQgetvalue(res, i, j), I'd like to retreive all fields = in a C structure. I saw the FETCH INTO command, I tried to use it with the PQexecParams = but I did not succeeded in. Is it possible ? if yes how ? thanks Mike ------=_NextPart_000_016E_01C5938C.CEBCEE80 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2900.2668" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#e9e7e2> <DIV><FONT face=3DArial size=3D2>Hi !</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>first, thank you Magnus for your = help=20 :)</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>the use of cursors and fetch commands = works fine=20 for me. </FONT></DIV> <DIV><FONT face=3DArial size=3D2>Is it possible to know the result = length (rows=20 count) before any retreive ?</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Another thing, now I'd like to retreive = the=20 results, using FETCH command, into a structure. For example I ask for = selecting=20 2 fields, instead of using PQgetvalue(res, i, j), I'd like to retreive = all=20 fields in a C structure.</FONT></DIV> <DIV><FONT face=3DArial size=3D2>I saw the FETCH INTO command, I tried = to use it=20 with the PQexecParams but I did not succeeded in.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Is it possible ? if yes how = ?</FONT></DIV> <DIV><FONT face=3DArial size=3D2>thanks</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Mike</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML> ------=_NextPart_000_016E_01C5938C.CEBCEE80--