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

DB Get and select count(*)

I need to find out how many records of type X I have in the database.

Since select count(*) is not supported , I was thinking of using something like

SELECT count(distinct(XXX)) from YYY (xxx are unique values)

Is it possible to assign the returned result to a variable and how.

DB Get only seems to be able to get columns values.

Thanks

3 REPLIES
Bronze

Re: DB Get and select count(*)

I am just wondering if the query Select AgentsLoggedOn from Peripheral_Real_Time will give the count.

New Member

Re: DB Get and select count(*)

No for my purpose.

I'm accessing my own SQL database and need to find out the number of rows for specific queries.

The only way I've found to do this, is to loop on DB Get until I get "No data"

Not efficient , but it works for what I need

New Member

Re: DB Get and select count(*)

try to create a view :

create view nbRowfromYYYY

as

SELECT count(distinct(XXX))as NbRow from YYY

then use the DB Read step (select NbRow from nbRowfromYYYY), then the DB Get step.

142
Views
0
Helpful
3
Replies
CreatePlease to create content