SQL Update from GCCS Script

Aug 20, 2014 03:35 AM PDT
Tudor Adrian Negru
FCS Cumarasaid Teo (T/A FCS Global)
Hi all,

I'm wondering does anybody know how to do a SQL database update through a GCCS script please?

The ODBC link is fine and pulling data from the database is OK but I need to provide a sort of self-service feature where the caller can adjust their order size when dialing into the script.

Basically I'll need to store the new order into a Call Profile and have that value written to the database..

I've tried using the "SQL Execut" block with something like "update table set order = "%new-value%" where id = "%orderno%"

Has anyone managed to get something like this working please? It's not for me; I might be missing something on the SQL side of things??

Thanks.
Aug 20, 2014 03:25 PM PDT
Open Office
Communications Resources Incorporated aka CRI
What is the call profile name? I don't see it in your statement. It should look something like: update accounts set password = %ACHK_Password% where account_no = %ACHK_Account_Num%

%ACHK_Password% and %ACHK_Account_Num% are call profiles.
Aug 21, 2014 01:49 AM PDT
Tudor Adrian Negru
FCS Cumarasaid Teo (T/A FCS Global)
Hi Edna, The call profile values in my statement would be '%new-value%' and '%orderno%' and the statement looks like:

update table set order='%new-value%' where id='%orderno%' (I've removed the " and inserted the ' for values)

Have you ever had this working I wonder? I know that UPDATE works with Dial Lists but I need to use it in a GCCS script inside the SQL Execute block.. I can use INSERT INTO, works fine, but this only allows me to insert new records into the database or into a new database and not update existing ones.. kind of a bummer.
Aug 21, 2014 01:05 PM PDT
Tudor Adrian Negru
FCS Cumarasaid Teo (T/A FCS Global)
Right...just got this one sorted..I was using a MS Access database and it seems that there might have been some word reservation so I had to use square brackets [] to select the fields I wanted to edit :) My UPDATE syntax looks something like this now:

update table set [order]='%new-value%' where [id]='%orderno%'

All good .. for now :)
Aug 22, 2014 06:42 AM PDT
Open Office
Communications Resources Incorporated aka CRI
Good to know!

To reply to this post please Sign In