Java code in oracle DBMS_JOB and permissions
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Java code in oracle DBMS_JOB and permissions

  1. #1
    Join Date
    Oct 2004
    Posts
    2

    Java code in oracle DBMS_JOB and permissions

    Hello,
    We have some java code which is published as a package in oracle. We have this piece of code:

    Statement createTempTable = getConnection().createStatement();
    createTempTable.execute("create table store_list_dups as select * from store_list where rownum < 0");
    createTempTable.close();
    When we execute the published package, it is able to create this table. But the same package if its executed as a DBMS_JOB it throws this message.

    oracle.jdbc.driver.OracleSQLException: ORA-01031: insufficient privileges.

    Could someone shed some light over this issue:

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Not a direct answer to the question, but why are you creating this table? Have you considered the lower overhead of using temporary tables? Also there is generally a problem with creating tables on the fly like this because you cannot validate a procedure that references it before it is created.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Oct 2004
    Posts
    2
    Well , this table is used as a temp table and will be deleted as well when the job completes.

  4. #4
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Originally posted by PMCS
    Well , this table is used as a temp table and will be deleted as well when the job completes.
    That's exactly what a GTT would do nicely. Create it once and the data's cleaned out automatically at the end of the session, only the definition remains. OK, there are some limitations and the CBO can have probs with them (no stats, unless you fudge them): http://download-west.oracle.com/docs...3a.htm#2061433

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width