Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

array of domain in a stored procedure

Posted on 2004-08-04
4
Medium Priority
?
2,022 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
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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
What we learned in Webroot's webinar on multi-vector protection.
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

824 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