Dynamically generate instructions INDEX

Hello

I have a requirement for serving data 3 million lines by table for 4 tables. I intend to drop the index before you delete the data in each table and recreate them after the purge.

I want to dynamically do this IE get the 'create' a few views of the dictionary index statement and then save the DDL in a file. Then, drag the index. Delete data. Run the above mentioned create index DDL.

Please let me know if it works and if yes, how can I get the create index statement?

Thank you
PSES

SAFRAN wrote:

Now number one after another :-)...

Create a script file and add

THE VALUE 100000 LONG
SET FEEDBACK OFF
SET PAGESIZE 0
SET TRIMSPOOL ON
TERMOUT OFF SET
SET LINESIZE 10000
COIL spoolfile
select statements
SPOOL OFF
OUTPUT

SY.

Published by: Solomon Yakobson, January 27, 2010 12:19

Tags: Database

Similar Questions

  • Dynamically generate UPDATE instructions

    DB version: 10 gr 2

    I was give a list of
    OLD_VALUE         NEW_VALUE
    ---------         -----------
    HR                 PERSONNEL
    FINANCE            FINC
    FACILITIES         FACS
    .
    .
    .
    I need to find all the columns that begin with DEP % table with a string 'HR' and updated 'STAFF' and the rest of the old to the new values as noted above. I'm trying so generate UPDATE instructions for this

    Answer to my question was actually provided by bluefrog to
    Re: Problem with SQL to write SQL help

    Thanks bluefrog.
    select
    ' update ' ||table_name ||' set '||column_name||' =replace('||column_name ||','||'''HR'''||','||'''PERSONNEL'''||');' 
    from user_tab_columns 
    where and column_name like 'DEPT%'
    But my old_Value, new_value list has 70 entries. So, I need to manually execute the above statement 70 times!
    How can I make the OLD_VALUE, NEW_vALUES to this sql and generate instructions to UPDATE, I need?

    Load the OLD_VALUE / new_value by list in the database using SQLLDR, external Tables, or by hand.

    Then browse these values generating the SQL you need.

    Maybe something like that? (Note this is not tested, just threw together quick):

    BEGIN
            FOR r IN
            (
                    SELECT  old_value
                    ,       new_value
                    FROM    update_list
            )
            LOOP
                    FOR s IN
                    (
                            SELECT  table_name
                            ,       column_name
                            FROM    user_tab_columns
                            WHERE   column_name LIKE 'DEPT%'
                    )
                    LOOP
                            DBMS_OUTPUT.PUT_LINE('update ' ||s.table_name ||' set '||s.column_name||' =replace('||s.column_name ||','''||r.old_value||''','''||r.new_value||''');'
                    END LOOP;
            END LOOP;
    END;
    

    Published by: Centinul on June 3, 2010 12:52

  • [JS] [IDSRV5] Generate the Index of the book

    Hello

    I'm trying to generate an index from a file of book with InDesign Server. With the following script nothing happens, I get an empty index page:

    var myIndex = myDocument.indexes[0];
    myDocument.indexGenerationOptions.includeBookDocuments = true;
    
    myIndex.generate();
    

    With the desktop version, you will need to open the book first. How to address the file book when generating a comprehensive index of all documents in a book?

    Best regards, Sjoerd

    In the desktop version, only with a beautiful book the option "Include book Documents" is available.

    Have you tried this with your open book file? (And it seems that you can not say the index options to use what book, if you have more than one open! Other crutches-and-Scotch work here.)

  • MovieClips dynamically generated

    Hello

    I tried to dynamically generate some movieclips the method I've used does the following:

    use a loop to run according to movieclips how I want generated

    whenever the loop cycles it creates a new instance of movieclip

    Adds the new movieclip in a table

    use the addChild method to put the moveclip onstage

    draw a rectangle

    starts filling

    filling of the ends

    It adds to this movieclip

    I then use a conditional statement checking if the movieclip is the first element of the array

    If so it sets the current x MovieClips and there position to a selected value. the first movieclip is used for a starting point to align the rest of the movieclips generated.

    If not the clips x and y position are defined on the elements of the array x and position previos y current movieclips width or height + the gap I wish they have.

    then the cycle repeats

    Ive coded it using code from script and it works very well the forms appear on the stage without errors

    I tried to move this code off the coast of the chronology for a file and the code has no errors, but when it is running I don't see objects even if I followed it y x and y positions I don't see them on the stage

    Script code

    var mcArray:Array = new Array(); / / DEFINE ARRAY FIRST

    var randomNo:Number;

    var colorStr:String;

    var currentColor;

    var movieClip:MovieClip; / / TEMPORARY VARIABLE

    var prevMCx:Number = 0;

    var prevMCy:Number;

    function myFunc (): void

    {

    for (var i: int = 0; i < 200; i ++)

    {/ / FOR LOOP}

    movieClip = new MovieClip();

    addChild (movieClip);

    mcArray [i] = movieClip; / / This is where we add the movieClip references in the table for later use

              if(i == 0)

              {

    mcArray [i] .x = 0;

    mcArray [i] there = 0;

              }

              else

              {

    prevMCx = mcArray [i-1] .x;

    prevMCy = mcArray [i-1] there;

    mcArray [i] .x = prevMCx + Math.ceil (Math.random () * 100);

    mcArray [i] there = prevMCy + Math.ceil (Math.random () * 100);

              }

    randColor();

    mcArray [i].graphics.beginFill (currentColor, 1);

    mcArray [i].graphics.drawRect (0,0,100,100);

    mcArray [i].graphics.endFill ();

    mcArray [i] .alpha = Math.Random ();

    colorStr = null;

         }

    }

    External AS

    package com.mvc

    {

    import flash.display.MovieClip;

    import flash.display.Sprite;

    import flash.geom. *;

    import flash.events.Event;

    import flash.net.URLLoader;

    import flash.net.URLRequest;

    import com.greensock.TweenLite;

    import com.greensock.TimelineLite;

    /public class LibraryLayout extends MovieClip

         {

    public var boxHeight:Number; box height assigned to the main timeline

    public var boxWidth:Number; width of //box assigned to the main timeline

    public var objFill:String; / / fill color box ASSIGN in MAIN TIMELINE

    public var objStroke:String; / / ASSIGN stroke color box in MAIN TIMELINE

    public var layoutTotalItems:uint;

    private var _imgBoxes:Array = new Array ;// holds all the video clips generated loop.

    private var _tempMovieClip:MovieClip; / / the temporary Variable holds current loop [i] movieclip.

    public void LibraryLayout()

              {

    drawBoxes();

              }

    public function drawBoxes (): void

              {

    for (var i: uint = 0; i < 10; i ++)

                   {

    _tempMovieClip = new MovieClip (); Creates a temporary MovieClip

    addChild (_tempMovieClip); / / Adds temporary MovieClip to the stage

    _imgBoxes [i] = _tempMovieClip; / / temporary adds

    _imgBoxes [i].graphics.beginFill (0 x 000000, 1);

    _imgBoxes [i].graphics.drawRect (0,0,100,100);

    _imgBoxes [i].graphics.endFill ();

    //===trace statements, check if the feature does not.

                        If (i == 0)

                        {

    _imgBoxes [i] .x = 10;

    trace (_imgBoxes [i] .x);

                        }

                        else

                        {

    _imgBoxes [i] .x = _imgBoxes [(i-1)] .x + (_imgBoxes [i] .width + 10);

    trace (_imgBoxes [i] .x);

                        }

    _imgBoxes [i] there = 150;

                   }

              }

    public function tweeningSlides (): void

              {

              }

         }

    }

    I am very confused why it does not work if you need more details let me know

    If anyone can help me solve this problem, it would make my month!

    Right. I don't see where you

    addChild (libraryLayout)

    The LibraryLayout class extends MovieClip and if MovieClips are visible they need to be added to the display list.

    Only the document class is added automatically, but her children aren't.

  • How to dynamically generate text or all component areas?

    Hello

    I use Flex4 SDK and Flash Builder with eclipse plugin(trail version) for the development of a flex project.

    I have problems to dynamically generate text boxes.

    When I click on a link button, I want a text box to display on the screen. I tried a few examples that I found on the internet but without success.

    I appreciate your time.

    Thank you

    Ravi

    What error do you get?  Maybe try addElement instead of addChild

  • Dynamically generate orders exp

    DB version: 10.2.0.4

    I'm dynamically generating export scripts. Ask 1 works very well for this.
    Because we do not have enough space in our area, I have to include gzip for each dumpfile coming to create. So, I did a UNION ALL as shown in query 2 operation. But it does not work because the second and the third query (with DOUBLE) cannot access column username from the first query with DBA_USERS.



    = The query 1 =.
    SELECT 'exp system/secret@fmprod BUFFER=10485760 owner='||username||' FILE=/data/exp_bkp/FMPROD_' || TO_CHAR(SYSDATE, 'YYYYMONDD' ) || '/' || username || '_' || TO_CHAR(SYSDATE, 'YYYYMONDD' ) ||'.dmp LOG=/data/exp_bkp/FMPROD_' || TO_CHAR(SYSDATE, 'YYYYMONDD' ) || '/' || username || '_' || TO_CHAR(SYSDATE, 'YYYYMONDD' ) ||'.LOG statistics=none consistent=y'  
    FROM dba_users where  account_status != 'LOCKED' 
    and username not like '%TEST%'
    AND username not in
    ('SYS',
    'SYSTEM',
    'OUTLN',
    'MGMT_VIEW',
    'MDSYS'  ,
    'DBSNMP' ,
    'WMSYS'  ,
    'CTXSYS' ,
    'SYSMAN',
    'ORDPLUGINS',
    'OWBSYS',
    'OLAPSYS',
    'ORACLE_OCM'
    ) 
    = Query2 =.
    SELECT 'exp system/secret@fmprod BUFFER=10485760 owner='||username||' FILE=/data/exp_bkp/FMPROD_' || TO_CHAR(SYSDATE, 'YYYYMONDD' ) || '/' || username || '_' || TO_CHAR(SYSDATE, 'YYYYMONDD' ) ||'.dmp LOG=/data/exp_bkp/FMPROD_' || TO_CHAR(SYSDATE, 'YYYYMONDD' ) || '/' || username || '_' || TO_CHAR(SYSDATE, 'YYYYMONDD' ) ||'.LOG statistics=none consistent=y'  
    FROM dba_users where  account_status != 'LOCKED' 
    and username not like '%TEST%'
    AND username not in
    ('SYS',
    'SYSTEM',
    'OUTLN',
    'MGMT_VIEW',
    'MDSYS'  ,
    'DBSNMP' ,
    'WMSYS'  ,
    'CTXSYS' ,
    'SYSMAN',
    'ORDPLUGINS',
    'OWBSYS',
    'OLAPSYS',
    'ORACLE_OCM'
    ) 
    union all
    select 'gzip /data/exp_bkp/FMPROD_' || TO_CHAR(SYSDATE, 'YYYYMONDD' ) || '/' || username || '_' || TO_CHAR(SYSDATE, 'YYYYMONDD' ) ||'.dmp' from dual
    union all
    select 'gzip /data/exp_bkp/FMPROD_' || TO_CHAR(SYSDATE, 'YYYYMONDD' ) || '/' || username || '_' || TO_CHAR(SYSDATE, 'YYYYMONDD' ) ||'.log' from dual

    Use a second select statement, but don't use Union al.

    Or copy it directly in the string.

    select 'exp ...' from ...;
    select 'gzip ... ';
    

    or

    select 'exp ...'
           ||chr(10)  /* on windows systems you might need to add ||chr(13) */
           ||'gzip ... '
    from ...;
    
  • Dynamically generated movieclip properties

    Hello

    I'm reading in the data to an XML file. Each attribute of a child is assigned as a property of a movieclip as shown in the related code. However, I want to do is don't have not not the property will have already decided names that I don't necessarily know how to attribute a child in the xml file. Is it possible to dynamically name properties according to what number attribute, they are...?

    Thanks in advance

    Greg

    Yes it's possible... :)

    the docs have an example related directly to it, using the method "attributes()" (with the ') you can return a list of all the attributes of a node object to give in the form of an XMLList object. then iterate through this object, you can use the 'name()' method to return the name of each attribute. as you do this, you can use operators to access to dynamically generate the properties of the object of MC, and then assign the values in the other table, as in:

  • How to execute dynamically generated using GR 11, 2 SQL statements?

    Hello

    I would like to know if it is possible to do what the following statement which is intended :
    select * from (select replace('select empno from emp',
                                 '',
                                 '') from dual);
    in other words, is it possible to dynamically generate and execute a select statement in a from clause?

    Thank you for your help,

    John

    Published by: 440bx 16 July 2010 15:57 modified 'create' to 'generate' to the subject

    Like many I know no. in SQL. Results of your query in the FROM clause will not be transformed as another query, but just a litral value and your outer query returns this value as "select empno from emp".

    But you can use dynamic sql statements in PL/SQL using EXECUTE IMMEDIATE or DBMS_SQL.

    Something like that.

    DECLARE
     dynamic_from_clause VARCHAR2(4000) := 'select empno from emp';
     vReturnVal NUMBER;
    BEGIN
      EXECUTE IMMEDIATE 'SELECT * FROM ('||dynamic_from_clause||')' into vReturnVal ;
    END;
    /
    

    Just write memory have not tested it.

  • Dynamically generate text areas

    Hello

    I'm trying to dynamically generate the TextFields and being able to access them by name. I give the TextField object a name when I create, but I can't access it by that name. Here's what I have so far:

    Use the getChildByName displayobjectcontainers method and you will probably need to throw the child as a textfield.

  • Oracle cards: legend for dynamically generated styles

    Hi all

    I use the dynamically generated styles in my application of the Oracle cards. Depending on the situation, the style may be a variable marker or a color scheme. Now, I need to create a map legend, but I'm having a problem.

    A model of color scheme is defined and applied as:
    xmlDef = '<AdvancedStyle><ColorSchemeStyle basecolor="blue" strokecolor="black">' +
                            '<Buckets>' +
                                '<RangedBucket label="" high="' + value + '"/>' +
                                '<RangedBucket label="" low="' + value + '" high="' + value*2 + '"/>' +
                                '<RangedBucket label="" low="' + value*2 + '" high="' + value*3 + '"/>' +
                                '<RangedBucket label="" low="' + value*3 + '" high="' + value*4 + '"/>' +
                                '<RangedBucket label="" low="' + value*4 + '" high="' + value*5 + '"/>' +
                                '<RangedBucket label="" low="' + value*5 + '" high="' + value*6 + '"/>' +
                                '<RangedBucket label="" low="' + value*6 + '"/>' +
                            '</Buckets></ColorSchemeStyle></AdvancedStyle>';
                            
          style = new MVXMLStyle("COLOR", xmlDef);
    I can apply and see the results without any problem, however when I try to create a legend, like this:
    var html = "<table><tr><td><img src="+baseURL+"/omserver?sty=COLOR&w=180&h=175&ds=solap></td></tr></table>";
        
        legend = new MVMapDecoration(html,null,0.04,200,110);
        mapview.addMapDecoration(legend);
    I get an error of this style is not found 'COLOR ':
    May 25, 2009 7:35:17 AM oracle.sdovis.style.AllStyleTable getStyleObject
    WARNING: Cannot find style named COLOR of SYSTEM in all_sdo_styles
    May 25, 2009 7:35:17 AM oracle.lbs.mapserver.oms reportException
    SEVERE: Message:style not found
    It's strange because the style is there and successfully applied to the card, I just can't generate a legend. Any ideas please?

    Thanks in advance,
    ~ Ruben

    You can build an application of xml and use it in the url of the image. Make sure that you remove all redundant new lines and spaces in the query and call encodeURIComponent to encode it. Here is an example.

    var xmlreq = encodeURIComponent (" '");

    var html ="

    ";

    Caption = new MVMapDecoration(html,null,0.04,200,110);
    mapview.addMapDecoration (legend);

  • Dynamically generate actions

    Hello

    I'm working on a project in which I would like to generate a lot of photoshop different sets of operation using either actions or scripts.  A single script would be very simple, for example: duplicate a layer, by applying one of the photoshop filters to the layer (change some default settings), and then mix the two together and save the resulting image.  Of course, it would be very simple to record an action, but potentially I want to try a lot of them, and I want to generate dynamically using any other programming language.  Is it possible to save an action, then find the real instructions somewhere on the disk?  Or maybe is it possible to convert an action in a script?  Or this will be possible only using scripts?

    Thank you!

    If you want to create an acton on the fly changing of filters arguments, I think that you should change the XML and that convert an action with the help of xtools.

    If you just want to call any filters that are not in the DOM with a script you can use scriptlistener to generate the necessary code and modify this part of the paper to create a function with the arguments.

  • Installation alarm alarms dynamically - generating trouble

    Is someone can you please tell me why this code generates alarms.  I need to create variables of library / shared dynamically and configure alarming programmatically.  I can't make it work.  Is there something that I am missing?

    Ah, I was following the wrong shared variable I was writing to.  This example works now.

    Thank you OR engineer (I forgot your name)

    Matt

  • Dynamically generated Word doc doubled the headers and feet

    Hello

    I am able to use CFcontent tags and CFheader etc. to generate a Word document with dynamic data on the fly and this Word doc has several pages.  One issue is that the last page has double headers and feet.  Here's the process:

    (1) < cfsavecontent
    variable = "WDcontent" >

    (2) use of Word and Microsoft XML style guide

    < xmlns:o = html "" urn: schemas-microsoft-com ' "
    xmlns:w = "" urn: schemas-microsoft - com:office:word ""
    " xmlns =" http://www.w3.org/TR/REC-html40 ">

    < head >

    < style >

    1. p.MsoHeader, li. MsoHeader, div. MsoHeader
      {margin: 0}
      margin-bottom: .0001pt;
      MSO-pagination: widow-orphan;
      tab-stops: 3.0 in. Center right 6.0 in. ;}

      p.MsoFooter, li. MsoFooter, div. MsoFooter
      {margin: 0}
      margin-bottom: .0001pt;
      MSO-pagination: widow-orphan;
      tab-stops: 3.0 in. Center right 6.0 in.;
      size are: 10.0pt ;}

      @page Section1
      {size: 8.5 to 11.0 in;}
      margin: 1.0 in 1.25 in. 1.0 in. 1.25 in.;
      MSO-header: h1;
      MSO-footer: f1;
      MSO-header-margin: 5;
      MSO-footer-margin: 5; MSO-paper-source: 0 ;}
      div. 1
      {page: Section1 ;}}

      area of header and footer
      table #hrdftrtbl
      {
      margin: 0-0-0 in 9 inches;
      }

    < / style >

    (3) continued with the release of HTML body

    towards the end, and before the high-level DIV ends,

    Add the header and footer, reference

    < id of the table = "hrdftrtbl" border = "0" cellspacing = "0" cellpadding = "0" >
    < b >
    < td >
    < div style ='mso-item: header "id ="h1">"
    < style p ='text-align: center ">"
    < img src = "" #baseURL #/ header2.png "width ="90% "height ="75">"
    < /p >
    < / div >
    < table >

    < td >
    < div style ='mso-element: a footer "id ="f1">"
    < p align = "right" >
    < span style = mso-tab-number: 2' >
    < img src = "" #baseURL #/ footer2.png "width ="90% "height ="15">"
    </span >
    < /p >
    < / div >
    < table >
    < /tr >
    < /table >

    Then, after the closing of the HTML


    < / cfsavecontent >

    (4) direct exit to the word

    <!--> WORD version
    < name cfheader = "content-disposition" value = "filename = myNew.doc" >
    < cfcontent type = "application/msword" >

    < cfprocessingdirective suppressWhiteSpace = "true" >
    < cfoutput > #WDcontent # < / cfoutput >
    < / cfprocessingdirective >

    Thoughts?

    TIA.

    Solved.

  • dynamically generate files in ODI excel

    Hello

    I have an obligation to generate excel file dynamically from a table in the Oracle data source. Is this possible?

    Can someone tell how to do it in stages?



    Thanks in advance

    Edited by: 883410 May 17, 2012 03:51

    Yes, it's possible by using OdiSqlUnload. It creates a file, and then load the data into it. But here you get column C1, C2 etc.
    You can give your file name in a variable and use this variable in OdiSqlUnload.
    To generate the header, you can refer
    http://odiexperts.com/generate-column_name-header-for-odisqlunload/

    Thank you.

  • Auto numbering dynamically generated of the rows in the table

    On the bound form, trying to get the yellow field to display a subset of the green field number. Example: If the first green field shows '1' the first yellow field displays 1.1 and the following yellow field will display 1.2, 1.3 then and so on. When a new topic is generated, the green field displays "2" and the corresponding yellow action items displayed 2.1, then 2.2, then 2,3, etc...

    What I am doing wrong?

    https://Acrobat.com/#d=XXcSY7cDhuULeoj4 * PEgqg

    Hello

    This seems to work as you describe it:

    this.rawValue = NumericField1.rawValue + "." + (this.parent.index + 1);
    

    However to change the scope of a Textfield object.

    Good luck

    Niall

Maybe you are looking for