1. Carl Bolduc
  2. PowerServer
  3. Wednesday, 13 December 2023 22:02 PM UTC

We migrated an application to PowerServer and deployed it inside IIS on an Azure server. Most of the functionalities are working as expected except for one DataWindow. When running the application, we get this error after loading the DataWindow:
1861 Select Error: ORA-01861: literal does not match format string.

While trying to figure this out, I debugged the application locally using the Kestrel server and I could not reproduce the error, everything works.

The SQL query of the associated DataWindow works when executed in PLSQL Developer.

What could prevent this DataWindow from working specifically on the Azure server?

Accepted Answer
Carl Bolduc Accepted Answer Pending Moderation
  1. Friday, 15 December 2023 21:59 PM UTC
  2. PowerServer
  3. # Permalink

Changing the default format did not help.

It turns out we have date comparisons with string in our DataWindows. For some reason, running those queries from the Azure server doesn't work. We changed to SQL to have explicit TO_DATE(...) around the strings which are compared with date columns, and it fixed the issue.

Comment
  1. Armeen Mazda @Appeon
  2. Monday, 18 December 2023 16:01 PM UTC
Thanks for sharing the solution!
  1. Helpful
  1. mike S
  2. Monday, 18 December 2023 16:14 PM UTC
are you saying that you are sending a string as an argument (instead of a date type argument) to a datawindow that compares date column data?
  1. Helpful
  1. Carl Bolduc
  2. Monday, 18 December 2023 16:35 PM UTC
No, the problem was in the SQL query itself. We have comparisons between date columns and hard coded strings (dates represented as strings). We are in the process of converting those strings to dates in the SQL so that the comparisons is always made between dates to avoid formatting issues based on drivers and OS region settings.
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Wednesday, 13 December 2023 22:16 PM UTC
  2. PowerServer
  3. # 1

oracle - SQL Error: ORA-01861: literal does not match format string 01861 - Stack Overflow

sql - what should i do i keep getting ORA-01861: literal does not match format string ORA-06512: at "SYS.DBMS_SQL", line 1721 - Stack Overflow

 

most likely the default for the date format is not set?  if it takes it from the server settings, did you set the date default setting on your IIS server?

you may need to do something in the c#? 

Comment
There are no comments made yet.
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 13 December 2023 22:05 PM UTC
  2. PowerServer
  3. # 2

Hi Carl,

Are you connecting to the same database when running on azure than when running  locally?

 

Regards,
Francisco

Comment
  1. Carl Bolduc
  2. Wednesday, 13 December 2023 22:10 PM UTC
Yes, same database.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.