Solved

array of domain in a stored procedure

Posted on 2004-08-04
4
2,013 Views
Last Modified: 2013-12-09
is there a way to create an array of some domain ? the domain would have a few fields like:

TKnjizba = record
  RecID: Integer;
  Kolicina: Double;
  Cena: Double;
  Vrednost: Double;
  P1: Integer;
end;

TKnjizbe = array of TKnjizba;


I'd really prefer the array approach over a temp table approach
is this at all possible ?

using FireBird 1.5

tnx
0
Comment
Question by:Lee_Nover
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 19

Expert Comment

by:NickUpson
ID: 11714229
you can't have an array of a structure,  the best you can get is an array of one type

RecID INTEGER [10],

for example.

Temporary tables, as such, don't exist in firebird either due to limits on how many create/drop's you can do before a backup & restore are required. The best solution is usually to create the table permanently and just populate/delete as required.

I normally find that a table as above and a select loop through it avoid the need for arrays, which do have a fixed size unlike tables.
0
 
LVL 12

Author Comment

by:Lee_Nover
ID: 11714280
fixed size arrays for each field is no good .. I'm better off with a temp table then :)
tnx
0
 
LVL 10

Accepted Solution

by:
kacor earned 500 total points
ID: 11730322
Some remarks on using array-based columns:

InterBase (I don't know FireBird) allows you to define a column as an array of elements. You can then manage the entire array as a single entity, as a series of elements in one dimension of the array, or as individual elements.

Array-based columns cannot be addressed using standard interactive SQL. Arrays are provided for applications that use embedded or dynamic SQL statements within the compiled application.

The RDBMS-experts don't support/suggest the array-based columns because it's use hurts the most rules of a good RDBMS otherwise InterBase supports this data handling only very poor. I suggest the use of standard columns instead.

If you decide to use array-based columns you have to solve/program all data handling tasks. And this is not simple.

wbr

kacor
0
 
LVL 12

Author Comment

by:Lee_Nover
ID: 11941000
I went for a temp table .. less code and more flexibility :)
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question