• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 629
  • Last Modified:

variable fields in procedure output

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
ExDev001
Asked:
ExDev001
2 Solutions
 
reb73Commented:
Can you not use a single output column with a delimited list (eg CSV)?
0
 
NickUpsonSenior Network EngineerCommented:
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
 
ExDev001Author Commented:
thanks! I will try this!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now