Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 22nd, 2005, 08:49 AM
Michal Hlavac
Guest
 
Posts: n/a
Default Array in stored procedure

DECLARE
groups integer[];
tmp RECORD;
tmpi integer;
BEGIN
FOR tmp IN SELECT i_group_id FROM l_group_to_user WHERE i_user_id =
$1 LOOP
SELECT i_group_id INTO tmpi FROM s_group WHERE i_group_id =
tmp.i_group_id;
groups[] := tmpi;
RETURN NEXT tmp.i_group_id;
END LOOP;
RETURN NULL;
END

hello,

I am using v7.3.5. I cannot fill and use array "groups". It is possible
in stored procedures???
Row: groups[] := tmpi;
returns error: syntax error at or near "["
thanx... miso

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster




  #2  
Old November 22nd, 2005, 08:49 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: Array in stored procedure

Michal Hlavac <hlavki@medium13.sk> writes:[color=blue]
> groups[] := tmpi;
> returns error: syntax error at or near "["[/color]

This is supported in PG 7.4 (although you do need to provide a subscript
expression ...)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.