Solved

variable fields in procedure output

Posted on 2011-03-02
3
596 Views
Last Modified: 2012-05-11
Hi all!
I use firebird 2.5.
It's possible make variable the number of fields in output procedure?
I would need to return a set of fields, but depending on what the user asked (depends on a parameter input), I might return 1 or 100. One solution is to declare the 100 fields in output, but I wanted to know if there are other methods
thanks!
0
Comment
Question by:ExDev001
[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
3 Comments
 
LVL 25

Accepted Solution

by:
reb73 earned 250 total points
ID: 35016352
Can you not use a single output column with a delimited list (eg CSV)?
0
 
LVL 19

Assisted Solution

by:NickUpson
NickUpson earned 250 total points
ID: 35016421
the answer to your actual question is no, there is no way to have a procedure that returns a variable number of parameters

however, as mentioned, concatinating them together into one (possible CSV) parameter is perfectly possible, just a bit tedious in the code as you will need the following

if (var not null) then
  output = output || ',' || var

for all 100 vars
0
 

Author Comment

by:ExDev001
ID: 35027073
thanks! I will try this!
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
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…

735 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