Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: Overrider on October 12, 2010, 11:16:47 AM

Title: Database Wizard SQL INSERT statement
Post by: Overrider on October 12, 2010, 11:16:47 AM
Is it possible to insert data into database using database wizardb in IRD?
I use database wizard type of query, and following sql script:
[code]INSERT INTO dbo.IVR_steps
Values(date1,time1,nodename1)[/code]
it works fine in query analyser, but in strategy it just do nothing. I can't see any added rows or any sql activity in DBS log.
It's MSSQL 2000.
Title: Re: Database Wizard SQL INSERT statement
Post by: kubikle on October 12, 2010, 09:49:49 PM
What if you try insert with constants values (not variables) like
insert into customers values ("Customer",22)
Title: Re: Database Wizard SQL INSERT statement
Post by: Overrider on October 13, 2010, 06:23:50 AM
result of
[code]INSERT INTO dbo.IVR_steps
Values ("date","time","nodename")[/code]
still the same. no activity
Title: Re: Database Wizard SQL INSERT statement
Post by: Steve on October 13, 2010, 08:43:00 AM
When you say it works fine in Query Analyser, is that running on the same machine that is running URS ? or is it running directly on the database server?

Can you get the strategy to run a select query on the database?
Title: Re: Database Wizard SQL INSERT statement
Post by: Overrider on October 13, 2010, 10:58:39 AM
[quote]When you say it works fine in Query Analyser, is that running on the same machine that is running URS ?[/quote]
Query analyser is on seperate machine from SQL and URS. But what is the point of this question? Isn't it dataserver (not URS) should be responsible for database operations? btw dataserver is on the same machine where I tried Query Analyser.

[quote]Can you get the strategy to run a select query on the database?[/quote]
Damn, it also does not work. Return empty result...
Title: Re: Database Wizard SQL INSERT statement
Post by: cavagnaro on October 13, 2010, 02:37:31 PM
Does URS has a connection to the DAP?
Title: Re: Database Wizard SQL INSERT statement
Post by: Steve on October 13, 2010, 04:26:38 PM
[quote]Query analyser is on seperate machine from SQL and URS. But what is the point of this question? Isn't it dataserver (not URS) should be responsible for database operations?[/quote]
If query analyser is on the same server as the database, then there is no network involved, so client and server should be able to talk to each other.
When you use a strategy, URS makes the request to the database via the dbserver (DAP). The DAP converts the URS request from T-Lib to the correct SQL for your database, in this case MSSQL.

Can you connect to the database using ODBC test from the client?

As Cav says "Does URS has a connection to the DAP?" What do the logs here say?
Title: Re: Database Wizard SQL INSERT statement
Post by: Overrider on October 14, 2010, 05:03:35 AM
[quote author=cavagnaro link=topic=5932.msg25810#msg25810 date=1286980651]
Does URS has a connection to the DAP?
[/quote]
Thanks a lot! This was what I loose sight of. Now it's works perfectly.
Title: Re: Database Wizard SQL INSERT statement
Post by: Overrider on October 14, 2010, 05:27:06 AM
[quote author=Overrider link=topic=5932.msg25824#msg25824 date=1287032615]
[quote author=cavagnaro link=topic=5932.msg25810#msg25810 date=1286980651]
Does URS has a connection to the DAP?
[/quote]
Thanks a lot! This was what I loose sight of. Now it's works perfectly.
[/quote]
Oh, I'm was to fast to exult...
It works perfectly with constants, but variables are not working.
If al the three values are constatnts, insret occurs, if even one of values is variable, no insert occurs. Still digging.
Title: Re: Database Wizard SQL INSERT statement
Post by: BenTaylor on October 14, 2010, 08:16:55 AM
Would it not be easier to use a stored procedure for the inserts?

That way you coud use your variables.
Title: Re: Database Wizard SQL INSERT statement
Post by: Overrider on October 14, 2010, 01:59:03 PM
[quote author=BenTaylor link=topic=5932.msg25827#msg25827 date=1287044215]
Would it not be easier to use a stored procedure for the inserts?

That way you coud use your variables.
[/quote]
Yes, stored procedure did the job. But i'ts definetely not easier.