pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rajesh Kumar Mallah <mallah.rajesh@gmail.com>
To: Chethana, Rao (IE10) <Chethana.Rao@honeywell.com>
Cc: theodoreloscalzo@mac.com, "Richard Huxton" <dev@archonet.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: pls reply ASAP
Date: Sun, 9 Apr 2006 21:04:43 +0530
Message-ID: <a97c77030604090834r683b2a27kfddadc8f72f74927@mail.gmail.com> (raw)
In-Reply-To: <C7AD32F362B7914488D0267D1537DDC9CDDE6A@AZ18EV805.global.ds.honeywell.com>
References: <C7AD32F362B7914488D0267D1537DDC9CDDE6A@AZ18EV805.global.ds.honeywell.com>

On 4/9/06, Chethana, Rao (IE10) <Chethana.Rao@honeywell.com> wrote:
>
>
>
>
> Hello!
>
>
>
> Kindly go through the following ,
>
>
>
>
>
> I wanted to know whether, the command line arguments(function arguments)
------  $1 $2 $3   --  can be used  as in the following , like, ----
>
>
>
>
>
> CREATE TYPE TT AS(something,something,…………………………………………………………etc………………);
>
> CREATE OR REPLACE FUNCTION f1(varchar,varchar,varchar,varchar) RETURNS
…………………..(something)………….
>

the overall idea expressed is doable.
following are comments

1. you have to put RETURNS setof TT (if you plan to return TT) since you
used RETURN NEXT
2.  you have to use SELECT INTO rec  in the function where rec is rowtype TT

hope it helps

------- non technical comments
------------------------------------------------------
3. its not a performance question , it shud have been marked more
appropriately to pgsql-sql  i think.
4. its not a good etiquette to address email to someone and mark Cc to a
list.

kind regds
mallah.

>
>
> BEGIN
>
>  SELECT a1,a2,a3,a4,a5,a6
>
>  FROM (SELECT * FROM T1, T2……WHERE …………etc…   Flag = 0   $1 $2 $3 $4)
>
>  ORDER BY
……………………
>
> ………………………….
>
> RETURN NEXT ………;
>
>   END LOOP;
>
>   RETURN;
>
> END;
>
> ' LANGUAGE 'plpgsql';
>
>
>
> NOTE :    The values for  $1 $2 $3 $4  will be passed when the function is
invoked(called)  from the command prompt.
>
>
>
> I  tried implementing the above, but  this type of usage is not supported
, how should use it?
>
>
>
>  I am converting  from (sprintf, "SELECT query stmts (which uses   %s %s
%s %s  …… )        to functions.
>
>
>
>
>
> Any help will be deeply appreciated.  Thank you.
>
>
>
>
>
> Kind regards,
>
>       Chethana.
>
>
>
>
>
>

view thread (4+ messages)

Message-ID: <a97c77030604090834r683b2a27kfddadc8f72f74927@mail.gmail.com>
Permalink:  ../a97c77030604090834r683b2a27kfddadc8f72f74927@mail.gmail.com/
Also on:    postgresql.org/message-id/a97c77030604090834r683b2a27kfddadc8f72f74927@mail.gmail.com

 · 

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-performance@postgresql.org
  Cc: mallah.rajesh@gmail.com, Chethana.Rao@honeywell.com, dev@archonet.com
  Subject: Re: pls reply ASAP
  In-Reply-To: <a97c77030604090834r683b2a27kfddadc8f72f74927@mail.gmail.com>

* 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