Table external slow access of compiled PL/SQL, quick of SQLPLUS

I'm under Oracle Standard Edition One 12.1.0.1.0 Windows x 64.  Small and simple external table queries since met PL/SQL are run very slowly with a second 18 delay, but the same sqlplus queries run very fast, both on the same instance.  I ran Profiler DBMS and debugged PL/SQL to confirm that it takes 18 seconds to query the file header record in an external table in PL/SQL, but the same exact sqlplus query runs in 0.07 seconds.

This seems very odd.  I searched online and OTN, but I can find no example of why this would happen between the two access methods in the same instance.  Something is suspended until the execution of the external PL/SQL table compiled very hurt to be 18 seconds vs 0.07 seconds of sqlplus.  Before you buy the license Oracle I tried the table external access on trial Enterprise Edition on a laptop Windows x 64 where approaches both the PL/SQL and SQL executed just as fast (0.07 seconds in this case).  The main difference now is Standard Edition and Enterprise and production running on a Windows x 64 server.  I have no parallel enabled in the environment.

The log file of external table displays this information message:

KUP-05004: WARNING: disabled source Intra concurrency because select parallel is not sought.

I think it's just because I'm not under parallel access on the external table.  The message is the same if the questioning of PL/SQL or sqlplus.

It seems to be something coherent overall of all external PL/SQL tables in this case, because I studied 3 external tables and they all almost exactly 18 seconds later to PL/SQL vs sqlplus, even if number of rows of tables outside and requests files access to them are different.

How can I know which slows down access PL/SQL method and correct to my production programs?  I created a test case and ran to share results:

I create an external table of test:

-Create table

create the table TEMP_EXT

(

Field1 VARCHAR2 (10),

VARCHAR2 (10) Field2.

field3 VARCHAR2 (10)

)

external organization

(

type ORACLE_LOADER

STRATESIS_DATA_DIR default directory

access settings

(

RECORDS DELIMITED BY '\n '.

BADFILE STRATESIS_LOG_DIR: 'temp.bad'

STRATESIS_LOG_DIR LOG file: 'temp.log'

NODISCARDFILE

FIELDS TERMINATED BY ', '.

SURROUNDED OF POSSIBLY "" "

MISSING FIELD VALUES ARE NULL

(Field1, Field2, field3)

)

location (STRATESIS_DATA_DIR: 'temp.txt')

)

reject the limit 0.

I already have the directories above put in place in the database.

I create a file temp.txt in the above data directory. It has two rows:

Field1, Field2, field3

2field1, 2field2, 2field3

I create an autonomous PL/SQL procedure (not in a package, but I get the same result if I put it in a package):

create or replace procedure tryplsql is

l_field1 temp_ext.field1%TYPE;

l_field2 temp_ext.field2%TYPE;

l_field3 temp_ext.field3%TYPE;

BEGIN

SELECT field1, Field2, field3

IN l_field1, l_field2, l_field3

OF temp_ext

WHERE field1 = "field1";

Dbms_output.put_line(l_field1 ||) ',' || l_field2 | ',' || l_field3);

end tryplsql;

I run as a sqlplus pl/sql procedure:

SQL > exec tryplsql

Field1, Field2, field3

PL/SQL procedure successfully completed.

Elapsed time: 00:00:17.68

SQL > spool off;

It takes almost 18 seconds?

I performed the simple query of sqlplus and it's quick:

SQL > select Field1, Field2, field3 from temp_ext where field1 = "field1";

FIELD1 FIELD2 FIELD3

---------- ---------- ----------

Field1 Field2 field3

Elapsed time: 00:00:00.01

SQL > spool off;

Very fast 0.01 second.

I run the following block of sqlplus:

SQL > DECLARE

l_field1 2 temp_ext.field1%TYPE;

3 l_field2 temp_ext.field2%TYPE;

4 l_field3 temp_ext.field3%TYPE;

5

6 BEGIN

7 SELECT field1, Field2, field3

8 l_field1, l_field2, l_field3

9 FROM temp_ext

10. WHERE field1 = "field1";

11

12 DBMS_OUTPUT.put_line(l_field1 ||) ',' || l_field2 | ',' || l_field3);

13

14 END;

15.

Field1, Field2, field3

PL/SQL procedure successfully completed

Elapsed time: 00:00:00.01

SQL > spool off

It is also very fast.  In SQL, and even a PL/SQL block sqlplus are fast, but a procedure have complied is slow?

I have a lot of packages, procedures, functions, etc., running very fast in the DB as long as there are no external table access (no time 18 seconds).  I ran DBMS Profiler on several sections of code - in all cases, that the call to the external tables takes 18 seconds.  I tried to debug PL/SQL and again the request to the external tables takes 18 seconds every time.

Probably something obvious I'm missing, but I am confused.  Any help is appreciated.

Support of Oracle has identified the issue as a known bug in 12.1.0.1.   Bug #18824125

The workaround until patched is drop the PL/SQL as sys (not a good option), or to grant any directory of the user who executes the PL/SQL will be launched.  It worked.

Tags: Database

Similar Questions

  • How to find the primary key columns in the tables in MS Access using SQL queries

    How to find the primary key columns in the tables in MS Access using SQL queries

    Hello

    This is the forum for Windows Vista programs related issues.

    For better assistance, please try instead the Forums in SQL Server .

    Thank you! Vincenzo Di Russo - Microsoft MVP Windows Internet Explorer, Windows Desktop Experience & security - since 2003. ~ ~ ~ My MVP profile: https://mvp.support.microsoft.com/profile/Vincenzo

  • size of a table in an access database

    Hello

    I try to know the size of a table in the access database, then I would be to turn it into a string value, but I have no success.

    I have attached a JPEG of my code.

    in the concatenated string should appear "rapportx.png" where x represents the size of the table

    You must use 'Decimal string' to convert the number to text.

    Please also note that the size "Array" returns a 2D array in your case: If you have two dimensions.

    Finally, and above all, to count the number of records it reveal be more efficient to use the sql count() function:

    http://www.w3schools.com/SQL/sql_func_count.asp

    Kind regards

    Marco

  • Migration: Access 2003 to Oracle SQL

    Dear all

    I would like to migrate from Access 2003, to Oracle 10 g. I use SQL Developer to the task and have reached the point to capture the XML file I exported from access. I need to create a repository of migration on the target database, and this causes problems that I have all of the necessary privileges.

    In the process, I have been informed that the migration from Access to Oracle are not easy to reach and in fact requires careful planning before execution. My goal is not really to transfer the data stored in the database file. I only really want to transform the logic of code SQL Oracle access. I was wondering if anyone could advise on the typical sides of success in the realization of this task.

    I migrated the same Access database to MS SQL Server some time ago and the process seems to be going smoothly. Would it not be reasonable then to migrate MS SQL to Oracle SQL, if this is easier?

    Any comments would be much appreciated.

    Thank you.

    M

    Use the option of rapid migration of SQL Developer...

    Here, you specify the mdb file and oracle database connection...

    and then it's just a matter of clicks

    you will be able to transfer your data from access to oracle...

    personally, I have not tried the ODBC option between oracle and access...

    will try that...

  • How to call external C/java code in pl/sql or sql?

    Mr President

    I'm a newbie, but I want to know how to call the external C/java code in pl/sql or sql?

    Embedded SQL to Oracle environment is called Pro * C.

  • Table slow access by index rowid

    Hi all
    10.2.0.1
    I have two queries that do the same thing but written in a different way.
    A quick index is scan and accesses the table with rowid, the other performs a full table scan.

    Partial TKPROF for query performing index scan Q_I:
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.01       0.01          0          0          2           0
    Execute      1      0.00       0.00          0          0         13           0
    Fetch        5      0.14       0.69         13      24252          0          53
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        7      0.15       0.70         13      24252         15          53
    
    Misses in library cache during parse: 1
    
    Rows     Row Source Operation
    -------  ---------------------------------------------------
         53  SORT GROUP BY (cr=24252 pr=13 pw=0 time=692418 us)
       1103   HASH JOIN  (cr=24252 pr=13 pw=0 time=691345 us)
        222    TABLE ACCESS FULL HOD_USER (cr=5 pr=0 pw=0 time=42 us)
       1100    VIEW  (cr=24247 pr=13 pw=0 time=690198 us)
      1100     HASH GROUP BY (cr=24247 pr=13 pw=0 time=689097 us)
      36496      TABLE ACCESS BY INDEX ROWID DDO_ALT (cr=24247 pr=13 pw=0 time=109536 us)
      36496       INDEX FULL SCAN PK_DDOALT (cr=2226 pr=6 pw=0 time=36532 us)(object id 117105)
    
    
    Rows     Execution Plan
    -------  ---------------------------------------------------
          0  SELECT STATEMENT   MODE: ALL_ROWS
         53   SORT (GROUP BY)
       1103    HASH JOIN
        222     TABLE ACCESS   MODE: ANALYZED (FULL) OF 'HOD_USER' (TABLE)
       1100     VIEW
       1100      HASH (GROUP BY)
      36496       TABLE ACCESS   MODE: ANALYZED (BY INDEX ROWID) OF
                      'DDO_ALT' (TABLE)
      36496        INDEX   MODE: ANALYZED (FULL SCAN) OF 'PK_DDOALT'
                       (INDEX (UNIQUE))
    
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       5        0.00          0.00
      db file sequential read                        13        0.09          0.55
      SQL*Net message from client                     5        0.00          0.00
    Query run TKProf full table SCAN Q_f:
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.00          0          0          4           0
    Execute      1      0.00       0.00          0          0         13           0
    Fetch        5      0.15       0.39         17       2023          0          53
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        7      0.15       0.40         17       2023         17          53
    
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    
    
    Rows     Row Source Operation
    -------  ---------------------------------------------------
         53  SORT GROUP BY NOSORT (cr=2023 pr=17 pw=0 time=398252 us)
        648   VIEW  (cr=2023 pr=17 pw=0 time=399497 us)
        648    SORT GROUP BY (cr=2023 pr=17 pw=0 time=398845 us)
      37537     HASH JOIN  (cr=2023 pr=17 pw=0 time=564274 us)
        222      TABLE ACCESS FULL HOD_USER (cr=5 pr=0 pw=0 time=267 us)
      36679      TABLE ACCESS FULL DDO_ALT (cr=2018 pr=17 pw=0 time=37 us)
    
    
    Rows     Execution Plan
    -------  ---------------------------------------------------
          0  SELECT STATEMENT   MODE: ALL_ROWS
         53   SORT (GROUP BY NOSORT)
        648    VIEW
     648     SORT (GROUP BY)
      37537      HASH JOIN
        222       TABLE ACCESS   MODE: ANALYZED (FULL) OF 'HOD_USER'
                      (TABLE)
      36679       TABLE ACCESS   MODE: ANALYZED (FULL) OF 'DDO_ALT' (TABLE)
    
    
    
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       5        0.00          0.00
      db file sequential read                        15        0.06          0.18
      db file scattered read                          1        0.06          0.06
      SQL*Net message from client                     5        0.00          0.00
    Why 24247 complies for access by index rowid table, for access to the index, is 2226.
    Why the full table scan is faster in this case?

    Hisoka says:
    Why the full table scan is faster in this case?

    As P. Forstmann suggested, it would help if you can post queries and their results of EXPLAIN PLAN.
    Now, I know guess is bad, but I want to have a go on this one, so we'll see ;)
    My comments (in no particular order of relevance/importance)
    (1) you use a non patched (10.2.0.1) version which, I believe, is known to contain many bugs (and therefore can throw 'surprises')
    (2) the name of the index, it is clear that PK_DDOALT is a unique index (supporting the primary key constraint) table DDO_ALT so
    factor clustered index is (probably) not the issue.
    (3) the TkProf output tells 36496 lines are currently extracted from table DDO_ALT in the query that uses the index analysis while
    36679 lines are currently extracted a DDO_ALT table in the query that uses the full table scan.
    It seems that the DDO_ALT table has about 36679 lines. Now, it will be slower (such as oracle to access most of these lines using the index
    you will need to visit a (table) block at the same time (and will eventually visit same block several times) compared to the full table scan.
    who reads several blocks at a time (and eventually NOT have to visit same block several times). This can be confirmed
    by the numbers "cr" TkProf. 24247 consistent gets for the query using access indexed for 36496 lines (with the exception of consistent gets for the reading of the index)
    2018 coherent vs gets to access 36679 lines.
    (4) the operation "line Source" indicates that the query using an indexed access is written so that it forces the use of the index (most likely
    using an indicator of index). It's that reason optimizer uses "INDEX FULL SCAN" and not "INDEX RANGE SCAN". A FULL INDEX SCAN bed set
    structure of the index, a block at a time, which is not an efficient operation compared to the optimizer to choose naturally "INDEX RANGE SCAN", which
    that will show some of the index blocks.
    (5) Finally, it appears this query that uses access indexed, is written to 'say' oracle how to process the query. Maybe it's OK if you think that
    your knowledge of the data schemas is better than knowledge of the optimizer. But this certainly isn't the case here.
    Your queries are probably something like
    Query using index:

    SELECT 
    FROM HOD_USER, (SELECT /*+ INDEX(DDO_ALT PK_DDOALT) */ 
                                 FROM DDO_ALT
                                GROUP BY ) DD
    WHERE HOD_USER. = DD.
    GROUP BY 
    ORDER BY 
    

    The query using full table scan:

    SELECT 
     FROM (SELECT 
                 FROM HOD_USER, DDO_ALT
              WHERE HOD_USER. = DDO_ALT.
                 GROUP BY 
                 ORDER BY )
    GROUP BY 
    ORDER BY 
    

    Published by: user503699 on August 21, 2010 18:47 added ORDER BY clauses for both queries

  • Creating external Tables using the EXECUTE IMMEDIATE in PL/SQL

    Hi guys,.

    I am trying to create an external Table using the EXECUTE IMMEDIATE in a procedure and I managed to compile and no errors were generated. But when I try to run it from sql using the exec command I get the following error:

    ------------------------------------------------------------------------
    ERROR on line 5:
    ORA-00911: invalid character
    ORA-06512: at "GEO. TEST_DDL', line 4
    ORA-06512: at line 5

    -------------------------------------------------------------------------

    I tried to check the whole statement to create the external table, but I can't find where is the error. Surprisingly, if I simply run the command table create external on sqlplus it works, but not a procedure.

    If anyone can help with ideas or experience?

    Geoffrey Kossami

    The error means that there is an identifier somewhere that starts with a nonalphanumeric. This is a typical mistake of editing. A procedure compiles correctly is not of course because the underlying dynamic sql running is OK. Which of course only be resolved when you try to run it.

    There is certainly a problem with the text you provide to be run as a piece of dynamic sql code. You should try to watch it with dbms_output and run this code in sqlplus. But your problem is with the code you run as dynamic PL/SQL, it is not itself compilable.

    Jack

  • Importing data into tables to grant access (developer sql 3.2)

    Hello
    I want to import data into a table PAY_BALANCE_BATCH_LINES which is an array of interface. I am connected to a schema (APPS) and this table belongs to the HR schema. However, if you look at the grants, the APPS schema has all access to this particular table. A TOAD, this used to work great.
    But in sqldeveloper, when I filter drop-down list of tables, I'm not able to find the table. Since it is my main means of downloading data I don't know how I can get access to download data in this table. I do not know the password for the schema HR incidentally.
    Is there a way out?
    Thank you very much

    Scroll to the bottom of the tree to the 'Other users' node, expand it, and then descend into HR > Tables. Then do your import.

    To another browser, right-click on your connection in the tree and open a browser schema.

  • Addign a computed column of the record count in table external

    Hello

    I have a csv file that is loaded using the external table. My need is to give a number to each record in the file and save it in one of the extra column in the table, can anyone suggest how it is possible?

    The structure of the file is:
    $cat emp.txt
    7369,SMITH,CLERK,7902,12/17/1980,800,,20
    7499,ALLEN,SALESMAN,7698,2/20/1981,1600,300,30
    7521,WARD,SALESMAN,7698,2/22/1981,1250,500,30
    7566,JONES,MANAGER,7839,4/2/1981,2975,,20
    7654,MARTIN,SALESMAN,7698,9/28/1981,1250,1400,30
    7698,BLAKE,MANAGER,7839,5/1/1981,2850,,30
    7782,CLARK,MANAGER,7839,6/9/1981,2450,,10
    7788,SCOTT,ANALYST,7566,12/9/1982,3000,,20
    7839,KING,PRESIDENT,,11/17/1981,5000,,10
    7844,TURNER,SALESMAN,7698,9/8/1981,1500,0,30
    7876,ADAMS,CLERK,7788,1/12/1983,1100,,20
    7900,JAMES,CLERK,7698,12/3/1981,950,,30
    7902,FORD,ANALYST,7566,12/3/1981,3000,,20
    7934,MILLER,CLERK,7782,1/23/1982,1300,,10
    
    --and the table structure is:
    
        CREATE TABLE TMP_emp_ext
        (
        EMPNO                                      NUMBER(4),
        ENAME                                              VARCHAR2(10),
        JOB                                                VARCHAR2(9),
        MGR                                                NUMBER(4),
        HIREDATE                                           DATE,
        SAL                                                NUMBER(7,2),
        COMM                                               NUMBER(7,2),
        DEPTNO                                             NUMBER(2)
        )
        ORGANIZATION EXTERNAL
          (  TYPE ORACLE_LOADER
             DEFAULT DIRECTORY DIR_N1
             ACCESS PARAMETERS
               ( records delimited  by newline
            fields  terminated by ','
            missing field values are null
           )
             LOCATION (DIR_N1:'emp.txt')
          )
        REJECT LIMIT UNLIMITED
        NOPARALLEL
        NOMONITORING
     /
    Now, my need is to give a number to each record... like the record from 7369, SMITH should be granted record n ° 1, 7499, ALLEN should be record No. 2 etc... can anyone suggest how it is possible?

    Thank you
    orausern

    T. Kyte write RECNUM should work in http://asktom.oracle.com/pls/apex/f?p=100:11:0:P11_QUESTION_ID:52733181746448 #52977916329285 because it is SQL * Loader syntax. However I've wasn't able to make it work with Oracle 10.2.0.4. But in case of errors of loading, you should find in _XXXXX.log the number of rejected records line (in my example it's the meaning of the 'line 2' "line 2"):

    erreur lors du traitement de la colonne EMPNO, la ligne 2, pour le fichier de données /tmp/emp.txt
    ORA-01722: invalid number
    
  • The date in the table external or real

    Hi all

    We have to load the file .csv to external table, few of the columns are date data type
    If I load in an external table as tank and convert to date during the actual table loading
    In general, which is faster (making the conversion of the date when loading the external tables or at a real table).

    Oracle version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

    Thank you
    Rambeau

    Here it is - very basic, no indexes or constraints, a single column. The input file has 99000 rows with 3 distinct values.

    create table xtest1 (dt date);
    
    create table xtest2 (dt date)
    organization external (
       type oracle_loader
       default directory gic
       access parameters (
          records delimited by newline
          fields
          (
      DT   CHAR(10) DATE_FORMAT DATE MASK "YYYY-MM-DD"
          )
       )
       location ('xtest.data')
    )
    ;
    
    create table xtest3 (dt varchar2(10))
    organization external (
       type oracle_loader
       default directory gic
       access parameters (
          records delimited by newline
          fields
          (
      DT   CHAR(10)
          )
       )
       location ('xtest.data')
    )
    ;
    
    create table xtest4 (dt date)
    organization external (
       type oracle_loader
       default directory test
       access parameters (
          records delimited by newline
          date_cache 0
          fields
          (
      DT   CHAR(10) DATE_FORMAT DATE MASK "YYYY-MM-DD"
          )
       )
       location ('xtest.data')
    )
    ;
    
    declare
      v_timer number;
    begin
      v_timer := DBMS_UTILITY.GET_TIME();
      INSERT INTO xtest1 SELECT dt from xtest2;
      DBMS_OUTPUT.PUT_LINE('External with date cache: Time Taken: '||to_char((DBMS_UTILITY.GET_TIME()-v_timer)/100,'999G999D99'));
      EXECUTE IMMEDIATE 'TRUNCATE TABLE xtest1';
      v_timer := DBMS_UTILITY.GET_TIME();
      INSERT INTO xtest1 SELECT to_date(dt,'YYYY-MM-DD') from xtest3;
      DBMS_OUTPUT.PUT_LINE('In SQL: Time Taken: '||to_char((DBMS_UTILITY.GET_TIME()-v_timer)/100,'999G999D99'));
      EXECUTE IMMEDIATE 'TRUNCATE TABLE xtest1';
      v_timer := DBMS_UTILITY.GET_TIME();
      INSERT INTO xtest1 SELECT dt from xtest4;
      DBMS_OUTPUT.PUT_LINE('External no date cache: Time Taken: '||to_char((DBMS_UTILITY.GET_TIME()-v_timer)/100,'999G999D99'));
      EXECUTE IMMEDIATE 'TRUNCATE TABLE xtest1';
    end;
    / 
    
    External with date cache: Time Taken:         .34
    In SQL: Time Taken:         .47
    External no date cache: Time Taken:         .41
    
    External with date cache: Time Taken:         .34
    In SQL: Time Taken:         .47
    External no date cache: Time Taken:         .41
    
    External with date cache: Time Taken:         .35
    In SQL: Time Taken:         .47
    External no date cache: Time Taken:         .42
    

    Kind regards
    Bob

  • Presentation of external storage as Local to the SQL virtual servers

    Hello.

    Obligatory "I'm new" and 'sorry if this is in the wrong place' withdrawals.

    I have two SQL Server virtual machines (running on ESX 3.5) which I am (at the level of the BONE) clustering for redundancy.  All their storage would come from two HP AiO servers storage or local storage of the ESX Server.  For now, we don't have VirtualCenter.

    I need to present some sort of external storage for these virtual machines that they can (a) recognize as local so I can store files .mdf for SQL server on it, and (b) which can be configured as a cluster resource, so either can be accessed in the event of another machine down.

    I tried to create a new virtual hard disk, pointing to the raw space on some of my existing storage, but "raw device mapping" is greyed out.  I guess it's because he needs a real San for gross external storage as a virtual disk local card.  I also tried new creation and extensions adding storage to the storage devices in the configuration of ESX storage.  There's no joy.

    Should I VirtualCentre or a real SAN in order to present the raw disk space to a virtual machine?  If this is not the case, how can I do?  If so, which do I need and is there some kind of fudge or skilled people getaround may suggest that fits my needs of clustered SQL Server resources?

    Thank you.

    Rikk

    Hello

    Welcome to the forums! I have a few questions and comments.

    To use a RDM in normal mode you will need a SAN/NAS/iSCSI server to get there. Since the storage of the IOA is an iSCSI SAN or a NAS you want present storage to ESX using one of these methods.  I guess that you already do using iSCSI or NFS? You are using.

    I would not use Local Storage due to problems of redundancy.

    You have space on your AiO storage to create another logical unit number?

    A RDM is a logic unit number presented to the ESX host as a data bank that is not also a VMFS.  Once the logic unit number is presented for ESX you can do a RDM or you can do a VMFS and add another VMDK to your VM and move the .mdf for the new VMDK files. Or the other method should work. You can also access the server iSCSI directly from Windows and directly access a LUN to one end.

    You have many options at this point. Which way you want to go?

    Best regards

    Edward L. Haletky

    VMware communities user moderator

    ====

    Author of the book "VMWare ESX Server in the enterprise: planning and securing virtualization servers, Copyright 2008 Pearson Education.»

    SearchVMware Blog: http://itknowledgeexchange.techtarget.com/virtualization-pro/

    Articles of blue Gears - http://www.itworld.com/ and http://www.networkworld.com/community/haletky

    As well as virtualization at http://www.astroarch.com/wiki/index.php/Virtualization Wiki

  • newbie question: sql runs under sqlplus but does not compile in pl/sql?

    I have the following two tables, I have a SQL in pl/sql packages so I can use dbms_jobs to automate it however, I get the compile time error. It seems to me that pl/sql dislikes my sql that works well in sqlplus. Here is the error message and my test case?

    mdb_user@cmd > view the error
    PACKAGE BODY DATA_QUALITY_REPORT_P errors:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    10/1 PL/SQL: statement ignored
    13/42 PL/SQL: ORA-00942: table or view does not exist





    create the table S_ORG_EXT
    (
    accnt_type_cd varchar2 (100),
    cust_stat_cd varchar2 (100)
    )
    /

    insert into s_org_ext
    Select column_name, data_type for user_tab_columns where rownum < = 100
    /

    Select * from s_org_ext
    /


    create the table data_quality_report
    (
    RunId number not null,
    report_type number of non-null, - type of report as dup dup or not other measures
    org_level number not null, - organization level nsgn, sgn, shipto
    loc_level number of non-null, - local level by city, by country, by region, grand_total
    name varchar2 (100) not null,-the line output of the tot name.
    Value number not null, - line value of the tot.
    rundate date default sysdate
    )
    /

    create sequence data_quality_report_seq with 1000
    INCREMENT BY 1
    NOCACHE
    NOCYCLE
    /


    insert into data_quality_report
    Select data_quality_report_seq.nextval, 3, 99, 99, accnt_type_cd, cnt, sysdate from
    (
    Select accnt_type_cd, count cnt (*) of S_ORG_EXT where cust_stat_cd = 'VARCHAR2' group by accnt_type_cd by 2 desc order
    )
    /

    Select * from data_quality_report
    /



    truncate table data_quality_report

    CREATE or replace PACKAGE data_quality_report_p AS
    function pull_data return data_quality_report.runid%type;
    END data_quality_report_p;
    /


    create or replace package body data_quality_report_p as
    function pull_data return data_quality_report.runid%type is

    new_rid data_quality_report.runid%type;


    Start
    Select data_quality_report_seq.nextval in the double new_rid;

    insert into data_quality_report
    Select new_rid, 3, 999999, 999999, accnt_type_cd, cnt, sysdate from
    (
    Select accnt_type_cd, count cnt (*) of S_ORG_EXT where cust_stat_cd = 'VARCHAR2' group by accnt_type_cd by 2 desc order
    );


    Return new_rid;
    exception
    When no_data_found then
    DBMS_OUTPUT. Put_line ("NO_DATA_FOUND handles the exception.");
    while others then
    DBMS_OUTPUT. Put_line ("' handling ANOTHER exception.");


    end; -end pull_data

    end data_quality_report_p;
    /

    Hello

    Sorry, I was not clear about that.
    The owner of the package needs direct privileges (not only privileges through a role) to compile the code, whehter it is DEFINE AUTHID or AUTHID CURRENT_USER. Option (3) does not help in this case; my mistake.

    I usually create packages in the same schema tables they use, which was option (2) in my previous message. There may be good reasons why you can't do that; for example, the package may reference multiple schemas tables. In this case, grant the necessary privileges directly to the owner of the whole.

  • Simple query in Oracle Table in MS Access causes a full table scan.

    I run a very simple query in MS ACCESS to an Oracle table attached as follows:

    Select *.
    EXPRESS_SERVICE_EVENTS-(EXPRESS is the name of the related table. SERVICE_EVENTS)
    When executed > MyDate()

    or

    Select *.
    EXPRESS_SERVICE_EVENTS-(EXPRESS is the name of the related table. SERVICE_EVENTS)
    When executed > [Forms]! [MyForm]! [Date1]

    We have more than 50 machines and this query works well on more than half of them, using an Oracle Index on the field "run." Exactly the same thing running on other machines results in a full table scan, so regardless of the index (the DB access even access all machines).

    Strangely, if we write the query as follows:

    Select *.
    Of EXPRESS_SERVICE_EVENTS
    When executed > # 2009-09-04 08:00 #.

    It works fast everywhere!

    Any help with this "phenominon" would be appreciated.

    We did the things:
    Check the locale settings of the ODBC driver, MS Access settings (as in tools-> Options), we have the latest XP and Office service packs and re-related all the Access Tables on the slow and fast machines independently).

    All machines use the same version of the ODBC driver?

    If you have access to Metalink, check the following note:
    Note.257828.1 Scan of Table full Ext/Pub while seeking the DATE columns using the ODBC Oracle driver:

    In a Word, try "bind timestamp date" option in the dsn configuration and do not forget to update the links in the table.

    It will be useful,
    Greg

  • Compilation with SQL * more

    Hello world

    I am sure it is a simple and can someone help me:

    In other projects, I've always used TOAD or similar tools to compile my PL/SQL code, but with this project I have only SQL * more then when I run 'CREATE PROCEDURE '.... "I just get the message ' Warning: function created with compilation errors.

    I'm sure that compiling information are written in a table somewhere or maybe can be displayed directly in the SQL * more window (maybe there an option or the indicator "Compile"?) and so I hope someone can point me to a good HOWTO or give me one or two keywords that I can google under?

    Thank you very much
    Alan Searle

    Use

    display errors

    or user_errors

    SQL> create or replace procedure p1 is
      2  begin
      3   null
      4  end;
      5  /
    
    Warning: Procedure created with compilation errors.
    
    SQL> show errors
    Errors for PROCEDURE P1:
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    4/1      PLS-00103: Encountered the symbol "END" when expecting one of the
             following:
             ;
             The symbol ";" was substituted for "END" to continue.
    
    SQL> select text from user_errors
      2  where name = 'P1';
    
    TEXT
    --------------------------------------------------------------------------------
    PLS-00103: Encountered the symbol "END" when expecting one of the following:
    
       ;
    The symbol ";" was substituted for "END" to continue.
    
  • External drive access time machine files

    I backed up an external hard drive with time machine, but now the external hard drive is dead and does not connect to my computer. How can I enter time machine and access those saved files? Because the player won't connect (USB), it does not appear when I'm in time machine.

    Mac OSX El Capitan 10.11.4

    Thank you

    Tracy

    Open time Machine and come back a few days in time using the interface

    Click on the name of your Mac in the DEVICES of direction on the left panel

    Two readers... the two Macintosh HD (unless you have changed the name) and the external hard drive is displayed

    You can navigate to find the files you want, or select the entire disk

    Right-click on the name of the external drive and select restore to

    Navigate to the destination where you want to restore the files

Maybe you are looking for