Solved

array of domain in a stored procedure

Posted on 2004-08-04
4
2,000 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
  • 2
4 Comments
 
LVL 19

Expert Comment

by:NickUpson
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I went for a temp table .. less code and more flexibility :)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now