Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Return Result of DB Read Step (UCCX 5.0(2))

Hi,

is it possible to get the information from a DB Read Step how many results the query founds. I can only see the number of results when I test the query, but I want to store the number of results in a variable!

System: UCCX 5.0(2)

Regards

alex

1 ACCEPTED SOLUTION

Accepted Solutions
Bronze

Re: Return Result of DB Read Step (UCCX 5.0(2))

Hi Alexander,

Option1:Database View

1)Create a view with the Select count(*) from table in it, name the field in the view definition. Test the view

2) Refresh your CRS schema,

3) use the View in your DbRead and DBGet

Option 2: Database Table

1) In the SQL for the DBread give the count(*) a name ,

select count(*) as total from table

2)On your database, create a table to use as a Work Record, name the field the same as the select statements as.

This will never have any records in it and you will use in your DBget

2.5) Refresh your schema to see the Work Record

3) In your DB Get at the Table/View drop down

pick your Work Record table and map it to the CRS variable you want to capture the count into.

I tend to use Option 2, creating 1 Work Record with multiple fields in it to use for a variety of SQL statements, ensuring to name them the same in the Select.

Please rate this post if it helps

Blair

3 REPLIES
Bronze

Re: Return Result of DB Read Step (UCCX 5.0(2))

Have you tried a Select Count(*) SQL statement?

New Member

Re: Return Result of DB Read Step (UCCX 5.0(2))

Yes, but in the DB Read Step I can't define the variable, where the result is stored!

Bronze

Re: Return Result of DB Read Step (UCCX 5.0(2))

Hi Alexander,

Option1:Database View

1)Create a view with the Select count(*) from table in it, name the field in the view definition. Test the view

2) Refresh your CRS schema,

3) use the View in your DbRead and DBGet

Option 2: Database Table

1) In the SQL for the DBread give the count(*) a name ,

select count(*) as total from table

2)On your database, create a table to use as a Work Record, name the field the same as the select statements as.

This will never have any records in it and you will use in your DBget

2.5) Refresh your schema to see the Work Record

3) In your DB Get at the Table/View drop down

pick your Work Record table and map it to the CRS variable you want to capture the count into.

I tend to use Option 2, creating 1 Work Record with multiple fields in it to use for a variety of SQL statements, ensuring to name them the same in the Select.

Please rate this post if it helps

Blair

780
Views
0
Helpful
3
Replies