插入日期的问题 [英] Problem with inserting dates
问题描述
我正在使用类型的变量:DATE
我们的Oracle实例有:NLS_DATE_FORMAT DD-MON-YY
我选择从表A到此日期变量的日期。然后我将该变量插入到另一个表中,B。在2000年之前更改的日期 - 如1995年变为2095.我对select和insert之间的日期没有任何作用。
我的PL / SQL正在Toad 9.1版中执行。 Oracle发布1002000300
有谁知道出了什么问题?
谢谢
I am using a variable of type: DATE
Our instance of Oracle has: NLS_DATE_FORMAT DD-MON-YY
I select a DATE from table A into this date variable. I then insert that variable into another table, B. Dates that were before 2000 change -- like 1995 becomes 2095. I do nothing to the date between select and insert.
My PL/SQL is being executed in Toad version 9.1. Oracle is release 1002000300
Does anyone know what is wrong?
Thanks
推荐答案
我使用的是类型的变量:DATE
我们的Oracle实例有:NLS_DATE_FORMAT DD-MON-YY
我从表A中选择一个DATE到这个日期变量。然后我将该变量插入到另一个表中,B。在2000年之前更改的日期 - 如1995年变为2095.我对select和insert之间的日期没有任何作用。
我的PL / SQL正在Toad 9.1版中执行。 Oracle发布1002000300
有谁知道出了什么问题?
谢谢
I am using a variable of type: DATE
Our instance of Oracle has: NLS_DATE_FORMAT DD-MON-YY
I select a DATE from table A into this date variable. I then insert that variable into another table, B. Dates that were before 2000 change -- like 1995 becomes 2095. I do nothing to the date between select and insert.
My PL/SQL is being executed in Toad version 9.1. Oracle is release 1002000300
Does anyone know what is wrong?
Thanks
不一定是这样。
你可以尝试下面的查询,然后执行你的程序:
That shouldnt be the case.
Can you try the below query and then execute your procedure:
我会承认自己是PL / SQL的新手,但我确实已经尝试过了。我遇到了语法错误。也许我应该把它放在PL / SQL程序之外......
I''ll admit to being a newbie with PL/SQL, but I did already try that. I got a syntax error. Maybe I should put it outside the PL/SQL procedure...
好吧,我在程序之外运行了alter session,然后运行程序,同样的事情发生了。我在插入之前打印出日期变量,日期类似于1997年,1995年。然后在表格中我看到它们已被插入为2097年,2095年。非常奇怪。
Well, I ran the alter session outside the procedure, then ran the procedure and same thing happens. I print out the date variable just prior to insertion, and the dates are like, 1997, 1995. Then in the table I see they have been inserted as 2097, 2095. Very strange.
这篇关于插入日期的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!