Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: soyoung on June 27, 2018, 06:13:02 AM

Title: How to use variable of SQL query in IRD
Post by: soyoung on June 27, 2018, 06:13:02 AM
Hi... :)
Can you help me ?
I Want to insert to ANI in the database.

[b]Select * from dbo.aniTB Where Ani = ani[/b]<<<-----(variable of ani[] in IRD)

it is woking. i did get the name of the corresponding ani.
but, i can't  Insert Statement...


[b]Insert into  dbo.aniTB Values("ani") [/b]

that's okay ... as String "ani"
but i want to use ani as variable(variable of ani[] in IRD)

it could be used in Select query , but not working in Insert query

Do you know how to use variable?? :-[

Thank you.. :-*

Title: Re: How to use variable of SQL query in IRD
Post by: vmc on June 27, 2018, 06:42:31 AM
Need to use a stored procedure and pass the variables to that.

Sent from my Redmi Note 3 using Tapatalk

Title: Re: How to use variable of SQL query in IRD
Post by: soyoung on June 28, 2018, 02:50:05 AM
Thank you..!!

I done that!! i share my query :P


------------------------------------------------------------

<SQL server>

CREATE PROCEDURE InsertTB @a varchar(50), @b varchar(50)  AS
INSERT INTO dbo.aniTB(test1, test2) VALUES (@a, @b)


-------------------------------------------------------------

<IRD>

EXEC InsertTB @a = [b]ani[/b] , @b = [b]ConID[/b] <<----------(variables in IRD)

-----------------------------------------------------
Title: Re: How to use variable of SQL query in IRD
Post by: terry on June 28, 2018, 05:51:25 AM
IRD automatically turns variables into values only if they follow some comparing/assigning sign like =, >, <, <=,  etc.