" /> How to use variable of SQL query in IRD - Genesys CTI User Forum

Author Topic: How to use variable of SQL query in IRD  (Read 2280 times)

Offline soyoung

  • Newbie
  • *
  • Posts: 23
  • Karma: 0
How to use variable of SQL query in IRD
« on: June 27, 2018, 06:13:02 AM »
Advertisement
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.. :-*

« Last Edit: June 27, 2018, 06:19:04 AM by soyoung »

Marked as best answer by victor on July 03, 2018, 04:09:27 PM

Offline vmc

  • Full Member
  • ***
  • Posts: 112
  • Karma: 0
Re: How to use variable of SQL query in IRD
« Reply #1 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


Offline soyoung

  • Newbie
  • *
  • Posts: 23
  • Karma: 0
Re: How to use variable of SQL query in IRD
« Reply #2 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)

-----------------------------------------------------
« Last Edit: June 28, 2018, 02:52:07 AM by soyoung »

Offline terry

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: 35
Re: How to use variable of SQL query in IRD
« Reply #3 on: June 28, 2018, 05:51:25 AM »
IRD automatically turns variables into values only if they follow some comparing/assigning sign like =, >, <, <=,  etc.