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

Materialized view #806

Open
luiz-andrade opened this issue Sep 5, 2023 · 2 comments
Open

Materialized view #806

luiz-andrade opened this issue Sep 5, 2023 · 2 comments

Comments

@luiz-andrade
Copy link

Materialized view with the package

How do I run this materialized view with the package?

  • It works
$conn = oci_pconnect("user", "pass", "127.0.0.1/XE");
$sql = oci_parse($conn, "BEGIN DBMS_MVIEW.REFRESH('MV_DW_TESTE'); END;");
$result = oci_execute($sql);

With this command above it works

  • with PDO does not work
$pdo = DB::connection('oracle')->getPdo();
$result = DB::connection('oracle')->getPdo()->exec("BEGIN DBMS_MVIEW.REFRESH('MV_DW_TESTE'); END;");

System details

  • Linux Mint Version 21.2
  • PHP Version 8.1
  • Laravel Version 10
  • Laravel-OCI8 Version v10.3.1
@github-actions github-actions bot added the stale label Oct 5, 2023
Repository owner deleted a comment from github-actions bot Oct 5, 2023
@yajra
Copy link
Owner

yajra commented Oct 5, 2023

Was able to replicate the issue using the package. Using SQL Developer, I also replicated the issue using EXECUTE IMMEDIATE 'DBMS_MVIEW.refresh(''users_mv'')'; It seems like the PDO behaves like execute immediate but can't trace yet how it occurs.

Will try to check again when I got the chance.

@yajra
Copy link
Owner

yajra commented Oct 5, 2023

Got it, just remove the exec in your SQL.

DB::statement("begin DBMS_MVIEW.refresh('users_mv'); end;");

@yajra yajra added question and removed for review labels Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants