Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Materialized Views via Perl

Status
Not open for further replies.

mikedaruke

Technical User
Mar 14, 2005
199
US
Anyone know how I can have perl update materialized views in Oracle? I know the command do it via SQL* Plus, but not sure how to do it via the DBI module.

I am currently connected and can run SQL against the DB and get results.

Any ideas? Want to execute.

execute DBMS_REFRESH.REFRESH('Materialized_View');
 
I don't know if you can execute stored procedures with the DBI module, try it and see.

Failing that, you could create a function that would refresh the view and return a dummy value:
Code:
CREATE OR REPLACE FUNCTION refresh_view(pView IN VARCHAR2) RETURN NUMBER IS
BEGIN
   DBMS_REFRESH.REFRESH(pView);

   RETURN 1;
END;
Then you can just run it off like any other query:
Code:
$dbh->do("SELECT refresh_view('my_view') FROM dual");



-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top