Sequence created in anon PL/SQL, lack of initial value

If I create a sequence in an anonymous PL/SQL block, with immediate execution, and then perform a select nextval from this sequence outside of the block, its initial value is missing.

Easily reproducible here:

create table tab_a (col_a number 4 not null);

Start
run immediately ' create the sequence seq_a with increment 47 1';
end;
/

insert into tab_a seq_a.nextval selection of double;

Select * from tab_a;

This is a very simplified representation of the circumstance in which I found myself, but it reproduces the effect I see.

If I drop the sequence to truncate the table and run the statements (except the first) once again, it works as expected. If I delete the table and rerun all statements, she again returns the wrong answer.

I don't need a workaround solution, the issue has been addressed a long time ago, but I would like to know WHY this happens. from 47 of the sequence can be any number, it is there just to show the question when 48 is inserted into the table. The latter could be in any table and can be on any table rather than double.

Oracle EE 11.2.0.1.0 on node OE Linux, RAC and single.

TIA.

It could be like, in oracle 11.2 (GR 11, 2) there is a new feature 'deferred_segment_creation' = true (maybe in your case). Then sequence is get initialized before inserting the 1 record to the table because of the creation of segment.

Change both the default value FALSE check after that. It can solve your case!

Reference:--

http://www.dbsnaps.com/Oracle/Oracle-deferred-segment-creation/

It has already been notified in the previous discussions.

Thank you!

Tags: Database

Similar Questions

  • How to create a database in SQL Server Express 2014 to be used with LV Database Toolkit

    I use LV Database Toolkit, which, by default, uses the Jet database. Now, I want to use the SQL with LV Database Toolkit database. I downloaded and installed "SQL Server Express with Tools 2014" in my laptop of Labview. Now I want to create a database in SQL Server, because I think that it is a requirement for the creation of a "udl connection file" (file *.udl). Please help me!


  • Create a simple query (SQL)

    Hi experts,

    I have a table with data as follows:

    Database version: 10.2.0.4
    Table name: TRANSACTION_HIST_TAB
    TRANS_ID      LOT_NO    PART_NO    QTY    TRANSACTION         LOCATION_NO    ROWVERSION
    ---------     -------   --------   ----   -----------------   ------------   ----------------------
    T00000X1      L001     ABC         10     CHANGE LOCATION     WRH_1          01/01/13 08:00:00 AM
    T00000X2      L001     ABC        10     CHANGE LOCATION     WRH_2          01/02/13 10:00:00 AM
    T00000X3      L002     XYZ        20     CHANGE LOCATION     WRH_3          01/03/13 11:00:00 AM
    and I want to create a single query (SQL) which can get data grouped by LOT_NO and only the first transaction by LOT_NO

    Expected results:
    TRANS_ID      LOT_NO    PART_NO    QTY    TRANSACTION         LOCATION_NO    ROWVERSION
    ---------     -------   --------   ----   -----------------   ------------   ----------------------
    T00000X1      L001     ABC         10     CHANGE LOCATION     WRH_1          01/01/13 08:00:00 AM
    T00000X3      L002     XYZ        20     CHANGE LOCATION     WRH_3          01/03/13 11:00:00 AM
    Someone has an idea?

    Kind regards

    Rob

    Hi, Rob.

    Here's one way:

    WITH     got_r_num     AS
    (
         SELECT     t.*     -- or list columns you want
         ,     ROW_NUMBER () OVER ( PARTITION BY  lot_no
                                   ORDER BY          rowversion
                           )  AS r_num
         FROM    transaction_hist_tab  t
    )
    SELECT       *     -- or list all columns except r_num
    FROM       got_r_num
    WHERE       r_num     = 1
    ;
    

    Depending on your data and your needs, match Sub like Manik suggested, might work. I think that you want to GROUP BY lot_no only, no transid.

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and the results you want from this data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

  • Create the view using SQL DEVELOPER

    I'm new to this forum :)

    11 GR 2, WIN2008 R2

    SQL Developer Version 3.2.09

    I am creating the data below view (view existing)

    Table: Dovmarker
    MARKERBOREHOLE                             UWI             MARKERSURFACE              Z
    WELLXXX               65372643AAAA     Cw     -982,985619574516
    WELLXXX               65372643AAAA     Cn     -1891,47401803955
    WELLXXX               65372643AAAA     J     -674,989528816517
    WELLXXX               65372643AAAA     K3     20,00165000429
    WELLXXX               65372643AAAA     Tr     125,000317308153
    WELLXXX               65372643AAAA     K1     -658,989731894024
    WELLXXX               65372643AAAA     Q     149,999999999549
    
    WELLYYY                          56618334AAAA     Jkm     -715,071442105268
    WELLYYY                          56618334AAAA     K3     36,9013966413975
    WELLYYY                          56618334AAAA     J2     -976,056079257549
    WELLYYY                          56618334AAAA     Tr     106,900507694299
    I try to describe the table and my goal :),

    each line describes wells, uwi(uniqe identifier), z (deppth), high (surface marker)

    I try to merge all lines with the same MARKERBOREHOLE/UWI and MARKERSURFACE contact coresponding Z (ascending) as MARKERSURFACE = Z.
    If it is posibble to reduce the number of decimals to 2.

    My idea to solve the problem:
    example: ' | ' is the delimiter
    WELLXXX    Q=149,999999999549 | Tr=125,000317308153 | K3=20,00165000429 |  K1=-658,989731894024 | J =-674,989528816517 | Cw=-982,985619574516 | Cn=-1891,47401803955
    WELLYYY   Tr=106,900507694299 | K3=36,9013966413975 |  Jkm=-715,071442105268 | J2=-976,056079257549
    or better (not enough knowledge ;))
    WELLXXX    Q=149,999999999549 
                     Tr=125,000317308153
                     K3=20,00165000429 
                     K1=-658,989731894024 
                     J =-674,989528816517 
                     Cw=-982,985619574516 
                     Cn=-1891,47401803955
    
    WELLYYY   Tr=106,900507694299 
                     K3=36,9013966413975 
                     Jkm=-715,071442105268 
                     J2=-976,056079257549
    Number of markersurface is different for each well


    I try to do it by the listagg function, but I have failled
    select markerborehole, listagg(z, ' | ') within group (order by z) as new1 
      from dovmarker
      group by markerborehole;
     
    result:
    WELLZZZ  -2575,95869465411 | -1891,47401803955 | -982,985619574516 | -674,989528816517 | -658,989731894024 | 
    WELLRRR -2376,96975480605 | -2376,96975480605 | -2308,97180590009 | -2308,97180590009 | -2206,47428534641 | -2206,47428534641 | -2163,97522524171
    When I tried to create new view in sql developer I occurred error;
    Error(s) parsing SQL:
    unexpected token near *!* in the following:
    select markerborehole, listagg(z, ' | ') within *!*group (order by z) as new1
    unexpected token near *!* in the following:
    select markerborehole, listagg(z, ' | ') within group *!*(order by z) as new1
    missing expression near *!* in the following:
    select markerborehole, listagg(z, ' | ') within group (*!*order by z) as new1
    Can you help me with this?

    Concerning
    Jaroslaw

    961148 wrote:
    I missed x

    Well Yes, my apologies, I has not changed all that.

    It's a simple way to format the Z value to 2 decimal places?

    Yes. It depends on if you want to use rounded, floor, ceiling, truncate or if you like a string always have 2 decimal places etc.
    Make your choice and customize according to your needs...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select 'WELLXXX' as MARKERBOREHOLE, '65372643AAAA' as UWI, 'Cw' as MARKERSURFACE, -982.985619574516 as Z from dual union all
      2             select 'WELLXXX', '65372643AAAA', 'Cn', -1891.47401803955 from dual union all
      3             select 'WELLXXX', '65372643AAAA', 'J', -674.989528816517 from dual union all
      4             select 'WELLXXX', '65372643AAAA', 'K3', 20.00165000429 from dual union all
      5             select 'WELLXXX', '65372643AAAA', 'Tr', 125.000317308153 from dual union all
      6             select 'WELLXXX', '65372643AAAA', 'K1', -658.989731894024 from dual union all
      7             select 'WELLXXX', '65372643AAAA', 'Q', 149.999999999549 from dual union all
      8             select 'WELLYYY', '56618334AAAA', 'Jkm', -715.071442105268 from dual union all
      9             select 'WELLYYY', '56618334AAAA', 'K3', 36.9013966413975 from dual union all
     10             select 'WELLYYY', '56618334AAAA', 'J2', -976.056079257549 from dual union all
     11             select 'WELLYYY', '56618334AAAA', 'Tr', 106.900507694299 from dual)
     12  --
     13  -- END OF TEST DATA - IGNORE ABOVE WITH CLAUSE
     14  --
     15  select z
     16        ,round(z,2) as round_z_2
     17        ,floor(z*100)/100 as floor_z_2
     18        ,ceil(z*100)/100 as ceil_z_2
     19        ,trunc(z,2) as trunc_z_2
     20        ,to_char(round(z,2),'fm9990.00') as string_z_2
     21* from t
    SQL> /
    
                      Z  ROUND_Z_2  FLOOR_Z_2   CEIL_Z_2  TRUNC_Z_2 STRING_Z
    ------------------- ---------- ---------- ---------- ---------- --------
     -982.9856195745160    -982.99    -982.99    -982.98    -982.98 -982.99
    -1891.4740180395500   -1891.47   -1891.48   -1891.47   -1891.47 -1891.47
     -674.9895288165170    -674.99    -674.99    -674.98    -674.98 -674.99
       20.0016500042900         20         20      20.01         20 20.00
      125.0003173081530        125        125     125.01        125 125.00
     -658.9897318940240    -658.99    -658.99    -658.98    -658.98 -658.99
      149.9999999995490        150     149.99        150     149.99 150.00
     -715.0714421052680    -715.07    -715.08    -715.07    -715.07 -715.07
       36.9013966413975       36.9       36.9      36.91       36.9 36.90
     -976.0560792575490    -976.06    -976.06    -976.05    -976.05 -976.06
      106.9005076942990      106.9      106.9     106.91      106.9 106.90
    
    11 rows selected.
    

    with above code I try to create a new view in SQL Developer, but I have error:

    Error(s) parsing SQL:
    Unexpected token near *!* in the following:
    select markerborehole, listagg(z,chr(10)) within *!*group(order by rn) as z
    Unexpected token near *!* in the following:
    select markerborehole, listagg(z,chr(10)) within group*!*(order by rn) as z
    Missing expression near  *!* in the following:
    select markerborehole, listagg(z,chr(10)) within group(*!*order by rn) as z
    

    What are all the {noformat}! * * {noformat} in the code? Delete them.

    Edit: or maybe your version of SQL Developer is not up-to-date and does not know the new LISTAGG function in 11g?

    Published by: BluShadow on 26-Sep-2012 09:41

  • How can I select stuff of table has created in the PL/SQL script?

    When I execute a select statement, SQLplus complains of the table does not exist. But it has been created? Don't know what goes wrong... Thanks in advance...

    The code is as follows:




    DECLARE

    column_table varchar (50): = "column_table";
    r_count NUMBER (10): = 0;

    BEGIN
    column_table: = UPPER (column_table);

    -I created the table here and validation
    IMMEDIATELY RUN 'CREATE TABLE' | column_table | "(varchar2 (100) from table_name, column_name varchar2 (1000))';
    commit;

    IF someCondition THEN
    Bonneau
    -It's where SQLPLUS complains about the table or view does not exist
    Select count (1) in the column_table r_count where table_name = someValue;
    Bonneau
    END IF;


    END;
    /

    You will need to use dynamic sql to access objects created by using dynamic sql.
    >
    Select count (1) in the column_table r_count where table_name = someValue;
    >
    During this "compilation" the table declaration that it is trying to reference does not exist then you get an error.

    The table does exist when the code is executed.

  • Creating APEX pages via SQL scripts...

    Hi guys,.

    I want to create APEX via Script SQL pages. The main reason for having this option I have couple of applications that contains XML files for the definition of the screen where I can read all the properties of the screen (field types, sizes, legend, etc...)

    Is there a documentation or help tips where I can find the APEX page tables definitions? I found something as WWV tables but I couldn't understand it correctly...

    Any help?

    Thank you
    Osman...

    Check out ApexGen, the Apex Oracle generator. It allows you to use a PL/SQL API to generate a SQL script, similar to an Apex application export file.

    http://sourceforge.NET/projects/apexgen/

    With ApexGen, it does not matter if you have 5 or 500 tables in your database, you can easily generate report for each table, and form pages very quickly.

    M

  • Set initial value as the number of sequence/date/from the user

    Hi guys, I created a datablock and set up the user interface to allow users to insert all the data they need, however my table has a:

    ID - which is uniqe with each entry of the table is then gernerate by a sequence (that I created on the database), but when I put seq.nextval in the initial value on the datablock it says that I can not do that, so how can I use the sequence to insert the value in this field in the database. It's my first key in my whichobviosuly database my users cannot enter data for, on the contrary, it is generated automatically.

    User - in the same way in the datablock is a user field that has the user that inserted record, I know I can set the default for this field, but how to make the user automatically insert through forms on the database.

    Same again how put SYSDATE is automatically entered in the field date when the user submits the file?

    Any help on this would be GREATLY appreciated.

    Thanks in advance.

    Published by: user13390506 on August 5, 2010 04:11

    The DUAL table:
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/queries009.htm#sthref3198

    With: new, you reference the column should be inserted (in a trigger to update you: old and: where new: old contains the value before and: new value after the update of the column)

    Regarding your real problem: without a few pieces of code fails and you did, it's a little difficult to say what happened here. If you could get better answers by sharing.

    Sharing also the Versions of database (4 digits) and Versions of forms is important in order to obtain a response apropriate.

    Anyway: you seem to be new to the whole forms / SQL / PL/SQL stuff, so I might suggest:
    http://Tahiti.Oracle.com is a very good starting point for SQL and PL/SQL. This isn't a RTFM but rather a Council. Once you got used to you will like it. For my part, I could not live without tahiti: D.

    Cheers.

  • Do stuff to PL/SQl that returns the value and redirect to modal page by setting this value

    Hello

    a button click Page1 I would perform a PL/SQL procedure that returns a value in P1_ITEMVAL and then redirect to a page 2 (modal page) and the value of an item on this page with the value previously returned. To do the same thing with a normal page is quite easy:

    Button action is present, then process of PL/SQL that returns the value in the P1_ITEMVAL element and, finally, a branch at page 2 that sets P2_ITEMVAL with P1_ITEMVAL. I really have no idea how to do the same thing when the target is a modal page.

    I created a unit test on https://apex.oracle.com/pls/apex (application 1554 - redir_to_modal)

    Workspace: tests

    USER: supporter

    PWD: supporter1234

    Any help would be much appreciated.

    Kind regards

    Pavel

    Pavel

    If you prepare a URL using the value calculated in the PLSQL of DA part you can then use a subsequent stage of javascript to set the location of the window.

    This will jump to the top of the page of the modal dialog box

    : P1_URL: = apex_util.prepare_url)

    ' f ? p ='|| : APP_ID - Application id

    |': 2' - Page id

    ||': ' || : APP_SESSION - Session id

    ||':'                      -- Request

    ||':NO'                    -- Debug

    : ': ' - Clear Cache

    : ': ' - Settings

    ||' P2_ITEMVAL'

    : ': ' - Parameter values

    || (: P1_ITEMVAL);

    then in the action of javascript

    Window.Location.Replace ($v ('P1_URL'));

    Hope this is of some use

    Concerning

    Kelvin

  • Lineage tracing an SQL error: ORA-22813: value of the operand exceeds the limits of the system

    Hi all

    I started playing with OEMM and I get the following error when I try to 'Trace Data Impact' in an Oracle table. Here's what I do:

    • I created a template and collected a few schemas/tables:

    Capture.JPG

    Capture1.JPG

    • Now when I try to "Trace Data Impact' on the table AP_DEF_STG, I get the following:

    Capture2.JPG

    Capture3.JPG

    Capture4.JPG

    I already tried to create a "Configuration" for her, I tried to text instead of graphics, but the error is the same. If I go to a view of Oracle and do a "track Data Lineage", I get the same error again.


    That someone was already been in this situation? This is the full error trace:


    ({"error": true, "errorMessage": "SQL error during the tracing of lineage: ORA-22813: value of the operand exceeds the limits of the system"})

    ', 'errorType': 'Line error', 'errorCodes': "[LNGTRC_E0016]".

    ","stackTrace":"Error Codes - [LNGTRC_E0016].

    Request - VizModelLineage

    Settings - showInternalObject [false] showNoType [true] showControlLinks [false] startingIds [17 #4723 #0] isBizUI [false] ObjectID [17 #1 #0] showSummaryView [true] collapseLevel [features] resetCache [fake] profile [] showMappingsAsNodes [true] skipCache [false] tracingDirection [3] tracingType [DataLineage] [ReportTree2202015-104855025] originalStartingObject cacheId [17 #4723 #0] viewType actionType [loadlineage] of viewId [ReportTree2202015-104855025] [ModelLineage]

    MITI.web.common.exceptions.LineageUIException: SQL for tracing line error: ORA-22813: value of the operand exceeds the limits of the system

    at MITI.web.common.service.facades.LineageFacadeImpl.getLineageGraph (LineageFacadeImpl.java:284)

    at MITI.flash.tabs.VizModelLineage.getLineageTree (VizModelLineage.java:429)

    at MITI.flash.tabs.VizModelLineage.buildLineageGraph (VizModelLineage.java:356)

    at MITI.flash.tabs.VizModelLineage.performAction (VizModelLineage.java:148)

    at MITI.server.servlets.FlashServlet.doPost (FlashServlet.java:156)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)

    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)

    to org.apache.coyote.AbstractProtocol$ AbstractConnectionHandler.process (AbstractProtocol.java:611)

    to org.apache.tomcat.util.net.JIoEndpoint$ SocketProcessor.run (JIoEndpoint.java:316)

    to java.util.concurrent.ThreadPoolExecutor$ Worker.runTask (ThreadPoolExecutor.java:895)

    to java.util.concurrent.ThreadPoolExecutor$ Worker.run (ThreadPoolExecutor.java:918)

    to org.apache.tomcat.util.threads.TaskThread$ WrappingRunnable.run (TaskThread.java:61)

    at java.lang.Thread.run(Thread.java:662)

    Caused by: MITI.server.services.lineage.LineageException: (LNGTRC_E0016) SQL error during the tracing of lineage: ORA-22813: value of the operand exceeds the limits of the system

    at MITI.server.services.lineage.database.LineageDataSource.handle (LineageDataSource.java:41)

    at MITI.util.database.CommonDataSource.handleSQLException (CommonDataSource.java:124)

    at MITI.util.database.CommonDataSource.executeTransaction (CommonDataSource.java:83)

    at MITI.util.database.CommonDataSource.executeStatement (CommonDataSource.java:54)

    at MITI.server.services.lineage.impl.LineageImpl.traceLineage (LineageImpl.java:554)

    at MITI.server.services.lineage.common.LineageTracer.traceLineage (LineageTracer.java:1078)

    at MITI.server.services.lineage.common.LineageTracer.traceDataLineage (LineageTracer.java:313)

    at MITI.server.services.lineage.common.LineageTracer.traceTechnicalData (LineageTracer.java:176)

    at MITI.web.common.service.facades.LineageFacadeImpl.getLineageGraph (LineageFacadeImpl.java:245)

    ... 21 more

    Caused by: java.sql.SQLException: ORA-22813: value of the operand exceeds the limits of the system

    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)

    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)

    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)

    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1035)

    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)

    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)

    at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)

    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1188)

    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)

    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3487)

    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)

    at MITI.util.database.Query.executeStatement (Query.java:45)

    at MITI.util.database.Statement.execute (Statement.java:66)

    to MITI.util.database.CommonDataSource$ 1.run(CommonDataSource.java:50)

    to MITI.util.database.CommonDataSource$ 1.run(CommonDataSource.java:47)

    at MITI.util.database.Transaction.execute (Transaction.java:92)

    at MITI.util.database.CommonDataSource.executeTransaction (CommonDataSource.java:80)

    ... more than 27

    Caused by:

    MITI.server.services.lineage.LineageException: (LNGTRC_E0016) SQL error during the tracing of lineage: ORA-22813: value of the operand exceeds the limits of the system

    at MITI.server.services.lineage.database.LineageDataSource.handle (LineageDataSource.java:41)

    at MITI.util.database.CommonDataSource.handleSQLException (CommonDataSource.java:124)

    at MITI.util.database.CommonDataSource.executeTransaction (CommonDataSource.java:83)

    at MITI.util.database.CommonDataSource.executeStatement (CommonDataSource.java:54)

    at MITI.server.services.lineage.impl.LineageImpl.traceLineage (LineageImpl.java:554)

    at MITI.server.services.lineage.common.LineageTracer.traceLineage (LineageTracer.java:1078)

    at MITI.server.services.lineage.common.LineageTracer.traceDataLineage (LineageTracer.java:313)

    at MITI.server.services.lineage.common.LineageTracer.traceTechnicalData (LineageTracer.java:176)

    at MITI.web.common.service.facades.LineageFacadeImpl.getLineageGraph (LineageFacadeImpl.java:245)

    at MITI.flash.tabs.VizModelLineage.getLineageTree (VizModelLineage.java:429)

    at MITI.flash.tabs.VizModelLineage.buildLineageGraph (VizModelLineage.java:356)

    at MITI.flash.tabs.VizModelLineage.performAction (VizModelLineage.java:148)

    at MITI.server.servlets.FlashServlet.doPost (FlashServlet.java:156)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)

    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)

    to org.apache.coyote.AbstractProtocol$ AbstractConnectionHandler.process (AbstractProtocol.java:611)

    to org.apache.tomcat.util.net.JIoEndpoint$ SocketProcessor.run (JIoEndpoint.java:316)

    to java.util.concurrent.ThreadPoolExecutor$ Worker.runTask (ThreadPoolExecutor.java:895)

    to java.util.concurrent.ThreadPoolExecutor$ Worker.run (ThreadPoolExecutor.java:918)

    to org.apache.tomcat.util.threads.TaskThread$ WrappingRunnable.run (TaskThread.java:61)

    at java.lang.Thread.run(Thread.java:662)

    Caused by: java.sql.SQLException: ORA-22813: value of the operand exceeds the limits of the system

    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)

    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)

    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)

    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1035)

    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)

    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)

    at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)

    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1188)

    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)

    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3487)

    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)

    at MITI.util.database.Query.executeStatement (Query.java:45)

    at MITI.util.database.Statement.execute (Statement.java:66)

    to MITI.util.database.CommonDataSource$ 1.run(CommonDataSource.java:50)

    to MITI.util.database.CommonDataSource$ 1.run(CommonDataSource.java:47)

    at MITI.util.database.Transaction.execute (Transaction.java:92)

    at MITI.util.database.CommonDataSource.executeTransaction (CommonDataSource.java:80)

    ... more than 27

    Caused by:

    java.sql.SQLException: ORA-22813: value of the operand exceeds the limits of the system

    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)

    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)

    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)

    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1035)

    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)

    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)

    at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)

    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1188)

    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)

    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3487)

    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)

    at MITI.util.database.Query.executeStatement (Query.java:45)

    at MITI.util.database.Statement.execute (Statement.java:66)

    to MITI.util.database.CommonDataSource$ 1.run(CommonDataSource.java:50)

    to MITI.util.database.CommonDataSource$ 1.run(CommonDataSource.java:47)

    at MITI.util.database.Transaction.execute (Transaction.java:92)

    at MITI.util.database.CommonDataSource.executeTransaction (CommonDataSource.java:80)

    at MITI.util.database.CommonDataSource.executeStatement (CommonDataSource.java:54)

    at MITI.server.services.lineage.impl.LineageImpl.traceLineage (LineageImpl.java:554)

    at MITI.server.services.lineage.common.LineageTracer.traceLineage (LineageTracer.java:1078)

    at MITI.server.services.lineage.common.LineageTracer.traceDataLineage (LineageTracer.java:313)

    at MITI.server.services.lineage.common.LineageTracer.traceTechnicalData (LineageTracer.java:176)

    at MITI.web.common.service.facades.LineageFacadeImpl.getLineageGraph (LineageFacadeImpl.java:245)

    at MITI.flash.tabs.VizModelLineage.getLineageTree (VizModelLineage.java:429)

    at MITI.flash.tabs.VizModelLineage.buildLineageGraph (VizModelLineage.java:356)

    at MITI.flash.tabs.VizModelLineage.performAction (VizModelLineage.java:148)

    at MITI.server.servlets.FlashServlet.doPost (FlashServlet.java:156)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)

    Oracle has published OEMM 12.2.1 and this error is gone! So if you are facing this problem in an older version, just go to the newest one.

  • reload the page when SQL query returns a value

    Hello world

    the title of this discussion may seem strange, but I'll try to explain why I need this:

    A user has the ability to connect on my APEX application. There are several tabs in my application that are visible only if a certain SQL statement returns a value which is not the case by default. The user has also the ability to download a file that is transferred to an external system that analyzes the file and writes the data in the database. During this writing process - which may take several minutes - conditions for some of the tabs to show the will becomes real (-> the query will return a value). When the user refreshes the page manually, the tabs will be displayed. However, I want the tabs will appear automatically when the condition is met.

    Is it possible to refresh the page as soon as the query returns a value? It is perhaps possible to check it on the client side and trigger a refresh of the page when the condition is met. It would be even better if only the tabset has been updated, but refreshing the full page is fine as well.

    Thank you!

    Here is an overview of how it can be done

    This is possible thanks to a dynamic action being performed on a timer.

    View default tabs and dynamic action hide them on loading the page if they are not to be considered

    Create a dynamic action that will execute your query every 5 seconds or more

    If the query returns data, you can use the dynamic action to show your tabs using javascript

  • ORA-06503: PL/SQL: function returned no value ORA-06512:

    Hi all

    SQL > set serveroutput on

    SQL > CREATE OR replace FUNCTION qty_value (p_item_id number)

    2 RETURN NUMBER

    3 EAST

    4 v_qty_arrival NUMBER;

    5 BEGIN

    6. SELECT THE CASE SENSITIVE OPTION

    7. WHAT (SUM (b.quantity) - SUM (b.quantity_received)) < = 0 THEN 0

    8 ELSE (SUM (b.quantity) - SUM (b.quantity_received))

    9 END Qty_Arrival

    10 INTO v_qty_arrival

    Po_lines_all 11 a,

    po_line_locations_all 12 b

    13 WHERE a.po_line_id = b.po_line_id

    14 AND a.item_id = p_item_id;

    15 EXCEPTION

    16 THEN THAN OTHERS THEN

    17 v_qty_arrival: = NULL;

    18 RETURN v_qty_arrival;

    19 END qty_value;

    20.

    The function is created.

    SQL >

    SQL > select xxc_qty_arrivale (214960) double

    2.

    Select xxc_qty_arrivale (214960) double

    *

    ERROR on line 1:

    ORA-06503: PL/SQL: function returned no value

    ORA-06512: at the 'APPS '. XXC_QTY_ARRIVALE', line 19

    Back AFTER using the exception block is fine as long as your code actually REACHED the exception block.

    When there are no errors, then your code will not enter the exception block, but you still NEED to return a value, since it is what functions a function wants to return a value, that's what the functions are made for.

    Spot the differences between the following 3 functions. Understand how they work.

    The first function has only a return in the exception block but runs correctly. Result: error, because the back is missing in the code block.

    The second function has a return in the exception block and one in the block of code and runs correctly. Result: no error, because the return is not missing in the code block.

    The third function has a return in the exception block and one in the block of code and is forced into an error. Result: no error, because the return of the exception handler is used (instead of retriggering of the error, which you would normally do).

    SQL > create or replace function myfunc

    2 return number

    3 as

    4 start

    5 dbms_output.put_line ('in the section of code');

    6 null;

    7 exception

    8 then than others

    9. can

    10 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

    11      --

    12 return 0;

    13      --

    14 end;

    15.

    The function is created.

    SQL > select double myfunc;

    Select double myfunc

    *

    ERROR on line 1:

    ORA-06503: PL/SQL: function returned no value

    ORA-06512: at "GHPLUS. MYFUNC", line 14

    In the section of code

    SQL > create or replace function myfunc

    2 return number

    3 as

    4 start

    5 dbms_output.put_line ('in the section of code');

    6 null;

    7    --

    8 return 1;

    9    --

    10 exceptional

    11 so that others

    12. can

    13 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

    14      --

    15 return 0;

    16      --

    end 17;

    18.

    The function is created.

    SQL > select double myfunc;

    MYFUNC

    ----------

    1

    1 selected line.

    In the section of code

    SQL > create or replace function myfunc

    2 return number

    3 as

    n number 4;

    5. start

    6 dbms_output.put_line ('in the section of code');

    7 n: = 1/0; -force an error (zero divisor) to join the exception handler

    8    --

    9 return 1;

    10-

    exception 11

    12 so that others

    13. can

    14 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

    15      --

    16 return 0;

    17      --

    18 end;

    19.

    The function is created.

    SQL > select double myfunc;

    MYFUNC

    ----------

    0

    1 selected line.

    In the section of code

    In the handler for exception ORA-01476: divisor is equal to zero

    SQL >

  • ORA-06502: PL/SQL: digital error or value

    Hello

    We have a package with a cursor that returns the session information:

    create or replace 
    PACKAGE BODY             "LOGIN_AUDIT" 
    ...
    ...
      CURSOR session_cur IS
        SELECT * FROM v$session WHERE audsid=USERENV('sessionid');
    
     session_rec session_cur%ROWTYPE;
    
    ...
    
    FUNCTION get_osuser
        RETURN VARCHAR2
      IS
      BEGIN
        RETURN session_rec.osuser;
      END;
    
    FUNCTION get_dbuser
        RETURN VARCHAR2
      IS
      BEGIN
        RETURN NVL(session_rec.username, 'ORACLE_SYS');
      END;
    
    ...
    

    The package compiled successfully and works ok out for a function that is the get_osuser. When you launch sqlplus, we get the following error:

    Select double LOGIN_audit.get_osuser;

    *

    ERROR on line 1:

    ORA-06502: PL/SQL: digital error or value

    ORA-06512: at "APPUSR. LOGIN_AUDIT', line 94

    ORA-06512: at "APPUSR. LOGIN_AUDIT', line 102

    The APPUSR has select priv on V$ SESSION and a select * from v$ session returns the session information. We can perform any other function since the package without any problem, for example:

    APPUSR@APPD > select double login_audit.get_dbuser;

    GET_DBUSER

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

    APPUSR

    Can someone help us work on what happens please.

    PS Oracle: 11.2.0.3, OS Windows 2008 server.

    Thank you

    Really I have not aside, this and raise the question?

    Why you write all this code?

    wouldn't the following very good enough?

    1. FUNCTION get_osuser RETURN VARCHAR2;                    Use sys_context ('USERENV', 'OS_USER')
    2. FUNCTION get_dbuser RETURN VARCHAR2;                    Use sys_context ('USERENV', 'SESSION_USER')
    3. FUNCTION get_client_info RETURN VARCHAR2;                   Use sys_context ('USERENV', 'CLIENT_INFO')
    4. FUNCTION get_module_info RETURN VARCHAR2;               Use sys_context ('USERENV', 'MODULE')
    5. FUNCTION get_action_info RETURN VARCHAR2;                  Use sys_context ('USERENV', 'ACTION')

    Just do not know, I see the advantage of messing around with this slider and have to fight with the updating of information and others.

    This would totally work around the error you get and probably accelerate - and make it easier to maintain.

    ??

    Unless there is some additional requirements, that I'm missing

  • ORA-06502: PL/SQL: digital error or value: number too high accuracy

    Hi all
    Sorry I can't speak English very well
    ========
    IM creating a function in the hr schema
    I need to calculate a tax
    syntax of the function is

    CREATE OR REPLACE THE TAX FUNCTION
    (F_TAX EMPLOYEES % OF SALARY TYPE)
    RETURN NUMBER IS
    V_SAL EMPLOYEES. % SALARY TYPE.

    BEGIN
    SELECT salary * 12
    IN v_sal
    Employees
    WHERE EMPLOYEE_ID = F_TAX;
    IF V_SAL > = 40000 THEN
    V_SAL: = V_SAL / 0,20;
    ELSIF V_SAL > = 30000 THEN
    V_SAL: = V_SAL / 0.15;
    END IF;
    RETURN V_SAL;
    TAX END;
    ==================
    When I select a tax I have this problem
    SELECT (EMPLOYEE_ID) TAX
    EMPLOYEES

    It comes
    SELECT (EMPLOYEE_ID) TAX
    *
    ERROR on line 1:
    ORA-06502: PL/SQL: digital error or value: number too high accuracy
    ORA-06512: at "HR. The TAX", line 16

    V_SAL is declared as HR. EMPLOYEES. % OF SALARY TYPE. If you look at the definition of time. The table EMPLOYEES, the SALARY column is a NUMBER (8,2). This means that it can handle numbers up to $999,999.99 (8 total digits with 2 decimal places).

    Your IF statement is dividing the salary by 0.20, which is equivalent to multiplying by 5 or dividing by 0.15, which is multiplied by 6.67. In reality, at least a salary is high enough now that when you multiply by 5 or 6.67 it exceeds the limit of $999,999.99 (especially when you already multiplied by 12 SALARY column in your SELECT statement).

    -If your intention is to return in numbers that exceed the limits of the SALARY column in human resources. EMPLOYEES, you will need to declare V_SAL differently. You can declare V_SAL as a NUMBER (11.2), for example, given that any number that you store in a NUMBER (8.2), multiplied by 60, which can be represented in a NUMBER (11.2).
    -If your intention is to return the numbers that fall within the limits of the SALARY column in human resources. USED, I suspect that the algorithm that you implemented is incorrect. Perhaps, for example, you would divide by 1.2 or 1.15 as a kind of tax accounting?

    Justin

  • product loop "ORA-06502: PL/SQL: digital error or value."

    Why I get the error message ' ORA-06502: PL/SQL: digital error or value "to the code below.
    create table bc (
      a number, 
      b varchar2(10)
    );
    
    
    declare
      type t_bc_a is table of bc.a%type;
      type t_bc_b is table of bc.b%type;
      l_bc_a t_bc_a;
      l_bc_b t_bc_b;
    begin
      dbms_output.put_line('1');
      select a, b bulk collect into l_bc_a, l_bc_b from bc;
       dbms_output.put_line('2');
       if l_bc_a is null then
         dbms_output.put_line('2.1'); 
       else
         dbms_output.put_line('2.2, l_bc_a.count=' || l_bc_a.count); 
         
       end if;
      for i in l_bc_a.first .. l_bc_a.last loop
       dbms_output.put_line('3');
        dbms_output.put_line(l_bc_a(i) || ', ' || l_bc_b(i));
      end loop;
    end;
    
    /*
    1
    2
    2.2, l_bc_a.count=0
    ORA-06502: PL/SQL: numeric or value error
    */
    "Bc" table is empty and I expect loop never to do any cycle a step, but I get the error. Why the error is there.

    Hello!

      for i in l_bc_a.first .. l_bc_a.last loop
       dbms_output.put_line('3');
        dbms_output.put_line(l_bc_a(i) || ', ' || l_bc_b(i));
      end loop;
    

    In your case, l_bc_a.first is null and l_bc_a.last is the same

    in the case

    because me to null... loop of null

    such an error is returned

    T

  • ORA-06502: PL/SQL: digital error or value: hex to raw conversion error

    Hello gurus,

    I'm trying to encrypt the dbms_obfuscation_toolkit method

    CREATE or REPLACE function Cryption2 (long input_string) gross yield
    IS
    -input_string VARCHAR2 (16): = "tigertigertigert";
    raw message (32767).
    raw_input RAW (128);
    long key_string (20000): = "scottsco";
    raw_key RAW (128);
    encrypted_raw RAW (2048);
    long encrypted_string (20000);
    decrypted_raw RAW (2048);
    long decrypted_string (20000);
    error_in_input_buffer_length EXCEPTION;
    PRAGMA EXCEPTION_INIT(error_in_input_buffer_length,-28232);
    INPUT_BUFFER_LENGTH_ERR_MSG VARCHAR2 (100): =.
    ' * NOT A MULTIPLE OF 8 BYTES IN THE INPUT BUFFER AND *';
    BEGIN
    message: = UTL_RAW. CAST_TO_RAW (Convert (input_string, 'AL32UTF8', 'US7ASCII'));
    message: = UTL_RAW. CAST_TO_RAW (Convert (key_string, 'AL32UTF8', 'US7ASCII'));
    dbms_output.put_line (' > = BEGIN TEST =');
    dbms_output.put_line (' > enter string: ' |)
    input_string);
    START < ignore this, typo in the Oracle documentation
    dbms_obfuscation_toolkit. Decrypt)
    input_string = > input_string,.
    key_string = > key_string,
    encrypted_string = > encrypted_string);
    dbms_output.put_line (' > Encrypted string: ' |)
    encrypted_string);
    -Add as shown DESDecrypt, gross change in chaine_cle
    -END IF;
    Return encrypted_string;
    EXCEPTION
    WHEN error_in_input_buffer_length THEN
    dbms_output.put_line (' > ' |) INPUT_BUFFER_LENGTH_ERR_MSG);
    END;
    /

    But I get the following error

    When I try:-select cryption2 ('abcdefgh') of double;

    ORA-06502: PL/SQL: digital error or value: hex to raw conversion error
    ORA-06512: at the "', line 31" "

    Thanks and greetings
    Pratik Lacoste
    DBA Oracle Jr

    Published by: Pratik.L on December 13, 2009 21:58

    Hey Pratik,

    You seem to be under pressure. The code that you pasted last a lot of stupid mistakes.
    In both the features that you use to encrypt or decrypt that you must follow the data type, the procedure is overloaded.

    Source: http://download.oracle.com/docs/cd/B13789_01/appdev.101/b10802/d_obtool.htm

    The previous post for this was varchar2 usinf encrpt and decrypt.

    The code below, which is your code, I'm taking the value as varchar2 and return varchar2 but internally
    that you posted, I'm going in raw data to her encrypt and decrypt procedures.

    SQL> CREATE OR REPLACE Function try_Cryptit (input long) return clob
      2   IS
      3
      4  key_string RAW(2000);
      5  crypt_dycp_raw RAW(2000);
      6  crypt_encp_raw RAW(2000);
      7  crypt_str clob;
      8  key_raw RAW(2000) := UTL_RAW.CAST_TO_RAW('frankzap');
      9  input_raw RAW(2000):=UTL_RAW.CAST_TO_RAW(input);
     10   message varchar2(2000);
     11
     12  BEGIN
     13   dbms_obfuscation_toolkit.DESEncrypt(
     14   input => input_raw,
     15   KEY => key_raw,
     16   encrypted_data => crypt_encp_raw);
     17
     18   -- Decrypt the string --
     19
     20   dbms_obfuscation_toolkit.DESDecrypt(
     21   input => crypt_encp_raw,
     22   KEY => key_raw,
     23   decrypted_data => crypt_dycp_raw);
     24
     25   crypt_str := utl_raw.cast_to_varchar2(input_raw);
     26   return crypt_str;
     27   END;
     28
     29  /
    
    Function created.
    
    SQL> select try_Cryptit ('abcdefgh') from dual;
    
    TRY_CRYPTIT('ABCDEFGH')
    --------------------------------------------------------------------------
    abcdefgh
    

    Follow be varchar2 or raw for this purpose.

    Twinkle

Maybe you are looking for

  • I only see a black screen with cursor flashing in Windows 10 Boot Camp

    Why Boot Camp is so hard! I just reinstall Boot Camp for the second time on my MacBook Pro mid-2012 after I came across this problem the first time. Everything goes through until the drivers install and I restart my Mac after updates, that to have th

  • C855-1VT satellite - cannot start media recovery disk

    Hello I have the laptop above that was dumped on its edge causing the hard drive to the jam and fail.This means no access to the system recovery, so I ordered arvato shop Toshibas Recovery Media recovery media. I installed a new HARD drive has slippe

  • Satellite M70-122: Question about the necessary drivers for Win XP Pro

    HelloI formatted my Satellite M70-122 in order to install Win XP - Pro and so I lost all drivers and programs pre installed. It seems that the recovery CD is of no use in this case, and I was wondering if there was a driver CD, I could order.I found

  • The streaming of multiple channels directly to CSV USB-6210?

    I would like to stream up to 16 channels of data to a CSV file. My sample rate can vary from a file in a file, but I can reach 1 kHz. I understand the disadvantage of using text rather than PDM or binary files, but I have to be able to read these fil

  • Help get it you like-acquired 60 GB of space after upgrade?

    What happened to my HD 60 GB after a Vista SP 2 upgrade? [With many security enhancements] If it has been deleted? So far I don't see all the documents that have been deleted, but I have over 400 GB of files... Vista was preinstalled with this comput