ORA-24347 with Powerbuilder

Found that the column alias is what causes this error when accessing views.
Views that have been created using this method:
select sum(col_11) total, acct_num from abc
or
select sum(col_11) as total, acct_num from abc
will not work with Powerbuilder 8 at present.
It appears that the column alias is handled somewhat different in 8i and Powerbuilder has not supported all methods.

I have also run into a problem with this error message.
In our case although it came to light when we upgraded to PB 8.
Accessing a view triggered the error.
I have found that trying to display the properties of the view in the database painter will bring up a blank messagebox and the view definition will display nothing.
Only if you retrieve data from the same view it will cause a corruption in the connection and any other view or table will display this message ORA-24347 "Warning of a null column in an aggregate function"
In hitting views at random through the database painter - several views were found to suffer from this problem.
There is nothing within the SQL that can explain it.
One of the views is no more than a straight select from a single table.

Similar Messages

  • ORA-24347: Warning of a NULL column in an aggregate function

    The following query works fine, normally.
    select max(ship_date) Ship_date,msn.attribute7 from
         mtl_serial_numbers msn,
         mtl_item_categories mic,
         mtl_categories mc
                   where      msn.inventory_item_id = mic.inventory_item_id and
                   mic.category_id=mc.category_id and
                   mic.category_set_id=1 and
              mc.segment1 in ('ILMI','ILM','ILMI-UNT')
              Group by msn.attribute7
    But when I include the same query inside a SQL report it gives me the Following error message
    ORA-24347: Warning of a NULL column in an aggregate function
    Help me out.

    I tried out with some Dummy Date, it worked fine.
    But the problem I am facing here is I cannot assume
    any Date for the corresponding column. Whether there
    is any other possibility to avoid this problem without
    giving any dummy date?
    thanks,
    chandru

  • Replace local tnsnames.ora-files with OID

    Hi there,
    I would like to replace our local tnsnames.ora-files with an central OID-Instance. I know I will have to use the ldap.ora on clientside, but how can I add service names to the OID?
    Is there any guide or manual which describes this functionality?
    Best Regards

    You need the Net Configuration Assistant, not Net Manager!
    - select configure Directory Usage
    - select correct type and name, and port(s)
    - select correct default context (NOT cn=OracleContext!)
    Next, you should be able to navigate to Local Naming, select an entry from your tnsnames.ora, and select from the mennu: Command->Directory->Export Net Service Names
    - select one or more entries to be migrated

  • Help using AEWsetunsol() with PowerBuilder 7 on Nt4

    I am trying to use AEWsetunsol() with Powerbuilder 7 on WinNT 4 (sp6a) or Win2000.
    Can anyone help with regards to what we have to do in PB to get this to work?
    Please be explicit.
    Thanks in advance.
    ..Lyall

    Got it working but had to write a tpinit() wrapper in a DLL in order to get it
    to work.
    The wrapper function allocated the TPINIT buffer and populated the structure with
    appropriate usernames/passwords (none in my case) but we set the 'flags' field
    to 1 (notify by signal). [Powerbuilder does not handle structures terribly well
    I am led to understand]
    If we did not do this, the AEWsetunsol() did not work.
    The code window open is as follows :-
    // pb_SetLoginInfo() is custom written DLL function - simply
    // allocates the TPINIT buffer and populates it.
    // fields in same order as TPINIT buffer
    If (pb_SetLoginInfo("", "", "", "", 1, 0, "") < 0) Then //flag set to 1 - TPU_SIG
    indicating unsolicited notification selected by signals
         messagebox("Error", "Fail pb_SetLoginInfo()")
         return
    End If     
    // pb_tpinit() is custom written DLL function - simply calls tpinit() with the
    structure populated by pb_SetLoginInfo()
    IF ( pb_tpinit() < 0) Then //call tp_init from user defined external dll
         messagebox("Error", "Fail tpinit()")
         tpterm()
         return
    End If
    We wanted to be notified by PBM_CUSTOM68 (Powerbuilder custom event 68)
    Then, we called the AEWsetunsol as follows :-
    //start subscribing to event
    il_windowHandle = Handle(THIS)
    //set event to trigger when receive unsolicited message
    IF (AEWsetunsol(il_windowHandle, (1023+68)) < 0) Then //the (1023+68) indicates
    the event id for pbm_custom68
         messagebox("Error", "Fail AEWsetunsol()")
         tpterm()
         return
    End If
    We then setup a custom pb event to receive these events, subscribed to an event
    and off we went.
    Now, if we could only convince the Tuxedo 8 WS DLL to work with Powerbuilder (rather
    than crashing on APP exit)
    Hope this helps someone.
    ..Lyall

  • ORA-01008 with ref cursor and dynamic sql

    When I run the follwing procedure:
    variable x refcursor
    set autoprint on
    begin
      Crosstab.pivot(p_max_cols => 4,
       p_query => 'select job, count(*) cnt, deptno, row_number() over (partition by job order by deptno) rn from scott.emp group by job, deptno',
       p_anchor => Crosstab.array('JOB'),
       p_pivot  => Crosstab.array('DEPTNO', 'CNT'),
       p_cursor => :x );
    end;I get the following error:
    ^----------------
    Statement Ignored
    set autoprint on
    begin
    adsmgr.Crosstab.pivot(p_max_cols => 4,
    p_query => 'select job, count(*) cnt, deptno, row_number() over (partition by
    p_anchor => adsmgr.Crosstab.array('JOB'),
    p_pivot => adsmgr.Crosstab.array('DEPTNO', 'CNT'),
    p_cursor => :x );
    end;
    ORA-01008: not all variables bound
    I am running this on a stored procedure as follows:
    create or replace package Crosstab
    as
        type refcursor is ref cursor;
        type array is table of varchar2(30);
        procedure pivot( p_max_cols       in number   default null,
                         p_max_cols_query in varchar2 default null,
                         p_query          in varchar2,
                         p_anchor         in array,
                         p_pivot          in array,
                         p_cursor in out refcursor );
    end;
    create or replace package body Crosstab
    as
    procedure pivot( p_max_cols          in number   default null,
                     p_max_cols_query in varchar2 default null,
                     p_query          in varchar2,
                     p_anchor         in array,
                     p_pivot          in array,
                     p_cursor in out refcursor )
    as
        l_max_cols number;
        l_query    long;
        l_cnames   array;
    begin
        -- figure out the number of columns we must support
        -- we either KNOW this or we have a query that can tell us
        if ( p_max_cols is not null )
        then
            l_max_cols := p_max_cols;
        elsif ( p_max_cols_query is not null )
        then
            execute immediate p_max_cols_query into l_max_cols;
        else
            RAISE_APPLICATION_ERROR(-20001, 'Cannot figure out max cols');
        end if;
        -- Now, construct the query that can answer the question for us...
        -- start with the C1, C2, ... CX columns:
        l_query := 'select ';
        for i in 1 .. p_anchor.count
        loop
            l_query := l_query || p_anchor(i) || ',';
        end loop;
        -- Now add in the C{x+1}... CN columns to be pivoted:
        -- the format is "max(decode(rn,1,C{X+1},null)) cx+1_1"
        for i in 1 .. l_max_cols
        loop
            for j in 1 .. p_pivot.count
            loop
                l_query := l_query ||
                    'max(decode(rn,'||i||','||
                               p_pivot(j)||',null)) ' ||
                                p_pivot(j) || '_' || i || ',';
            end loop;
        end loop;
        -- Now just add in the original query
        l_query := rtrim(l_query,',')||' from ( '||p_query||') group by ';
        -- and then the group by columns...
        for i in 1 .. p_anchor.count
        loop
            l_query := l_query || p_anchor(i) || ',';
        end loop;
        l_query := rtrim(l_query,',');
        -- and return it
        execute immediate 'alter session set cursor_sharing=force';
        open p_cursor for l_query;
        execute immediate 'alter session set cursor_sharing=exact';
    end;
    end;
    /I can see from the error message that it is ignoring the x declaration, I assume it is because it does not recognise the type refcursor from the procedure.
    How do I get it to recognise this?
    Thank you in advance

    Thank you for your help
    This is the version of Oracle I am running, so this may have something to do with that.
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    I found this on Ask Tom (http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3027089372477)
    Hello, Tom.
    I have one bind variable in a dynamic SQL expression.
    When I open cursor for this sql, it gets me to ora-01008.
    Please consider:
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.4.1 - Production
    JServer Release 8.1.7.4.1 - Production
    SQL> declare
      2    type cur is ref cursor;
      3    res cur;
      4  begin
      5    open res for
      6    'select * from (select * from dual where :p = 1) connect by 1 = 1'
      7    using 1;
      8  end;
      9  /
    declare
    ERROR at line 1:
    ORA-01008: not all variables bound
    ORA-06512: at line 5
    SQL> declare
      2    type cur is ref cursor;
      3    res cur;
      4  begin
      5    open res for
      6    'select * from (select * from dual where :p = 1) connect by 1 = 1'
      7    using 1, 2;
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    And if I run the same thing on 10g -- all goes conversely. The first part runs ok, and the second
    part reports "ORA-01006: bind variable does not exist" (as it should be, I think). Remember, there
    is ONE bind variable in sql, not two. Is it a bug in 8i?
    What should we do to avoid this error running the same plsql program code on different Oracle
    versions?
    P.S. Thank you for your invaluable work on this site.
    Followup   June 9, 2005 - 6pm US/Eastern:
    what is the purpose of this query really?
    but it would appear to be a bug in 8i (since it should need but one).  You will have to work that
    via support. I changed the type to tarray to see if the reserved word was causing a problem.
    variable v_refcursor refcursor;
    set autoprint on;
    begin 
         crosstab.pivot (p_max_cols => 4,
                 p_query => 
                   'SELECT job, COUNT (*) cnt, deptno, ' || 
                   '       ROW_NUMBER () OVER ( ' || 
                   '          PARTITION BY job ' || 
                   '          ORDER BY deptno) rn ' || 
                   'FROM   emp ' ||
                   'GROUP BY job, deptno',
                   p_anchor => crosstab.tarray ('JOB'),
                   p_pivot => crosstab.tarray ('DEPTNO', 'CNT'),
                   p_cursor => :v_refcursor);
    end;
    /Was going to use this package as a stored procedure in forms but I not sure it's going to work now.

  • PL/SQL :ORA-04052 with Database link

    i have created a database link in my producation database as following
    CREATE PUBLIC DATABASE LINK <NAME>
    CONNECT TO <USER>
    IDENTIFIED BY <P/W>
    USING <CONNECT STRING OF TARGET DATABASE
    oracle version 9.0.2.8
    OS : Windows 2003 EE R2 SP2
    Using oracle failsafe 3.3.4 with windows cluster
    Problem Description :
    whenever i run my pl/sql procecdure to pull the data from the target database i get the following error
    ERROR at line 3
    ORA-06550:line 3 column 2
    PL/SQL : ORA-04052: error occured when looking up remote object _<SCHEMA>.<TABLE>@<DATABASE LINKE NAME>_
    ORA-00604 : ERROR occured at recursive SQL level 1
    ORA-03106 : fatal tow-task communication protocol error
    ORA-02063: preceding line from <DATABASE LINK NAME>
    I have tested the same way in the test environment the same oracle version as well the OS but without oracle failsafe and windows cluster
    the script goes smoothly with out any errors.
    i have google and checked the OTN for all available solutions but still nothing its not getting throw
    i will be very thankful for your replys and solutions
    any farther clarification i am ready
    thanks in advance

    Hi,
    This forum is for issues connecting to non-Oracle databases. As the problem is using PL/SQL to connect to another Oracle database then it would be better to post a thread in the PL/SQL forum -
    PL/SQL
    If you are trying to connect to a non-Oracle database then please give us the details of which non-Oracle database and the software you are trying to use to connect.
    Regards,
    Mike

  • Error In Running dbms_scheduler.run_job ORA-27369 with psexec.

    I'm using dbms_scheduler in Oracle 10g on Windows 2008 (32-bit).
    A recent application upgrade moved a portion of my work to a Windows 2008 R2 64-bit server.
    Becuase of this I had to move some processing to this server.
    When the internal processes within the batch files ran locally, everything functioned properly.
    However, when I used 'psexec' to run them remotely on the other server, they crashed.
    The batch processes work perfectly fine on the OS level.  I believe the issue may have something to do with return code, but I'm not sure.
    JOB:
    BEGIN
    DBMS_SCHEDULER.Create_Job(
    Job_Name           => 'SCENEXPORT',
    Job_Action         => 'C:\WINDOWS\SYSTEM32\CMD.EXE',
    Number_of_Arguments=> 3,
    Job_Type           => 'EXECUTABLE',
    Enabled            => false);
    DBMS_SCHEDULER.Set_Job_Argument_Value('SCENEXPORT',1,'/q');
    DBMS_SCHEDULER.Set_Job_Argument_Value('SCENEXPORT',2,'/c');
    DBMS_SCHEDULER.Set_Job_Argument_Value('SCENEXPORT',3,'E:\DBAAdmin\Hastus\PSoft\Test\Hastus\Extract\ScenariosR.bat');
    END;
    BATCH: (ScenariosR.bat)
    psexec \\test236 -u <username> -p <pwd> e:\DBAAdmin\Hastus\PSoft\Test\Hastus\Extract\Scenarios1.bat
    ERROR:
    ERROR at line 1:
    ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
    ORA-06512: at "SYS.DBMS_ISCHED", line 150
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
    ORA-06512: at line 2
    Anyone else working with 'PSEXEC'?
    Any ideas how to work through this issue?
    Thanks.
    Bill

    I appreciate the attempt.  However, it does not address a Windows environment.
    In addition, ‘exertnaljob.ora’ does not exist in a Windows 10g install.
    If the Windows similar is the Windows Service Oracle JobScheduler, it is already using an admin level account and should not be encountering permissions issues.
    So, swing and a miss.
    Thanks,
    Bill
    Additional testing revealed some strange behavior.
    When I run it the first time, it fails.
    When I run it immediately after the first failure, it fails.
    However if I wait about ten minutes, it completes without issue.
    SQL> BEGIN
      2  DBMS_SCHEDULER.RUN_JOB ('SCENEXPORT');
      3  END;
      4  /
    BEGIN
    ERROR at line 1:
    ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
    ORA-06512: at "SYS.DBMS_ISCHED", line 150
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
    ORA-06512: at line 2
    SQL> /
    BEGIN
    ERROR at line 1:
    ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
    ORA-06512: at "SYS.DBMS_ISCHED", line 150
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
    ORA-06512: at line 2
    SQL> /
    PL/SQL procedure successfully completed.
    SQL>

  • ORA-03113 WITH CREATION OF A SPATIAL INDEX

    Hello,
    the creation of a spatial index with 11G database interrupts with:
    ORA-03113 end-of-file on communication channel.
    The table contains only point data, but has over 3.000.000 data records.
    Has anyone an idea what to do?
    Anna

    Anna,
    A couple of questions.
    1 Does this happen all the time?
    2 Can you select from table consistently?
    3 How long does it take from issuing the command to getting the error?
    The error is indicating a network timeout or similar.
    Regards.
    Ivan

  • EM doesn't allow creation of tnsnames.ora entry with service name orcl11gr2

    Dear all,
    I'm trying to create a net service name with EM Database Control, via Net Services Administration link. On the service name field, under the 'Edit Net Service Name' screen, I key in orcl11gr2, and it throws the the following error:
    Validation Error
    Examine and correct the following errors, then retry the operation:
    Service Name - Specify a valid service name.
    I wonder what is the extra validation that EM is checking. I assume it's checking the number of characters to be 8 characters or less.
    Also, because of this extra validation that is in EM, all tnsnames.ora entry that have service name = orcl11gr2, I will not be able to use EM to modify them, as I will get the same above error.
    But why does Oracle implements this extra validation, when the same validation is not implemented on other Oracle tools? For instance:
    1. dbca allows me to create a database with instance_name greater than 8 characters, and the outcome of initialization parameters will be as follow:
    db_name=orcl11gr -- truncated to 8 characters
    instance_name=orcl11gr2
    db_unique_name=orcl11gr2
    service_names=orcl11gr2
    2. Oracle Net Manager supports service name of orcl11gr2. The created Net Service Name, I have no problem connecting to the database.
    3. Listener support orcl11gr2 service name
    I'm using Oracle 11g R2 (11.2.0.1.0) for Microsoft Windows (x64), running on Windows 7.

    For your reference, here is the bug numbner: 10278345.
    -Mughees

  • Compiling error ORA-00600 with Forms 6 and Database 10g

    Hi,
    I am using "Oracle Database 10g Enterprise Edition Release 10.1.0.4.0" and "Forms [32 Bit] Version 6.0.8.26.0 " with patch 17, when i compile a form that works with some tables in another database under dblink the error ORA-00600:internal error code, arguments:[16203],[],[],[],[],[],[],[] is displayed.
    If i word with reports or sqlplus no error is displayed.
    Before we installed 10g everything worked ok
    What is wrong with forms or do i need to configure something else?
    Regards
    Yuri V. López Manrique

    I searched for this error on Google and found the following blog:
    Is there a tool to troubleshoot ORA-00600 and ORA-07445 errors?
    February 27th, 2006 By Fahd Mirza
    ORA-00600 and ORA-07445 errors are the most esoteric errors in Oracle.
    There is a tool called “ORA-600/ORA-7445 Troubleshooter” available at Metalink. It asks for the first argument of ORA-600 error with an optional database version number.
    For example, to see the description of the error:
    ORA-00600: internal error code, arguments: [723], [25908], [25908], [memory leak]
    You enter 723 in the “ORA-600 First Argument” field. The first argument is a pointer to where in the code the error was caught and thus is the key information in identifying the problem.
    You can also embed (copy/paste) the “Call Stack Trace” there, and, when you click on the “Search Call Stack” button an advanced MetaLink search is performed to find documents containing relevant sections from the call stack.
    Call Stack extracts from the following files are supported:
    * Generic foreground and background server trace files located in background_dump_dest and user_dump_dest
    * OpenVMS NETV2 and BEQ log files located in ORA_ROOT:[NETWORK.LOG]
    * WINDOWS CORE.LOG files
    * GDB (debugger) backtrace call stacks (best endeavors)
    Of course you will need a login to Oracle's Metalink site.
    Hope that helps,
    c

  • OAF Update of Custom Table causing ORA-600 with database block corruption?

    Using OA Framework 12.1.3, running under EBusiness Suite 12.1.3
    Created Custom Web page operating against Custom Tables
    ISSUE
    On about 2% of new records, when OAF is UPDATING a record in a certain table, it  is failing with
    java.sql.SQLException: ORA-00607: Internal error occurred while making a change to a data block
    ORA-00600: internal error code, arguments: [kddummy_blkchk], [815], [26412], [6110], [], [], [], []
    ORA-06512: at line 1
    Before the DBA turned on 10.2.0.4.0 DB_BLOCK_CHECKING parameter, this actually
    resulted in corrupted data blocks in the database and corrupted indexes that
    eventually crashed the database and we had to do a full recovery with 2 days downtime.
    Now that we have turned on DB_BLOCK_CHECKING, it simply errors out and puts things
    in the alert log, but the records still fail to update as the writes are blocked.
    Then oddly, a few days later.. the records become editable.  And others fail.
    This is ONLY happening on the one particular table being updated by OAF.  Other custom pages
    posting to other custom tables are having no problems.   We've CTAS'd the table back and
    forth and recreated the indexes, and that did not help.
    Support says to post to the Forum  ( So I am! ) or hire Oracle consulting.. which doesn't make
    much sense given the error.  The Recovery Team that helped us in a separate SR ( we had
    to do db_repairs not just recovery ) felt it was an important problem the OAF team needed to
    strongly review.
    Anyone else encounter this already and know of a solution?
    TIA
    Karl

    After MANY hours of trial and error and research, we've identified ONE use case that seems to apply to 90% of the issue we have encountered.
    YMMV.
    The BC4J generated SQL which is generating the ORA-600 is
    BEGIN UPDATE XXRETURNHEADER ReturnHeaderEO SET INTERNAL_TEXT=?,LAST_MOD_USERNAME=?,OBJECT_VERSION_NUMBER=?,LAST_UPDATE_DATE=?,LAST_UPDATED_BY=?,LAST_UPDATE_LOGIN=? WHERE RMA_NUMBER=? AND ORGANIZATION_ID=? RETURNING TROUBLESHOOT_DATE, FAA_TAG_DATE, FAILURE_ANALYSIS_DATE, LAST_MOD_DATE, FAA_REVISED_DATE, TTE_TECH_SEND_DATE, TTE_REP_RESPONSE_DATE, TTE_REP_APPROVED, TTE_RMA_RANDOM_KEY, OBJECT_VERSION_NUMBER, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN INTO ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?; END;".
    We determined that if TTE_RMA_RANDOM_KEY was not a null value, we would get an ORA-600 error whenever we did an APPLY from the OAF Page to update the record.
    If we set that table attribute to NULL for the record using SQL.. then used the  OAF Page to APPLY.. it worked fine and the record saved without error.
    We then modified the EO to NOT   "Refresh After Update"  ( thus removing it from the RETURNING clause generated )... and even if the TTE_RMA_RANDOM_KEY
    had a value... the OAF Page APPLY worked and the record saved without error.
    I cannot identify anything from the User programming side that is wrong ( and neither could Oracle ), and it REALLY should be in the RETURNING clause list of
    attributes.. but this is the only workaround I've found that doesn't crash the Page and irritate the user to no end.
    I have reported my findings via the SR back to Oracle to do with it what they may... but it looks strongly ,to me, to be an error in the BC4J/JDBC/Database
    coordination and passing data between those black boxes.

  • ORA-22275 with BFILE record processing

    Hi All,
    I'm processing records in a table that contains an optional bfile column and then comparing each record with another record from the same table. I'm getting "ORA-22275: Invalid LOB locator specified" when I get my comparison record using a function - and the cursor record contains a null bfile following a not null bfile record.
    Here's my simplified 11g test case:
    create table jr_test
    (pk_id number not null
    ,stuff varchar2(100) not null
    ,external_file bfile);
    insert into jr_test values (1,'Some other data',bfilename('MY_DIR','jr1.txt'));
    insert into jr_test values (2,'Some other data',bfilename('MY_DIR','jr2.txt'));
    insert into jr_test values (3,'No bfile',null);
    commit;
    DECLARE
       l_rec_1 jr_test%ROWTYPE;
       l_rec_2 jr_test%ROWTYPE;
       FUNCTION record_to_compare(p_id IN jr_test.pk_id%TYPE) RETURN jr_test%ROWTYPE IS
          l_rec jr_test%ROWTYPE;
       BEGIN
          SELECT *
          INTO   l_rec
          FROM   jr_test
          WHERE  pk_id = p_id;
          RETURN l_rec;
       END record_to_compare;
    BEGIN
       FOR x IN (SELECT *
                 FROM   jr_test
                 ORDER  BY pk_id /* desc */) -- ORA-22275 when order by pk_id asc
       LOOP
          l_rec_1 := x;
          -- Get another record (it's always the same one in this test case)
          l_rec_2 := record_to_compare(x.pk_id);
       END LOOP;
    END;With a descending order by clause (ie. null bfile first) it works OK.
    With an ascending order by clause (ie. not null bfiles first) it crashes with ORA-22275.
    It looks like a LOB initialisation problem, but I's welcome your comments.
    Regards
    JR

    Hello
    It doesn't actually appear to have anything to do with the order by as such, it is just the order in which the rows are accessed. I've modified your test case to just call the function in a specific order. However if I change to use a stored procedure with an OUT parameter, there is no such issue. I'll dig a bit more but maybe this helps narrow the field of search down a little...
    XXXX> declare
      2      l_rec_1 jr_test%ROWTYPE;
      3      l_rec_2 jr_test%ROWTYPE;
      4
      5      FUNCTION record_to_compare(p_id IN jr_test.pk_id%TYPE) RETURN jr_test%ROWTYPE IS
      6         l_rec jr_test%ROWTYPE;
      7      BEGIN
      8         SELECT *
      9         INTO   l_rec
    10         FROM   jr_test
    11         WHERE  pk_id = p_id;
    12
    13         RETURN l_rec;
    14      END record_to_compare;
    15
    16   BEGIN
    17
    18     -- Get another record (it's always the same one in this test case)
    19     l_rec_2 := record_to_compare(1);
    20     l_rec_2 := record_to_compare(2);
    21     l_rec_2 := record_to_compare(3);
    22
    23   END;
    24   /
    declare
    ERROR at line 1:
    ORA-22275: invalid LOB locator specified
    Elapsed: 00:00:00.12
    XXXX>
    XXXX>   declare
      2      l_rec_1 jr_test%ROWTYPE;
      3      l_rec_2 jr_test%ROWTYPE;
      4
      5      FUNCTION record_to_compare(p_id IN jr_test.pk_id%TYPE) RETURN jr_test%ROWTYPE IS
      6         l_rec jr_test%ROWTYPE;
      7      BEGIN
      8         SELECT *
      9         INTO   l_rec
    10         FROM   jr_test
    11         WHERE  pk_id = p_id;
    12
    13         RETURN l_rec;
    14      END record_to_compare;
    15
    16   BEGIN
    17
    18     -- Get another record (it's always the same one in this test case)
    19     l_rec_2 := record_to_compare(3);
    20     l_rec_2 := record_to_compare(2);
    21     l_rec_2 := record_to_compare(1);
    22
    23   END;
    24   /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    XXXX>
    XXXX>  declare
      2      l_rec_1 jr_test%ROWTYPE;
      3      l_rec_2 jr_test%ROWTYPE;
      4
      5      PROCEDURE record_to_compare
      6      (p_id IN jr_test.pk_id%TYPE,
      7       p_row out jr_test%ROWTYPE
      8      )
      9      IS
    10      BEGIN
    11         SELECT *
    12         INTO   p_row
    13         FROM   jr_test
    14         WHERE  pk_id = p_id;
    15      END;
    16
    17   BEGIN
    18
    19     -- Get another record (it's always the same one in this test case)
    20     record_to_compare(3,l_rec_2);
    21     record_to_compare(2,l_rec_2);
    22     record_to_compare(1,l_rec_2);
    23
    24   END;
    25   /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    XXXX>
    XXXX>    declare
      2      l_rec_1 jr_test%ROWTYPE;
      3      l_rec_2 jr_test%ROWTYPE;
      4
      5      PROCEDURE record_to_compare
      6      (p_id IN jr_test.pk_id%TYPE,
      7       p_row out jr_test%ROWTYPE
      8      )
      9      IS
    10      BEGIN
    11         SELECT *
    12         INTO   p_row
    13         FROM   jr_test
    14         WHERE  pk_id = p_id;
    15      END;
    16
    17   BEGIN
    18
    19     -- Get another record (it's always the same one in this test case)
    20     record_to_compare(1,l_rec_2);
    21     record_to_compare(2,l_rec_2);
    22     record_to_compare(3,l_rec_2);
    23
    24   END;
    25   /
    PL/SQL procedure successfully completed.HTH
    David

  • SQL*Loader : ORA-19007 with missing Schema Location Hint

    Hi,
    These days I'm stuck with a 10.1.0.4 database (OS Linux Red Hat), and I'm trying to find a workaround for the following situation :
    XML schema (sfgtest.xsd)
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
               xmlns:xdb="http://xmlns.oracle.com/xdb">
      <xs:element name="Code" xdb:SQLName="Code" xdb:SQLType="VARCHAR2">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:maxLength value="16"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Val" xdb:SQLType="NUMBER" xdb:SQLName="Val">
        <xs:simpleType>
          <xs:restriction base="xs:decimal">
            <xs:totalDigits value="12"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Chq">
        <xs:complexType xdb:SQLType="SFG_CHQ_TYPE">
          <xs:sequence>
            <xs:element ref="Code"/>
            <xs:element ref="Val"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="NbRem" xdb:SQLType="NUMBER" xdb:SQLName="NbRem">
        <xs:simpleType>
          <xs:restriction base="xs:integer">
            <xs:totalDigits value="5"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Rmbt" xdb:defaultTable="TEST_XML_SFG">
        <xs:complexType xdb:SQLType="SFG_RMBT_TYPE">
          <xs:sequence>
            <xs:element ref="NbRem"/>
            <xs:element ref="Rem" maxOccurs="unbounded" xdb:SQLCollType="SFG_REM_COLL"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="CodeAff" xdb:SQLName="CodeAff" xdb:SQLType="VARCHAR2">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:maxLength value="12"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="Rem" xdb:SQLName="Rem">
        <xs:complexType xdb:SQLType="SFG_REM_TYPE">
          <xs:sequence>
            <xs:element ref="CodeAff"/>
            <xs:element ref="Chq" maxOccurs="unbounded" xdb:SQLCollType="SFG_CHQ_COLL"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    Sample document (sfgtest.xml)
    <?xml version="1.0" encoding="iso-8859-1"?>
    <Rmbt>
    <NbRem>3</NbRem>
    <Rem>
      <CodeAff>AFF001</CodeAff>
      <Chq><Code>X01001</Code><Val>10.00</Val></Chq>
      <Chq><Code>X01002</Code><Val>10.00</Val></Chq>
      <Chq><Code>X01003</Code><Val>10.00</Val></Chq>
    </Rem>
    <Rem>
      <CodeAff>AFF002</CodeAff>
      <Chq><Code>X02001</Code><Val>10.00</Val></Chq>
      <Chq><Code>X02002</Code><Val>10.00</Val></Chq>
      <Chq><Code>X02003</Code><Val>10.00</Val></Chq>
    </Rem>
    <Rem>
      <CodeAff>AFF003</CodeAff>
      <Chq><Code>X03001</Code><Val>10.00</Val></Chq>
      <Chq><Code>X03002</Code><Val>10.00</Val></Chq>
      <Chq><Code>X03003</Code><Val>10.00</Val></Chq>
      <Chq><Code>X03004</Code><Val>10.00</Val></Chq>
      <Chq><Code>X03005</Code><Val>10.00</Val></Chq>
    </Rem>
    </Rmbt>
    Schema registration
    begin
    dbms_xmlschema.registerSchema(
    schemaURL => 'sfgtest.xsd',
    schemaDoc => xmltype(bfilename('DUMP_DIR','sfgtest.xsd'),nls_charset_id('AL32UTF8')),
    local => true,
    genTypes => true,
    genTables => false
    end;
    Table creation
    create table test_xml_sfg of xmltype
    xmltype store as object relational
    xmlschema "sfgtest.xsd"
    element "Rmbt"
    varray xmldata."Rem" store as table test_xml_sfg_rem_tab
    ( primary key (NESTED_TABLE_ID, ARRAY_INDEX) ) organization index overflow
    varray "Chq" store as table test_xml_sfg_chq_tab
      ( primary key (NESTED_TABLE_ID, ARRAY_INDEX) ) organization index overflow
    );I originally wanted to use SQL*Loader to test performance, as I may have to load multiple files in the same time.
    It works great on 10gR2 and 11gR2 with XML files up to 100 MB loaded in a matter of minutes.
    However, a little issue with 10gR1 :
    SQLLDR control file
    LOAD DATA
    INFILE 'filelist.txt'
    APPEND
    INTO TABLE test_xml_sfg
    XMLTYPE(XMLDATA) (
    filename filler char(260),
    XMLDATA LOBFILE(filename) TERMINATED BY EOF
    )with filelist.txt :
    sfgtest.xmlExecution throws "ORA-19007: Schema - does not match expected sfgtest.xsd".
    As per the documentation, it's expected behaviour in 10.1 :
    http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10790/xdb03usg.htm#BABECCBG
    The XML document must include the appropriate attributes from the XMLSchema-instance namespace or the XML document must be explicitly associated with the XML schema using the XMLType constructor or the createSchemaBasedXML() method.Also as expected, the file is loaded OK after adding the following in the root element :
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sfgtest.xsd"But, as I don't have any latitude on the files received (i.e. I can't add the location hint), is there some workaround, when using SQL*Loader, to treat the XML file as an instance document?
    Thanks for any solution/idea.

    Not sure if it will work, but out of the top of my head I would make an attempt to create an view (for update) based on the XMLType table and do the insert via the view, matching the incoming XML doc to the schema via
    xmltype(xml_messsage).createSchemaBasedXML(xml_schema)

  • ORA-01031 with materialized view in stored procedure

    USER1 has created a materialized view (MV). The MV is owned by USER2. USER1 needs to query the MV from within a stored procedure. How do I avoid the ORA-01031?
    Here's the illustration:
    SQL> show user
    USER is "USER1"
    SQL> CREATE MATERIALIZED VIEW USER2.ROLL
    2 BUILD IMMEDIATE
    3 REFRESH COMPLETE WITH ROWID
    4 ON DEMAND
    5 AS
    6 select * from user2.test_roll;
    Materialized view created.
    SQL> select status,owner,object_name,object_type where OBJECT_TYPE='MATERIALIZED VIEW';
    STATUS OWNER OBJECT_NAME OBJECT_TYPE
    VALID USER2 ROLL MATERIALIZED VIEW
    SQL> select count(*) from user2.roll;
    COUNT(*)
    959485
    SQL> declare
    2 n number;
    3 begin
    4 select count(*)
    5 into n
    6 from user2.roll
    7 where rownum<100;
    8 dbms_output.put_line(n);
    9* end;
    SQL> /
    99
    PL/SQL procedure successfully completed.
    SQL> create procedure test_mv is
    2 n number;
    3 begin
    4 select count(*)
    5 into n
    6 from as400_snpsht.roll
    7 where rownum<100;
    8 dbms_output.put_line(n);
    9 end;
    10 /
    Warning: Procedure created with compilation errors.
    SQL> select text from user_errors where name like 'TEST_MV';
    TEXT
    PL/SQL: ORA-01031: insufficient privileges
    PL/SQL: SQL Statement ignored
    So the point is:
    * Ad hoc sql works on the MV
    * Anonymous pl/sql works on the MV
    * Stored procedure fails compilation with ora-01031
    Any suggestions are appreciated.

    Sorry; In may example 'as400_snpsht' should have been 'USER2' (the owner of the MV). I changed the real user names to USER1, USER2 to make the example clearer but missed that one.
    I meant to say...
    SQL> create procedure test_mv is
    2 n number;
    3 begin
    4 select count(*)
    5 into n
    6 from user2.roll
    7 where rownum<100;
    8 dbms_output.put_line(n);
    9 end;
    10 /
    Warning: Procedure created with compilation errors.
    SQL> select text from user_errors where name like 'TEST_MV';
    TEXT
    PL/SQL: ORA-01031: insufficient privileges
    PL/SQL: SQL Statement ignored

  • SVG CHart error ORA-20001 with Stacked Bar Chart HTML DB 1.6.0.00.87

    Hi,
    during I put a How-To into execution (How To Create a Stacked Bar Chart) I'll get the following error code:
    SVG Chart error:ORA-20001:line_Chart error:ORA-20001:
    get_data error:ORA-20001:Parse error:ORA009
    (see http://www.oracle.com/technology/products/database/htmldb/howtos/index.html)
    This Situation occurs when i add a second series to the
    chart. The first series works fine. I've used the following SQL-Statement:
    select null l, sales_month, revenue from (select to_char(o.order_timestamp,'Mon YYYY') sales_month, sum(oi.quantity * oi.unit_price) revenue, to_date(to_char(o.order_timestamp,'Mon YYYY'),'Mon YYYY') sales_month_order from DEMO_PRODUCT_INFO p, DEMO_ORDER_ITEMS oi, DEMO_ORDERS o where o.order_timestamp <= (trunc(sysdate,'MON')-1)and o.order_timestamp > (trunc(sysdate-365,'MON'))and o.order_id = oi.order_id and oi.product_id = p.product_id and p.category = 'Audio' group by to_char(o.order_timestamp,'Mon YYYY') order by sales_month_order);
    Please help.
    Regards
    Detlev

    Well,
    I've just been struggling for a couple of hours with a cluster bar chart giving the same problem.
    The problem is definitely with "ORDER BY".
    I guess the graphing chart is taking the sql query as a string and then does some other manipulation on it which ends abnormally when you include the order by clause.
    I presume that if you embed the query in a
    SELECT * FROM (<actual query with order by>)
    it might mitigate the problem.
    Bye,
    Flavio

Maybe you are looking for

  • Cant control the volume??!!

    i just updated to 3.0, and now there is noway to control the volume? i have a 1st gen ipod touch which has no volume buttons, when i press the home button twice to open the music window, it says "dock connector" tell if I'm missing something, i haven

  • Pandora sound quality bad -- how to add on site to browser

    The sound quality for pandora is really bad lately. A new problem. Songs break up routinely, even if I am only wordprocessing on my computer. For their FAQ, they suggest add pandora to my sites, but don't know how to do this -- tried to find a place

  • Hyperlink in a dialog - possible? (Javascript)

    Hi Is it possible to make a hyperlink in a dialog E.g., To execute a mailto: which would open the email app with settings Thanks David

  • HP photosmart D7260 Error 0xc18a0001

    Good afternoon all!  I have been getting the Error: 0xc18a0001 - Ink System Failure on my HP Photosmart D7260 printer over the last few days and I have absolutely no idea how to fix it.  I have looked through forums, searched on google, tried things

  • Converting VRO movie files

    OK. Should start by stating that I'm a long time Mac user (since 1989), first time caller- And I live in the digital SLR photography world. Question: Need to be able to use iMovie to edit video recorded as .VRO format. Can Quick Time Pro convert the