laravel-oci8 icon indicating copy to clipboard operation
laravel-oci8 copied to clipboard

Some Column Return Wrong Values When Querying Database Views

Open ImranZahoor opened this issue 5 years ago • 2 comments

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

ImranZahoor avatar Jul 10 '19 07:07 ImranZahoor

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 avatar Jul 10 '19 07:07 ChaosPower

@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.

ImranZahoor avatar Jul 10 '19 17:07 ImranZahoor

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 26 '22 03:10 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Nov 02 '22 03:11 github-actions[bot]