The mutation of the Table... not triggered on SELECT error? And also not on UPDATE?

I thought I knew how to get Oracle to report an error Table mutation, but when I tried to do it in a demonstration today, it didn't work. Here is what I tried:
SQL> set serveroutput on
SQL> create table test_mte (f number);

Table created.

SQL> insert into test_mte values (1);

1 row created.

SQL> insert into test_mte values (2);

1 row created.

SQL> insert into test_mte values (3);

1 row created.

SQL> create or replace trigger test_mte_bt
  2  before insert on test_mte
  3  for each row
  4  declare
  5    wk_cnt number;
  6  begin
  7  
  8    select count(*) into wk_cnt from test_mte;
  9    dbms_output.put_line(wk_cnt);
 10    
 11  end test_mte_bt;
 12  /

Trigger created.

SQL> insert into test_mte values (4);
3

1 row created.
I thought that, in a level trigger line, questioning the table on which the trigger is installed, you get an error of the changing table. Same thing with INSERT, UPDATE, or DELETE. Of course, I thought I'd get the problem with DML:
SQL> create or replace trigger test_mte_bt
  2  before insert on test_mte
  3  for each row
  4  declare
  5    wk_cnt number;
  6  begin
  7  
  8    update test_mte set f = 10 where f = 1;
  9    dbms_output.put_line('Updated: '||SQL%ROWCOUNT);
 10    
 11  end test_mte_bt;
 12  /

Trigger created.

SQL> insert into test_mte values (4);
Updated: 1

1 row created.
We are on Oracle 11.1.0.7. Could something have changed in this upgrade? I'm completely confused.

Thank you
-= Chuck

If the trigger is an INSERT... VALUES, Oracle knows this is a special case and that exactly 1 line will be inserted. This means that, indeed, a row-level trigger is no different with a statement-level trigger so the restriction on the questioning of the trigger table is not present.

If you were writing your next INSERT statement as a query - even if this query returns a single row, you will get an error because Oracle knows the syntax that you are guaranteed to get exactly one line.

SQL> insert into test_mte
  2    select 5
  3      from dual;
insert into test_mte
            *
ERROR at line 1:
ORA-04091: table SCOTT.TEST_MTE is mutating, trigger/function may not see it
ORA-06512: at "SCOTT.TEST_MTE_BT", line 4
ORA-04088: error during execution of trigger 'SCOTT.TEST_MTE_BT'

Of course, when you write the actual code, you never want to count on each insert is a single-row INSERT statement... VALUES statement so there is not much cause to take advantage of this gap in practice.

Justin

Tags: Database

Similar Questions

  • Location of the table "Data store path Selection" database and input valid value for the Round Robin

    Long history, work paths peripheral to the equivalent of "Round Robin" (VMware) programmictally change as seen in vCenter - Volume Properties-> manage-> trace selection policy paths.

    Struggling to get the value to change through scripts. Think that it requires the value as expected in the datamodel vcenter. Find it by inspecting the paintings have not yet

    Thanks in advance

    The values on the parameter - MultipathPolicy are: fixed, MostRecentlyUsed, RoundRobin, unknown

    This changes all policies to roundrobin on a specific host

    Get-VMHost  | Get-ScsiLun -LunType disk |  Set-ScsiLun -MultipathPolicy "roundrobin"
    

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Sections of the table not lining up properly

    Hello

    I'm relatively new to programming, so I don't know I just missed something simple here. The problem I have now is that I have created a table and put images in each section of the table. I set the cell padding and spacing between cells to zero, but when I view my page in a browser, there are horizontal gaps between each section of the table (not just horizontal; vertical gap). Can someone tell me what I'm missing?

    Here is my code:

    <! doctype html >

    < html > < head >

    < meta charset = "utf-8" >

    < title > < /title > Home Page

    < / head >

    < body >

    < table width = "1366" border = "0" cellpadding = "0" cellspacing = "0" >

    < tbody >

    < b >

    < td width = "377" height = "268" > < img src = "images/image_01.jpg" width = "377" height = "268" alt ="" / > < table > "

    < td colspan = "7" rowspan = "3" width = "989" height = "399" > < img src = "images/image_02.jpg" width = "989" height = "399" alt ="" / > < table > "

    < /tr >

    < b >

    < td width = "377" height = "81" > < img src = "images/image_03.jpg" width = "377" height = "81" alt ="" / > < table > "

    < /tr >

    < b >

    < td width = "377" height = "50" > < img src = "images/image_04.jpg" width = "377" height = "50" alt ="" / > < table > "

    < /tr >

    < b >

    < td width = "377" height = "73" > < img src = "images/image_05.jpg" width = "377" height = '73' alt ="" / > < table > "

    < td width = "81" height = "310" rowspan = "5" > < img src = "images/image_06.jpg" width = "81" height = "310" alt ="" / > < table > "

    < td width = "259" height = "310" rowspan = "5" > < img src = "images/image_07.jpg" width = "259" height = "310" alt ="" / > < table > "

    < td width = "26" height = "310" rowspan = "5" > < img src = "images/image_08.jpg" width = "26" height = "310" alt ="" / > < table > "

    < td width = "259" height = "310" rowspan = "5" > < img src = "images/image_09.jpg" width = "259" height = "310" alt ="" / > < table > "

    < td width = "26" height = "310" rowspan = "5" > < img src = "images/image_10.jpg" width = "26" height = "310" alt ="" / > < table > "

    < td width = "258" height = "310" rowspan = "5" > < img src = "images/image_11.jpg" width = "258" height = "310" alt ="" / > < table > "

    < td width = '80' height = "310" rowspan = "5" > < img src = "images/image_12.jpg" width = '80' height = "310" alt ="" / > < table > "

    < /tr >

    < b >

    < td width = "377" height = "42" > < img src = "images/image_13.jpg" width = "377" height = "42" alt ="" / > < table > "

    < /tr >

    < b >

    < td width = "377" height = "81" > < img src = "images/image_14.jpg" width = "377" height = "81" alt ="" / > < table > "

    < /tr >

    < b >

    < td width = "377" height = "41" > < img src = "images/image_15.jpg" width = "377" height = "41" alt ="" / > < table > "

    < /tr >

    < b >

    < td width = "377" height = "73" > < img src = "images/image_16.jpg" width = "377" height = '73' alt ="" / > < table > "

    < /tr >

    < b >

    < td width = "377" height = "66" > < img src = "images/image_17.jpg" width = "377" height = "66" alt ="" / > < table > "

    < td colspan = "7" width = "989" height = "66" > < img src = "images/image_18.jpg" width = "989" height = "65" alt ="" / > < table > "

    < /tr >

    < / tbody >

    < /table >

    < / body >

    < / html >

    Use home pages in DW to begin your project.

    1. Go to file > New > blank page > HTML.
    2. Choose a layout from the 3rd Panel.
    3. Press the button CREATE.

    From there it is just add your own text and graphics to the page layout.

    Nancy O.

  • Lightroom displays all images from a folder - it displays the message '45 65 images, selected 45' and 45 messages do not appear in the grid of the library, but I can't see the remaining images of 20. All filters are disabled...

    Lightroom displays all images from a folder - it displays the message '45 65 images, selected 45' and 45 messages do not appear in the grid of the library, but I can't see the remaining images of 20. All filters are disabled...

    Hello

    Please go to the library Module, then click on the picture in the Menu bar and then click the stacking.

    From there please select expand all stack them.

    It should show all the images if they are virtual copies.

    Kind regards

    Tanuj

  • After you have installed Windows 10, I can no longer create a PDF of my program Pagemaker 7.0.1. Purchased Acrobat DC, but not joy. Apparently, Acrobat PDF maker does not recognize the .pmd extension. I get errors and various suggestions, but nothing work

    After you have installed Windows 10, I can no longer create a PDF of my program Pagemaker 7.0.1. Purchased Acrobat DC, but still no joy. Apparently, Acrobat PDF maker does not recognize the .pmd extension. I get errors and various suggestions, but nothing works. WHAT?

    Print to Adobe PDF? Why the * & ^ * & ^ V_ $ didn't pay a lot more money to Adobe for an Adobe program that does not work with another Adobe program? Oh, right--they want to move me up (buy) the new Adobe graphics programs. I'll keep sweating this point and will no doubt wind up forking over a thousand$ $$ or so for 'new' stuff I don't need.

  • I just installed win 7 Ult 7 days. In the event viewer, I got 1000 errors and I was wondering where I can get help? TY

    I just installed win 7 Ult 7 days.  In the event viewer, I got 1000 errors and I was wondering where I can get help? TY

    And the list continues to become more mistakes as the months go bye.  Usually after 3 monts, my PC slows to a crawl, and I have to reinstall Windows & Ultimate!

    It is very annoying.  I'm not the smartest when it comes to the PC, but I know enough when I have a problem.

    Now, while I was with PC Cleaner Pro, I allowed a representative to take control of my PC to help set, and he went into the event viewer and showed me the error 1007 in

    the event viewer.  He told me that only a technician 35 Microsoft could fix tis problem.

    I would like to know how to solve these problems myself.  If that means classes or tests, I'm ready to get there!

    But for now, I just want to know how to clean and fix the errors in the event viewer

    So if you could tell me please small whet you need to me to help him with this problem, I'm ready

    It's really annoying tio do reinjstall windows every 3 months.  So if you can help, I would be very happy VERY MUCH!

    Sincreley,

    Joseph M Hart

    Errors and warnings in the event logs are not usually a sign of a major problem.

    Unfortunately, there are many technical support providers who refer clients to the event log in order to convince them to pay for questionable services.

    Use of cleaners and Tune up utilities is not recommended. They can often cause problems.

    Use the construct in Windows utilities

    http://www.Microsoft.com/athome/Setup/optimize.aspx

    Ensure that all remote access program is deleted from your computer.

    Use a search engine to find information on all the events that occur frequently, specifying the event id and source, for example search for "eventid 512 capi2. Try to avoid scam sites that are always asked by this kind of research. Stick to sites of Microsoft or somewhere like www.eventid.net which is a good source of free information.

  • I don't have the basic games that windows comes with and also miss me the contacts and calendar. Please help someone. I had windows 7 through my school, which is outside the MSDN program.

    I don't have the basic games that windows comes with and also miss me the contacts and calendar.  Please help someone.  I had windows 7 through my school, which is outside the MSDN program.

    Programs like Contacts and calendar are available in Windows Live Mail through Windows Live Essentials (http://download.live.com)

    In regards to the games, I assume that you are running Windows 7 Professional.

    Click Start, type: features on or off Windows activate
    Develop games
    Select the games you want. Andre Da Costa http://adacosta.spaces.live.com http://www.activewin.com

  • How to track the changes on the table, not not using triggers

    Hello
    I would like to track DML changes on the tables. As I have several tables, it is not effective to write triggers.

    Is there any installation that I can do at the database level.

    I use 11g R2.


    Thank you
    thanks fran,
    
    I am a developer DBA with no access to db as sysdba.
    
    how can I access au$ table
    
    SQL> show parameter audit_trail
    
    NAME TYPE VALUE
    -----------
    audit_trail string DB
    SQL> audit select,insert on ctrl_batch;
    
    Audit succeeded.
    
    SQL> select sqltext from aud$ where sqltext is not null;
    select sqltext from aud$ where sqltext is not null
    *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    

    Hmm... a contradiction in terms...

    (1) audit trail must be in "DB, EXTENDED" see sqltext in the table sys.aud$.

    (2) If you have not logged: $sqlplus / as sysdba, if logged in SQL > conn / as sysdba (and of course sqlplus sys / conn sys as sysdba / as sysdba).

    (3) in your example, you are using views of dictironary of data that require dba (such as system or sys) privileges, but the owner of aud$ is sys. So, probably you use user system, right? Try to connect as sys as I told you in step 2 and try again.

  • Available to the table not for online stores?

    Is there a way to get BC to not render a table to a category page? As we know all tables is not very useful if you want your site to be admissible.

    I found this post that details how to use javascript to replace the table with any schema that you want (in this case list items):

    http://forums.Adobe.com/message/4238734

    Works great!

  • Content in the tables not lining up properly

    This is my first post, so please bear with me.

    I am new to web development and uses Dreamweaver CS5.5 Adobe Master Collection 5.5.

    The page I created is a temporary page until I complete the entire site.  The contents of the table is correctly aligned my three browsers (Chrome, Firefox and IE) when you preview in Dreamweaver.  How ever, once uploaded to the server, when I go on the site using IE, it is not well aligned correctly (but it is in Chrome and Firefox).  To make things worse, it is aligned with other computers, but not all.

    It is not align correctly on my computer, which runs at a resolution of 1600 x 900

    I saw him line up properly with a resolution of 1366 x 768 (not my computer).

    So my main question is which is inconsistent, and I don't know how to solve this problem.  I understand that I can't design a Web site for all the resolutions, but it has only problems with Internet Explorer.

    Is the Web site: http://www.Leapfest.com

    Thank you for your help, and if you need more information please let me know!

    Table in IE at 1600 x 900.png

    Unless you're competent with the code, you should really step away from DW for a few weeks and start with the basics of HTML & CSS. This is necessary to learn to use DW.

    Later, you'll want to spend time to learn JavaScript and probably some server side (PHP & MySql) of programming language.  Take a step at a time.  Rome was not built in a day and won't be your website.

    Bookmark resources below.  You're going to be who often refer.

    HTML, CSS, JavaScript, PHP tutorials - http://w3schools.com/

    Learn CSS positioning in 10 steps

    http://www.Barelyfitz.com/screencast/HTML-training/CSS/positioning/

    How to develop with CSS?

    http://phrogz.NET/CSS/HowToDevelopWithCSS.html

    Code Validation tools

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

    CSS - http://jigsaw.w3.org/css-validator/

    HTML - http://validator.w3.org/

    Google SEO Starter Guide

    http://googlewebmastercentral.blogspot.com/2010/09/SEO-Starter-Guide-updated.html

    Dreamweaver CSS Templates for beginners

    http://www.Adobe.com/devnet/Dreamweaver/articles/dreamweaver_custom_templates.html

    News Home Pages of DW

    http://www.Adobe.com/devnet/Dreamweaver/articles/introducing_new_css_layouts.html

    Create your first website DW CS5-

    http://www.Adobe.com/devnet/Dreamweaver/articles/first_website_pt1.html

    Nancy O.

    ALT-Web Design & Publishing

    Web | Graphics | Print | Media specialists

    http://ALT-Web.com/

    http://Twitter.com/ALTWEB

  • Is there a self-cleaning of the TABLEs not referenced after surgery impdp?

    Assume the following sequence of operations:

    (1.) I export a complete database with expdp in a dumpfile
    2.) I create a new TABLE "mytab" (resp. more generally a object). References/entries in this table will be added to a couple of tables system "all_tables", "dba_tab_privs" and others.
    3.) now I import the previously exported dumpfile to return in the original database with parameter
    TABLE_EXISTS_ACTION = REPLACE FULL = Y

    This operation would replace the table "all_tables' (resp. the table behind this point of view system).
    The reference to "mytab" is getting lost. This is similar to an object that is not referenced in C++ (which must be released) or an object not referenced in Java that is removed by the garbage collector.

    How such an orphaned table/object is managed in Oracle?

    Is there a!-up or a warning?

    Peter

    If you create a table after you export and an import complete export the table you created after that export has been carried out, mytable in your example, should not be affected by import. RDBMS database tables are not superimposed my full import rather the DDL created as part of the export updates base tables.

    Where the table exists the create table in dmp file errors out and impdp (or imp) just ignores the error and continues to stage data loading. The stage of loading data capture and does not take into account continuous duplicate key errors to try to insert data until there is no more to this table, then he goes to try to create the index for the table.

    At least that's how exp/imp has worked and I have not noticed any behavior change with expdp/impdp, although I haven't used utilities heavily again.

    HTH - Mark D Powell.

    Note: the above applies when you import in the db of the source, and not another where you expect changes once the dmp file was made to not be present in the default behavior for a full import to do not destroy the existing database and re-create dmp file. To re-create the tablespaces was the default behavior with version 6.

    Edited by: Mark D Powell on March 18, 2010 06:20

  • Images in the tables not resizing using reagents HTML5

    With the help of RH11.9.4.291

    I do a few exits Responsive HTML5 test results for Desktop/Tablet/phone by resizing the browser window and I noticed that;

    • Images resizing correct (yay!)
    • Correct resizing tables (also yay!)
    • Images in the tables don't resize at all (boo to that!)

    Any ideas?

    I solved in fact just that, both for reasons of post the solution...

    The culprit was the underlying html language associated with text in italics in the table. On the surface, the text went well. But in the HTML code, it looked like this:

    "font style: =" ' italic;' = ""

    I have no idea how it happened, or why only preventing image resizing, but cleaning, upward, solved the problem.

  • result should be modify the table GRADE_CONVERSION MODIFIED_DATE add but "("come and why?

    Result:

    ALTER table GRADE_CONVERSION add MODIFIED_DATE (/ / result should be alter table GRADE_CONVERSION add MODIFIED_DATE but "(" entrée ) ")

    ALTER table GRADE_CONVERSION add CREATED_BY VARCHAR2 (30)

    ALTER table GRADE_CONVERSION add CREATED_DATE (/ / result should be alter table GRADE_CONVERSION add CREATED_DATE but "(" entrée ) ")

    ALTER table GRADE_CONVERSION add MODIFIED_BY VARCHAR2 (30)

    QUERY:

    CREATE TABLE 'ERHAN. "" GRADE_CONVERSION ".

    (VARCHAR2 (2) "LETTER_GRADE",)

    NUMBER (3.2) "GRADE_POINT" DEFAULT 0,

    NUMBER (3.0) "MAX_GRADE."

    NUMBER (3.0) "MIN_GRADE."

    VARCHAR2 (30) 'CREATED_BY. "

    DATE OF THE "CREATED_DATE,"

    VARCHAR2 (30) "MODIFIED_BY",.

    DATE OF THE "MODIFIED_DATE".

    );

    CREATE TABLE "SARIGUL. "" GRADE_CONVERSION ".

    (VARCHAR2 (2) "LETTER_GRADE",)

    NUMBER (3.2) "GRADE_POINT" DEFAULT 0,

    NUMBER (3.0) "MAX_GRADE."

    NUMBER (3.0) "MIN_GRADE".

    );

    with the CBC as

    (

    Select src.table_name src_table_name, src.column_name src_col_name, src.data_type src_data_type, src.data_length src_data_len, src.data_precision src_data_precision, src.data_scale src_data_scale,

    CBC. Nullable src_nullable, decode (T.Constraint_Type, 'P', 'Primary Key', 'U', 'Unique', ") as src_cons

    all_tab_columns CBC

    left join (select Cc.Column_Name, Uc.Constraint_Type

    of user_cons_columns cc, uc user_constraints

    where Cc.Constraint_Name = Uc.Constraint_Name

    and Cc.Table_Name = Uc.Table_Name) t

    on T.Column_Name = Src.Column_Name

    where table_name = 'GRADE_CONVERSION' and owner = 'ERHAN.

    ),

    As TGT

    (

    Select tgt.table_name tgt_table_name, tgt.column_name tgt_col_name, tgt.data_type tgt_data_type, tgt.data_length tgt_data_len,

    TGT.data_precision tgt_data_precision, tgt.data_scale tgt_data_scale, tgt.nullable tgt_nullable,

    Decode (T.Constraint_Type, 'P', 'Primary Key', 'U', 'Unique', ") as tgt_cons

    from all_tab_columns tgt

    left join (select Cc.Column_Name, Uc.Constraint_Type

    of user_cons_columns cc, uc user_constraints

    where Cc.Constraint_Name = Uc.Constraint_Name

    and Cc.Table_Name = Uc.Table_Name) t

    on T.Column_Name = TGT. Column_Name

    where table_name = 'GRADE_CONVERSION' and owner = 'SARIGUL.

    ),

    col_details as

    (

    Select src.src_table_name, nvl (tgt.tgt_table_name, first_value (tgt_table_name) more (order of nulls last tgt_table_name)) tgt_table_name;

    SRC.src_col_name, src.src_data_type, src.src_data_len, src.src_data_precision, src.src_data_scale, src.src_nullable, src_cons,

    TGT.tgt_col_name, tgt.tgt_data_type, tgt.tgt_data_len, tgt.tgt_data_precision, tgt.tgt_data_scale, tgt.tgt_nullable, tgt_cons

    the CBC

    outer join full tgt

    on)

    SRC.src_col_name = tgt.tgt_col_name

    )

    )

    Select *.

    BeO

    Select the case sensitive option

    When tgt_data_type! = src_data_type or tgt_data_len! = src_data_len or tgt_data_precision! = src_data_precision or tgt_data_scale! = src_data_scale or tgt_nullable! = src_nullable

    then 'alter table ' | tgt_table_name | 'Edit ' | tgt_col_name | ' ' || src_data_type | ' (' ||

    -case when src_data_type null ('DATE') then

    on the other

    case

    When src_data_type in ('VARCHAR', 'VARCHAR2')

    then nvl (to_char (src_data_len), ' ') | ') '

    otherwise decode (nvl (src_data_precision-1),-1, null, nvl (to_char (src_data_precision), ' ') |) ', ' || NVL (to_char (src_data_scale), ' ') | ')')

    end

    end

    ||

    cases where tgt_nullable = 'Y' then 'null '.

    of another end 'not null '.

    || tgt_cons

    When tgt_col_name is null

    then 'alter table ' | tgt_table_name | 'Add ' | src_col_name | ' ' ||  ' ' || ' ' || src_data_type | ' ' ||

    -case when src_data_type null ('DATE') then

    on the other

    case

    When src_data_type in ('VARCHAR', 'VARCHAR2')

    then nvl (to_char (src_data_len), ' ') | ') '

    otherwise decode (nvl (src_data_precision-1),-1, null, nvl (to_char (src_data_precision), ' ') |) ', ' || NVL (to_char (src_data_scale), ' ') | ')')

    end

    end

    || tgt_cons

    When src_col_name is null

    then 'alter table' | tgt_table_name: ' drop '. tgt_col_name

    end alter_statement

    of col_details

    )

    where alter_statement is not null;

    Result:

    ALTER table GRADE_CONVERSION add MODIFIED_DATE (/ / result should be alter table GRADE_CONVERSION add MODIFIED_DATE )

    ALTER table GRADE_CONVERSION add CREATED_BY VARCHAR2 (30)

    ALTER table GRADE_CONVERSION add CREATED_DATE (/ / result should be alter table GRADE_CONVERSION add CREATED_DATE )

    ALTER table GRADE_CONVERSION add MODIFIED_BY VARCHAR2 (30)

    Erhan, you need to change your script a little

    with the CBC as

    (

    Select src.table_name src_table_name, src.column_name src_col_name, src.data_type src_data_type, src.data_length src_data_len, src.data_precision src_data_precision, src.data_scale src_data_scale,

    CBC. Nullable src_nullable, decode (T.Constraint_Type, 'P', 'Primary Key', 'U', 'Unique', ") as src_cons

    all_tab_columns CBC

    left join (select Cc.Column_Name, Uc.Constraint_Type

    of user_cons_columns cc, uc user_constraints

    where Cc.Constraint_Name = Uc.Constraint_Name

    and Cc.Table_Name = Uc.Table_Name) t

    on T.Column_Name = Src.Column_Name

    where table_name = 'GRADE_CONVERSION' and owner = 'ERHAN.

    ),

    As TGT

    (

    Select tgt.table_name tgt_table_name, tgt.column_name tgt_col_name, tgt.data_type tgt_data_type, tgt.data_length tgt_data_len,

    TGT.data_precision tgt_data_precision, tgt.data_scale tgt_data_scale, tgt.nullable tgt_nullable,

    Decode (T.Constraint_Type, 'P', 'Primary Key', 'U', 'Unique', ") as tgt_cons

    from all_tab_columns tgt

    left join (select Cc.Column_Name, Uc.Constraint_Type

    of user_cons_columns cc, uc user_constraints

    where Cc.Constraint_Name = Uc.Constraint_Name

    and Cc.Table_Name = Uc.Table_Name) t

    on T.Column_Name = TGT. Column_Name

    where table_name = 'GRADE_CONVERSION2' and owner = 'SARIGUL.

    ),

    col_details as

    (

    Select src.src_table_name, nvl (tgt.tgt_table_name, first_value (tgt_table_name) more (order of nulls last tgt_table_name)) tgt_table_name;

    SRC.src_col_name, src.src_data_type, src.src_data_len, src.src_data_precision, src.src_data_scale, src.src_nullable, src_cons,

    TGT.tgt_col_name, tgt.tgt_data_type, tgt.tgt_data_len, tgt.tgt_data_precision, tgt.tgt_data_scale, tgt.tgt_nullable, tgt_cons

    the CBC

    outer join full tgt

    on)

    SRC.src_col_name = tgt.tgt_col_name

    )

    )

    Select *.

    de)

    Select the case sensitive option

    When tgt_data_type! = src_data_type or tgt_data_len! = src_data_len or tgt_data_precision! = src_data_precision or tgt_data_scale! = src_data_scale or tgt_nullable! = src_nullable

    then 'alter table ' | tgt_table_name | 'Edit ' | tgt_col_name | ' ' || src_data_type | ' ' ||

    -case when src_data_type null ('DATE') then

    on the other

    case

    When src_data_type in ('VARCHAR', 'VARCHAR2')

    then ' (' |) NVL (to_char (src_data_len), ' ') | ') '

    otherwise decode (nvl (src_data_precision-1),-1, null, nvl (to_char (src_data_precision), ' ') |) ', ' || NVL (to_char (src_data_scale), ' ') | ')')

    end

    end

    ||

    cases where tgt_nullable = 'Y' then 'null '.

    of another end 'not null '.

    || tgt_cons

    When tgt_col_name is null

    then 'alter table ' | tgt_table_name | 'Add ' | src_col_name | ' ' ||  ' ' || ' ' || src_data_type | ' ' ||

    -case when src_data_type null ('DATE') then

    on the other

    case

    When src_data_type in ('VARCHAR', 'VARCHAR2')

    then ' ('| nvl (to_char (src_data_len), ' ') |) ') '

    otherwise decode (nvl (src_data_precision-1),-1, null, nvl (to_char (src_data_precision), ' ') |) ', ' || NVL (to_char (src_data_scale), ' ') | ')')

    end

    end

    || tgt_cons

    When src_col_name is null

    then 'alter table' | tgt_table_name: ' drop '. tgt_col_name

    end alter_statement

    of col_details

    )

    where alter_statement is not null;

    Concerning

    Mr. Mahir Quluzade

  • To view the details of the table, how can I create users and applications for the dev team?

    Hello
    Veiw the tables as column details, etc., we use the password apps by oracle apps Forms.But apps password giving the development of values is threat to security. My question, how the development team will check the details of the database other than the apps user & password? No work around for this problem?

    Naya,

    The developers must have access to the development/TEST instance but must not be connected directly to the instance of PROD. Assuming that your development instance is identical to the production, I believe that the best scenario is to prepare reports on the development instance (having full access including password apps), and once they are done, they go to the ADMINISTRATOR to upload it to the production instance.

  • Select this OPTION to generate XML data from the table using XMLELEMENT, XMLAGG gives error ORA-19011 string buffer too small

    My select statement fails with the error:


    The ORA-19011 string buffer too small


    The select statement looks like:


    SELECT TO_CLOB)

    XMLELEMENT ("accounts",

    XMLELEMENT ("count",

    XMLATTRIBUTES)

    rownum AS "recordId."

    To_date('20130520','YYYYMMDD') AS "datestarted."

    123456 AS "previousBatchId."

    56789 AS 'previousRecordId '.

    ),

    ....

    .... .

    .....

    XMLFOREST)

    SIG_ROLE AS "SignatoryRole."

    To_char(TRANSFER_DATE,'YYYY-mm-DD') AS "TransferDate."

    NVL(Reason,0) AS 'reason '.

    ) AS the 'transfer '.

    )

    ()) AS CRDTRPT

    OF ANY_TABLE;

    • It looks like I can choose only 4000 characters using the SELECT statement (please, correct me if I'm wrong)

    I'd use the XMLGEN package. But the environment team says no mounted drives in the future with the arrival of the EXADATA.

    NO HARD DRIVE MOUNTED, NO ACCESS TO THE DATABASE DIRECTORIES

    No UTL_FILE

    I need to use the REEL spool the resulting XML data of the SELECT query.

    SQL is a standard in my org, but I can do with a PL/SQL solution also to load data into a table (cannot use a COIL with PL/SQL)

    What I do is:

    1. a column of type CLOB to a xml_report of the loading of the above SELECT query table
    2. Then using SELECT * FROM xml_report to SPOOL the data to a file report.xml

    No need of XMLTYPE data behind. Xml data stream is fine for me.

    In addition, I need to validate the XML file, also using XSD.

    Problem is that the resulting lines of the select query are supposed to be from 15000 to 20000 bytes long.

    Oracle database version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    A Suggestion or a solution to this problem would be appreciated.

    (Sorry for the use of "BOLD", just to make it more readable and highlight the imp points)

    Bravo!

    Rahul

    It looks like I can choose only 4000 characters using the SELECT statement (please, correct me if I'm wrong)

    You use the right method.

    There is an implicit conversion from XMLType to the data type VARCHAR2 as expected by the function TO_CLOB, where the limitation, and the error.

    To serialize XMLType to CLOB, use the XMLSerialize function:

    SELECT XMLSerialize (DOCUMENT

    XMLELEMENT ("accounts",

    ...

    )

    )

    OF ANY_TABLE;

    For the rest of the requirement, I wish you good luck trying to spool the XML correctly.

    You may need to play around with the SET LONG and SET LONGCHUNKSIZE commands to operate.

Maybe you are looking for

  • How can I check my trousseau?

    I don't have access to the phone number in the file, y at - it another way to check it out in my new macbook?

  • How to disable the ' safe mode / strange ' so that all Web sites can be found

    I use Firefox without problem for the past few months, however, now there is a problem. When I walk into most websites, they do not load correctly, it looks like it is running in "safe mode" with most of the features of the page Web is not visible an

  • Currently impossible to download Yosemite

    I am looking for a way to download Yosemite. In my app App Store (running 10.9.5), Lion, Mountain Lion, Mavericks and El Capitan each have a download button. Yosemite said however just downloaded, and 10.10 installer which is present on my iMac insis

  • Battery emptied quickly after the last update: 1.0.04.12210

    Hello Battery is discharged very quickly after the last update of the firmware (1.0.04.12210). In two days (after a full charge) with about 2 hours of every day, the battery was empty. If nobody noticed something similar? Is there a solution to this?

  • Clip 8 GB don't organize music files

    I have several ripped CD I want to put on my 8 G Clip.  The songs were torn like MP3s using Sound Juicer.  After copy in the directory of the music of the Clip and the disassembly, the Clip said to update the database, as expected, but there is no or