cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1541
Views
0
Helpful
5
Replies

How to get multiple Rows in UCCX DB

Hi All,

Here is the scenario. One of customer has DB which return the multiple rows of data by querying against one Field.

suppose there is a Field "National ID Number"  which fetches cutomers' more than one account like post paid customer , prepaid customer, corporate customer etc in different Rows then how could i check this if the customer has more than one Account system should ask about the particular Account Number.

any help would be grateful for me.

Thanks

5 Replies 5

Anthony Holloway
Cisco Employee
Cisco Employee

You execute the DB Read step to get the results from the DB, and then execute (multiple times conditionally) the DB Get step to get one record at a time.

So a flow would look like this:

db read

  successful

    label get_next_record

    db get

      successful

        /* do something with these values */

        goto get_next_record

      no data

        goto no_more_records

    ...

...

label no_more_records

Thnx Anthony. Just to clear myself , Let say there is a field Account which contain the multiple records and by the time when i Get the Recrod through Get DB process it will just get one row which is obvious while sending back to lable get_next_record will automatically get the next Row and so on untill i stop the loop ?

You will not have to stop the loop.  It will stop when there is no more data.

One thing you can do is:  Store all of your values into an array, then you have each record in an array element.

Is the following way seem correct to store values in an array var

db read

  successful

    label get_next_record

    db get

      successful

        /* Action to store values in Array variable */

     

                    Array[c]=accno

/* “accno” is a variable with Big Dec Type having all possible values fetched by multiple rows */

                   

                    c=c+1 /* where “c” is an index var */

                    goto get_next_record

     

      no data

        goto no_more_records

    ...

...

label no_more_records

Anthony,

One question on this.  Where would you perform the db release statement?  Would you perform the db release after a successful db get or only after you hit the "No Data" branch?