cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
415
Views
3
Helpful
3
Replies

SQL error when accessing database..

steffenluttge
Level 1
Level 1

Im using this sql select for retrieving som historical data :

select CSQ, sum(kaldIalt), sum(KaldTabt) from DEV_CSQR where Dato between '09/1/09' and '10/31/09' group by CSQ

When testing it - it returns 17 rows - working as designed.

when debugged, the DB Read works fine,

but the first DB get, throws a SQL error.

I think it's because of the sum.

Are there any way to get it working, without dropping the sum.

Regards

Steffen

3 Replies 3

geoff
Level 10
Level 10

It is because of the SUM. If I recall correctly, the DB Get can only work on columns - be they in tables or in table views. I first encountered this when I wanted to return COUNT (*) to get the number of rows in a database matching X. There may be a workaround for that by now.

In your case, you may have to write a Java class that does the business. I prefer that method and don't use the DB steps, as it gives much more control over the results returning, complex SQL and stored procedure calls - but I'm a programmer.

Regards,

Geoff

ok..

In the step reference, they doesn't mention sum, but count - as not working.

i rewrote the script instead manually suming the total & missed calls.

Regards

Steffen

Very good. It's working OK?

Regards,

Geoff

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: