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

IPCC 5.0 DB command

vinay.rana
Level 1
Level 1

what SQL command in DB read or set command do I use to take the info gather from Get Call Contact Info ?

Any thoughts on how I can look at the first 3 digits of a calling number and do a db read ?

My table has nchar with all area codes and states listed. based on the calling number I need to look into the first 3 digits and look up state.

Calling_Number - string variable

select * from tb_State where AC = $Calling_Number

works but returns 0, as I need to only see the left 3 digits/char. if I issue the same statement in SQL query analyser with the value defined it works.

select * from tb_State where AC = LEFT(6091231234,3) it matches left 609 and returns state info.

But if the use the left statement in IPCC it throws java object error does not like anything after the $ sign with the variable.

Any thoughts on how I can look at the first 3 digits of a calling number and do a db read

3 Replies 3

BCOLE2007
Level 1
Level 1

First let me say if this is useful, I would really appreciate my post being rated.

You need to put spaces between the variable and the parenthesis, The CRS SQL pasrser has a few tricks, this is one.

select * from tb_State

where AC = Left( $Calling_Number ,3)

let me know how it goes

Nope, no go same error, thanks for your help.

Correction:

The trick is space between the parenthesis and the variable (closing and openiing and the ,X char of the left stataement)

left( $variable ,X )

Thanks again for point'in me in the right direction.

Good job!