cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
370
Views
0
Helpful
3
Replies
Highlighted
Beginner

CRA: DB Get(): obtaining fields that are not in table structure

Hello,

I'm issuing a DB Read that does some calculations and returns a recordset where the columns cannot be mapped to a given table. For example, "select sum(col1) as total from Sales".

The field "total" is not in the Sales table and therefore cannot be mapped to a variable using the standard DB Get method. Perhaps you can suggest the work-around for this.

Thanks,

Andrew

3 REPLIES 3
Highlighted
Enthusiast

Re: CRA: DB Get(): obtaining fields that are not in table struct

Hi Andrew,

can you try out as following

SQL query - Select sum(col1) col1 from sales.

Map the col1 to some local variable.

Note : you should use the same field name in alias also.

Try and let me know the result.

Regards

Yogi

Highlighted
Beginner

Re: CRA: DB Get(): obtaining fields that are not in table struct

That's a pretty clever workaround Yog, and will probably work under certain situations. What would you do if none of the column's data types match the variable that you would map them to? For example, you may want to average something where the result would be a decimal or float. If your table columns are only integer and string, you're stuck.

Luckily, in this situation the only manipulation that is needed is with date/time fields and I can do that on the IVR instead of the database.

Thanks for your reponse, as always.

-Andrew

Highlighted
Enthusiast

Re: CRA: DB Get(): obtaining fields that are not in table struct

Hi,

One method which I could think is developing custom java classes and using the same from CRS editor.

For creating custom java classes refer the following...

For CRA 2.2

http://www.cisco.com/univercd/cc/td/doc/product/voice/sw_ap_to/apps_22/dev_gd/sdkdeplo.pdf

From IPCC Express 3.0 and above, the documentation comes along with the software package. Check the same in IPCC Express Server

under Start->Programs->Cisco CRA Administrator->Component Developers Guide.

Regards

Yogi