Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

variable fields in procedure output

Posted on 2011-03-02
3
Medium Priority
?
619 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 1000 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 1000 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

705 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