02-22-2008 04:48 PM - edited 03-14-2019 01:53 AM
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
02-23-2008 08:33 AM
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
02-23-2008 11:38 AM
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.
02-25-2008 09:29 AM
Good job!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide