laravel-oci8
laravel-oci8 copied to clipboard
Some Column Return Wrong Values When Querying Database Views
Summary of problem or feature request
When querying oracle database views some numeric value columns return wrong values . when I change same view to materialized view then problem resolved. suppose some column 'A' in view has value 112.0 in database , but when queried through laravel it returns 1123.0 . This is only example . it may different for each row. I have tested it on laravel version 5.1 , 5.7, 5.8 on different version of oracle client and PHP. I have also tried with laravel query builder and eloquent. If this issue is not related to Yajra OCI then let me know i will open it with laravel. Thanks
System details
- Operating System Linux Ubuntu 15.10, 18.04
- PHP Version 5.6, 7.2
- Laravel Version 5.1 to 5.8
- Laravel-OCI8 Version 11.2.0.2.0 , 12.0
Hello @ImranZahoor ,
This is similar to what I have encountered last week. However, in my case it was bad formatting with session date format. I solved my by setting date format of the connection session.
DB::connection('sid')->setDateFormat('DD-MON-RRRR');
The oracle view I have calls a function where it has set date formatting as the snippet above.
Could you tell us what does SQL Developer interpret your column definition as?
I also removed 2 config properties which are:
'edition' => env('DB_EDITION', 'ora$base'),
'server_version' => env('DB_SERVER_VERSION', '11g'),
@ChaosPower thanks for reply. SQL Developer interpret those column values as number and shows correct values, I will try your solution, but i did not have any issue with date values. this issues comes only in case of numeric values columns in oracle views. No issue with Materialized views and tables.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.