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. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Is SELECT MAX(*) Supported?

I'm trying to grab the latest date from our table in a DB Read step.

Reading the Step Reference documentation, it indicates that only SELECT COUNT(*) and SELECT MIN(*) are not supported functions. So SELECT MAX(*) should work, right?

When I do my Reactive Script, that step fails with that blank pop up.

So is SELECT MAX(*) not allowed?

How would I go about grabbing the latest date?

Do I need to put my values in an array and then use expressions to grab the max?

I'm looking with my other DB admin to see if there's an alternate SQL query we can use.

Everyone's tags (4)
3 REPLIES
Green

Is SELECT MAX(*) Supported?

how about

SELECT TOP 1 * FROM xxx WHERE aa=bb ORDER BY cc DESC

Is that allowed?

Regards,

Geoff

Is SELECT MAX(*) Supported?

Hi,

I guess (almost) everything is supported, as long as you make the UCCX believe it sees the right column.

First, create a dummy table or view - one column would do, in this case. For instance:

CREATE TABLE mytable (myData INT)

Then map the UCCX step to this dummy table - even though there's no data.

The only thing to remember is to use the correct column alias, from that dummy table, in this case, myData. Like this:

SELECT MAX(column) AS [myData] FROM table WHERE foo=bar

G.

Green

Is SELECT MAX(*) Supported?

Ah, that's right. Now I remember the hoops you have to jump through. That's why I always preferred the Create Java Element method.

Regards,

Geoff

355
Views
0
Helpful
3
Replies