" /> Database Wizard SQL INSERT statement - Genesys CTI User Forum

Author Topic: Database Wizard SQL INSERT statement  (Read 5976 times)

Offline Overrider

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Database Wizard SQL INSERT statement
« on: October 12, 2010, 11:16:47 AM »
Advertisement
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.

Offline kubikle

  • Full Member
  • ***
  • Posts: 140
  • Karma: 7
Re: Database Wizard SQL INSERT statement
« Reply #1 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)

Offline Overrider

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Re: Database Wizard SQL INSERT statement
« Reply #2 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

Offline Steve

  • Sr. Member
  • ****
  • Posts: 298
  • Karma: 11
Re: Database Wizard SQL INSERT statement
« Reply #3 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?

Offline Overrider

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Re: Database Wizard SQL INSERT statement
« Reply #4 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...

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Database Wizard SQL INSERT statement
« Reply #5 on: October 13, 2010, 02:37:31 PM »
Does URS has a connection to the DAP?

Offline Steve

  • Sr. Member
  • ****
  • Posts: 298
  • Karma: 11
Re: Database Wizard SQL INSERT statement
« Reply #6 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?

Offline Overrider

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Re: Database Wizard SQL INSERT statement
« Reply #7 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.

Offline Overrider

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Re: Database Wizard SQL INSERT statement
« Reply #8 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.

Offline BenTaylor

  • Full Member
  • ***
  • Posts: 107
  • Karma: 4
Re: Database Wizard SQL INSERT statement
« Reply #9 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.

Offline Overrider

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Re: Database Wizard SQL INSERT statement
« Reply #10 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.