Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id XAA45400; Wed, 19 Apr 2000 23:16:05 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id XAA00405; Wed, 19 Apr 2000 23:14:13 -0400 (EDT) To: ganesanm cc: pgsql-interfaces@postgresql.org, Michael Meskes Subject: Re: How do I select nth row from a table In-reply-to: <38FE2289.E4A5E849@technauts.com> References: <38FE2289.E4A5E849@technauts.com> Comments: In-reply-to ganesanm message dated "Wed, 19 Apr 2000 17:18:01 -0400" Date: Wed, 19 Apr 2000 23:14:13 -0400 Message-ID: <402.956200453@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200004/158 ganesanm writes: > How can I incorporate this query in an embedded sql ?? > I tried the following but ecpg returned error on the last > line. > exec sql > select mfl_size into :mfl_size > from mail_file_dtl > where mfl_recipient = :mfl_recipient > order by mfl_file_name limit 1 offset = :nNumber ; > Can a variable name be used in the offset option to pass > the value ? It looks like not, at the moment. I think the grammar for ecpg needs to accept a "cvariable" in places where the underlying backend grammar only accepts an ICONST. It's probably too late to fix this for 7.0, but it should be a todo item for 7.1... regards, tom lane