" /> OCS HTTP - AddRecord with DateTime field - Genesys CTI User Forum

Author Topic: OCS HTTP - AddRecord with DateTime field  (Read 2247 times)

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
OCS HTTP - AddRecord with DateTime field
« on: July 21, 2018, 07:02:27 PM »
Advertisement
Hi guys
Any of you have achieved to do AddRecord via HTTP on OCS and add a custom field with date time?
I can do the date part by sending it as "dd/mm/yyyy" but if I send the "dd/mm/yyyy hh:mm:ss" it doesn't work, and in this case Oracle complains...
Then tried to do TO_DATE() function, but even OCS accepted it, it never sent over to Oracle, the field was not sent in request.


Any idea?

Offline vmc

  • Full Member
  • ***
  • Posts: 112
  • Karma: 0
Re: OCS HTTP - AddRecord with DateTime field
« Reply #1 on: July 21, 2018, 11:02:22 PM »
What's the oracle error and what is the column type in the schema?

Sent from my Redmi Note 3 using Tapatalk


Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: OCS HTTP - AddRecord with DateTime field
« Reply #2 on: July 21, 2018, 11:43:01 PM »

If for example I add:'DATE_AC' '16/07/2018 13:30:00'


Then Oracle returns:


'GSW_ERROR' 'ORA-01830: date format picture ends before converting entire input string'


I have tried many date formats.
The field at CME is defined as datetime.


At the DB the field is a Date type


Offline hsujdik

  • Hero Member
  • *****
  • Posts: 541
  • Karma: 30
Re: OCS HTTP - AddRecord with DateTime field
« Reply #3 on: July 22, 2018, 05:41:18 PM »
Try this:

On the DBServer host that OCS uses to connect to the Oracle Database, set the environment variable NLS_DATE_FORMAT=dd/mm/yyyy hh24:mi:ss

A restart of  DBServer would be required.



Enviado do meu iPhone usando Tapatalk

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: OCS HTTP - AddRecord with DateTime field
« Reply #4 on: July 22, 2018, 06:08:01 PM »
Yeah that is my next idea on my list but I am kinda doubtful on which impact would it have on the PRD environment.