cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
914
Views
4
Helpful
3
Replies

Row Count in IP IVR / UCCX

Chad Stachowicz
Level 6
Level 6

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

3 Replies 3

Chad Stachowicz
Level 6
Level 6

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...

Tanner Ezell
Level 4
Level 4

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

Tanner Ezell www.ctilogic.com

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