Bug report #9536

Impossible to insert dates in Oracle

Added by Paolo Cavallini about 10 years ago. Updated almost 10 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Data Provider/Oracle
Affected QGIS version:2.0.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:18124

Description

The error is:

SQL: ORA-01843: not a valid month
Impossibile eseguire l'istruzione
Errore: INSERT INTO
"QGIS_TEST"."ZONA_RECUPERO"("SHAPE","VINCSIDE","VINCSCODTI","CODTIPCART","VINSSUPERF","LEGIDESTAR","VINCSDATAI","VINCSDATAF","LEGIDESTOP","GEOLINK")
VALUES (:f,'23005869',NULL,NULL,NULL,NULL,'14/04/2014','31/12/2999',NULL,NULL) "

If we use to_date('2007/05/31','YYYY/MM/DD') instead, the INSERT goes well.

It seems that the user should be able to specify the date format also on the client side, in order to have a more flexible data entry.

History

#1 Updated by Jukka Rahkonen about 10 years ago

Oracle time formats are mysterious, but it could be worth trying if setting "NLS_DATE_FORMAT" environment parameter would help. See http://docs.oracle.com/cd/B19306_01/server.102/b14237/initparams122.htm
Similarly getting national characters to work correctly can be painful and it may be necessary to set NLS_LANG parameter http://docs.oracle.com/html/B13531_01/ap_b.htm instead of using the defaults.

#2 Updated by Jürgen Fischer about 10 years ago

provider side fixed in 3b438e22. Editing dates still requires support in the edit widgets (using the calendar widget should work; perhaps there could also be support for QDate/TimeEdit).

#3 Updated by Jürgen Fischer about 10 years ago

  • Assignee deleted (Jürgen Fischer)

#4 Updated by Jürgen Fischer almost 10 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Jürgen Fischer wrote:

provider side fixed in 3b438e22. Editing dates still requires support in the edit widgets (using the calendar widget should work; perhaps there could also be support for QDate/TimeEdit).

Editor widgets now have that.

Also available in: Atom PDF