I tried to change the insert date format in my DB2 10.1, but the
behavior is the same:
$ db2 bind @db2ubind.lst datetime USA blocking all grant public
<<SNIP>>
Any ideas?
Hello friends,
DB2 10.1 LUW
I'm trying to understand this scenario:
$ db2 "create table TEST ( C1 date) "
DB20000I The SQL command completed successfully.
$ db2 "values current date"
1
----------
08/19/2016
1 record(s) selected.
$ db2 "insert into TEST values current date"
DB20000I The SQL command completed successfully.
$ db2 "select * from TEST"
C1
----------
08/19/2016
1 record(s) selected.
Hummm, OK!
Now look ...
$ db2 "insert into TEST values ('08/20/2016')"
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0181N The string representation of a datetime value is out of range. SQLSTATE=22007
$ db2 "insert into TEST values ('20/08/2016')"
DB20000I The SQL command completed successfully.
$ db2 "select * from TEST"
C1
----------
08/19/2016
08/20/2016
2 record(s) selected.
db2inst1@renata-molinaro:~$ db2 get db cfg | grep -i territory
Database territory = US
Would you help me with this issue?
Regards,
Bruno.
I don't think this is strange... when you insert you have to use day month year -- always!
When you do a query it uses localization to display the date in a nice way.
What is your question/problem?
On Friday, August 19, 2016 at 5:53:35 PM UTC-4, Bruno Almeida wrote:
Hello friends,
DB2 10.1 LUW
I'm trying to understand this scenario:
$ db2 "create table TEST ( C1 date) "
DB20000I The SQL command completed successfully.
$ db2 "values current date"
1
----------
08/19/2016
1 record(s) selected.
$ db2 "insert into TEST values current date"
DB20000I The SQL command completed successfully.
$ db2 "select * from TEST"
C1
----------
08/19/2016
1 record(s) selected.
Hummm, OK!
Now look ...
$ db2 "insert into TEST values ('08/20/2016')"
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned: SQL0181N The string representation of a datetime value is out of range. SQLSTATE=22007
$ db2 "insert into TEST values ('20/08/2016')"
DB20000I The SQL command completed successfully.
$ db2 "select * from TEST"
C1
----------
08/19/2016
08/20/2016
2 record(s) selected.
db2inst1@renata-molinaro:~$ db2 get db cfg | grep -i territory
Database territory = US
Would you help me with this issue?
Regards,
Bruno.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 66:47:46 |
Calls: | 6,654 |
Files: | 12,200 |
Messages: | 5,331,885 |