12-01-2010 01:35 PM - edited 03-14-2019 06:58 AM
All,
Who would have ever thought this was a challenge.. I am trying to find a way to put how many rows were returned by a database read step into a variable somehow, so I know whether there was 0 rows returned / 1 row returned or more then 1 for use in ICM...
Has anyone figured this out, or do I need custom java?
Chad
12-01-2010 01:38 PM
Of course I can do SELECT COUNT(*) FROM TABLE....
but what do I use in the DB Get to put it into a variable since it doesn't have a column name...
12-01-2010 01:43 PM
There is no function to return how many rows were returned from a
query as far as I know, if you want to count them you need to use a
loop and a counter until db read step stops returning results.
int count;
Increment:
result = DBRead();
if (result != NULL)
{
count = count +1
goto Increment
}
//count has number of rows returned.
Something like that should work..
On Wed, Dec 1, 2010 at 1:36 PM, chadstachowicz
12-01-2010 02:10 PM
Tanner,
Got it figure out easier.. I did a
SELECT COUNT(*) AS ROW_ID FROM TABLE
In this statement ROW_ID must be a valid row in the database so IP IVR Lets u choose it...
Then I just did DB Get on ROW_ID and I have the total rows!
Thanks for the idea as well!
Chad
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide