pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ganesanm <ganesanm@technauts.com>
Cc: pgsql-interfaces@postgresql.org, Michael Meskes <meskes@postgresql.org>
Subject: Re: How do I select nth row from a table
Date: Wed, 19 Apr 2000 23:14:13 -0400
Message-ID: <402.956200453@sss.pgh.pa.us> (raw)
In-Reply-To: <38FE2289.E4A5E849@technauts.com>
References: <38FE2289.E4A5E849@technauts.com>

ganesanm <ganesanm@technauts.com> 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



view thread (4+ messages)  latest in thread

Message-ID: <402.956200453@sss.pgh.pa.us>
Permalink:  ../402.956200453@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/402.956200453@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ganesanm@technauts.com, meskes@postgresql.org
  Subject: Re: How do I select nth row from a table
  In-Reply-To: <402.956200453@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox