Solved

array of domain in a stored procedure

Posted on 2004-08-04
4
2,010 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Read about achieving the basic levels of HRIS security in the workplace.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
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…

734 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