11-14-2010 11:22 PM - edited 03-14-2019 06:53 AM
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
11-15-2010 03:43 PM
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
11-15-2010 09:45 PM
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 ?
11-16-2010 06:36 AM
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.
11-18-2010 02:11 AM
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
01-11-2011 11:03 AM
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?
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