473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

Nov 22 '05 #1
1 10183
Michal Hlavac <hl****@medium13.sk> writes:
groups[] := tmpi;
returns error: syntax error at or near "["


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

Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John Wilson | last post by:
Hello, I have the following code which populates as table data from a SQL Server 2000 stored proc (RSByDemoID2). Below that is the view and stored procedure which takes @DemoID as input to match...
4
by: Michael Trosen | last post by:
Hi Everyone, I hope someone can help, I'm pretty new to pro*c programming. I have the following application setup: a pro*c program calls a stored procedure and recieves a cursor back: the...
2
by: The Plankmeister | last post by:
Hi there... Is it possible to write an UPDATE or INSERT query, where the new value comes from an array? For example: UPDATE table_a SET column_x = WHERE column_y = ; It's a query (for...
2
by: Nelson Xu | last post by:
Hi All Does anyone knows how to pass an array from .net application to oracle stored procedure Thank you in advance Nelson
8
by: Viator | last post by:
Hi All; I am working on project; where I need to call a DB2 stored procedure (also to be written in the project) which will update/insert some records in the database. The number of rows to be...
1
by: Jim H | last post by:
I am on a project where I am supposed to send an XML document to a SQL Server stored procedure. The XML Doc is a list strings. If in my c# function I get a list values as (string psValueList),...
4
by: Amy | last post by:
Hello, I've been struggling to learn C#.NET for a while now. I've made some progress, but I'm easily stumped. :( What's stumping me today is this: I've got a stored procedure (SQL) that...
1
by: BobRoyAce | last post by:
I have a class that has several Subs that do DB things, some of which require the same set of parameters to be passed to a stored procedure. One class has 12 parameters and part of code used to...
2
by: BobRoyAce | last post by:
I currently have code similar to the following in a few places in my application: cmd.Connection = New SqlClient.SqlConnection(My.Settings.CERMITSConnectionString) cmd.CommandType =...
4
by: aaron80v | last post by:
Hi, Currently I am embarked on a project that requires me to define and pass array to stored procedure, and I found out that there is no direct way to do this. I wonder if a combination of UDF...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.