pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Possible to have array as input paramter for a function?
3+ messages / 2 participants
[nested] [flat]

* Possible to have array as input paramter for a function?
@ 2003-10-08 10:47  Kumar <sgnerd@yahoo.com.sg>
  0 siblings, 2 replies; 3+ messages in thread

From: Kumar @ 2003-10-08 10:47 UTC (permalink / raw)
  To: pgsql-sql

Dear Friends,

I am working with Postgres 7.3.4 on RH Linux 7.2 and my windows client is PgAdmin 3.

Is it possible to pass a Varchar[] as a input parameter for a PL/pgSQL function. While I tried it give a error 
    Type "varchar[]" does not exists.

Does this is supported in Postgres?

Anyone have a link or while paper on handling arrays in functions?

Please enlighten me on this.

Regards
Kumar

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Possible to have array as input paramter for a function?
@ 2003-10-08 12:50  George Weaver <georgew1@mts.net>
  parent: Kumar <sgnerd@yahoo.com.sg>
  1 sibling, 0 replies; 3+ messages in thread

From: George Weaver @ 2003-10-08 12:50 UTC (permalink / raw)
  To: Kumar <sgnerd@yahoo.com.sg>; pgsql-sql

Hi Kumar,

It is possible to pass an array to a PL/pgSQL function, but I believe you must specify the length of the array (at least doing so works for me). E.g. "varchar(20)".

Regards,
George
  ----- Original Message ----- 
  From: Kumar 
  To: psql 
  Sent: Wednesday, October 08, 2003 5:47 AM
  Subject: [SQL] Possible to have array as input paramter for a function?


  Dear Friends,

  I am working with Postgres 7.3.4 on RH Linux 7.2 and my windows client is PgAdmin 3.

  Is it possible to pass a Varchar[] as a input parameter for a PL/pgSQL function. While I tried it give a error 
      Type "varchar[]" does not exists.

  Does this is supported in Postgres?

  Anyone have a link or while paper on handling arrays in functions?

  Please enlighten me on this.

  Regards
  Kumar

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Possible to have array as input paramter for a function?
@ 2003-10-08 14:06  George Weaver <georgew1@mts.net>
  parent: Kumar <sgnerd@yahoo.com.sg>
  1 sibling, 0 replies; 3+ messages in thread

From: George Weaver @ 2003-10-08 14:06 UTC (permalink / raw)
  To: Kumar <sgnerd@yahoo.com.sg>; pgsql-sql

Hi Kumar,

Looks like I got up too early this morning - please ignore my previous reply re: varchar(30) (I was looking at the wrong function :-(  ). 

I do use arrays in Pl/pgSQL functions, and have defined them as you did, e.g. varchar[], which does not return an error.  What version of PostgreSQL are you using?  I am running 7.3.2.

Regards,
George
  ----- Original Message ----- 
  From: Kumar 
  To: psql 
  Sent: Wednesday, October 08, 2003 5:47 AM
  Subject: [SQL] Possible to have array as input paramter for a function?


  Dear Friends,

  I am working with Postgres 7.3.4 on RH Linux 7.2 and my windows client is PgAdmin 3.

  Is it possible to pass a Varchar[] as a input parameter for a PL/pgSQL function. While I tried it give a error 
      Type "varchar[]" does not exists.

  Does this is supported in Postgres?

  Anyone have a link or while paper on handling arrays in functions?

  Please enlighten me on this.

  Regards
  Kumar

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-10-08 14:06 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-10-08 10:47 Possible to have array as input paramter for a function? Kumar <sgnerd@yahoo.com.sg>
2003-10-08 12:50 ` George Weaver <georgew1@mts.net>
2003-10-08 14:06 ` George Weaver <georgew1@mts.net>

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