You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$this->oci8Con->executeQuery(
'SELECT * FROM table WHERE datefield > ?',
array(new \DateTime()),
array(Type::DATE)
);
which was raising an oracle error that the date could not be parsed.
The time format in getTimeFormatString is also wrong because according to the above doc, times can only be passed by using TO_DATE('13-AUG-66 12:56 A.M.','DD-MON-YY HH:MI A.M.').
So this requires wrapping the SQL with a TO_DATE function.
You have to use OracleSessionInit to get the date formats right. See the documentation.
I cannot remember anymore why this is necessary but there definitely is a reason for this. I think it's because Doctrine requires some convenient format for date type columns. However this is the way users are handling this kind of problem and we won't be able to change this behaviour anyways in 2.x as it would break users' applications badly. So please bare with me closing this issue. Use the OracleSessionInit listener and it will fix your issue. If you have further question I will help you :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The expected format for DATE columns is
01-MAR-14. See http://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#CNCPT413It also works with
01-Mar-2014as this PR uses.We found the problem when trying something like
which was raising an oracle error that the date could not be parsed.
The time format in
getTimeFormatStringis also wrong because according to the above doc, times can only be passed by usingTO_DATE('13-AUG-66 12:56 A.M.','DD-MON-YY HH:MI A.M.').So this requires wrapping the SQL with a TO_DATE function.