Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Need to receive result of multible function calls on one result sheet

leonidos's profile image leonidos posted 1 month ago in General Permalink

Hello together,

I want to call a function thousend times

SELECT databaseScheme.getData(1394)AS ID; SELECT databaseScheme.getData(1395)AS ID; SELECT databaseScheme.getData(1396)AS ID; . . . SELECT databaseScheme.getData(2394)AS ID;

I don't want to receive 1000 result sheets, but want all results on one result sheet.

Is this possible? If yes, how can I do this?

Thanks before

Regards

Leo

ansgar's profile image ansgar posted 1 month ago Permalink

That should be doable with multiple columns in one result:

SELECT myscheme.myfunc(123), myscheme.myfunc(345), ...

Or, if you want one column and multiple rows, you can merge them via UNION:

SELECT myscheme.myfunc(123)
UNION
SELECT myscheme.myfunc(345)
UNION
...
leonidos's profile image leonidos posted 1 month ago Permalink

Hey ansgar,

thats the solution

many thanks.

Leo

leonidos's profile image leonidos posted 1 month ago Permalink

PS: I used the second suggestion :)

Please login to leave a reply, or register at first.