Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Column Return Wrong Values When Querying Database Views #513

Closed
ImranZahoor opened this issue Jul 10, 2019 · 4 comments
Closed

Some Column Return Wrong Values When Querying Database Views #513

ImranZahoor opened this issue Jul 10, 2019 · 4 comments

Comments

@ImranZahoor
Copy link

ImranZahoor commented Jul 10, 2019

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
@ChaosPower
Copy link
Collaborator

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'),

@ImranZahoor
Copy link
Author

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

@yajra yajra added the question label Oct 11, 2019
@github-actions
Copy link

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

@github-actions github-actions bot added the stale label Oct 26, 2022
@github-actions
Copy link

github-actions bot commented Nov 2, 2022

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

@github-actions github-actions bot closed this as completed Nov 2, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants