Script for multiple insert

hi,
I want to insert some 100 records into emp table.
instead of one by one one row insert, i want to write a script so that it will insert 100 records. like
empid ename sal
1000 king a 100
this is the first record, the second record should be empid should be incremented by 1 i.e 1001 and ename should be king b and salary should be incremented by 100 rs.. like this..to 100 records.
pls hlp
regards
dell

This one could work:
WITH t AS (SELECT ROWNUM rn,
                  ' abcdefghijklmnopqrstuvwxyz' char_table
             FROM all_objects)
SELECT 1000 + ROWNUM - 1 empid,
       'king ' || char_counter,
       100 + (ROWNUM - 1) * 100 sal
  FROM (SELECT char_counter
          FROM (SELECT SUBSTR(t1.char_table, t1.rn, 1) || SUBSTR(t2.char_table, t2.rn, 1) char_counter
                  FROM t t1,
                       t t2
                 WHERE t1.rn <= 27
                   AND t2.rn <= 27
                   AND t2.rn >  t1.rn
         ORDER BY char_counter
WHERE ROWNUM <= 100
; C.

Similar Messages

  • Generating Insert Scripts for multiple tables

    Hi,
    I have 6 tables TABLA,TABLB,TABLC,TABLED,TABLEE,TABLEF
    I want to generate Insert Scripts for the above 6 tables.
    Is there any mechanism to do so so that i can generate the .sql files for the above 6 tables to another schema?
    Any help will be needful for me.

    Hi,
    May the below given function script help you...
    CREATE OR REPLACE FUNCTION get_insert_script (v_table_name VARCHAR2)
       RETURN VARCHAR2
    AS
       b_found   BOOLEAN         := FALSE;
       v_tempa   VARCHAR2 (8000);
       v_tempb   VARCHAR2 (8000);
       v_tempc   VARCHAR2 (255);
    BEGIN
       FOR tab_rec IN (SELECT table_name
                         FROM all_tables
                        WHERE table_name = UPPER (v_table_name))
       LOOP
          b_found := TRUE;
          v_tempa := 'select ''insert into ' || tab_rec.table_name || ' (';
          FOR col_rec IN (SELECT   *
                              FROM cols
                             WHERE table_name = tab_rec.table_name
                          ORDER BY column_id)
          LOOP
             IF col_rec.column_id = 1
             THEN
                v_tempa := v_tempa || '''||chr(10)||''';
             ELSE
                v_tempa := v_tempa || ',''||chr(10)||''';
                v_tempb := v_tempb || ',''||chr(10)||''';
             END IF;
             v_tempa := v_tempa || col_rec.column_name;
             IF INSTR (col_rec.data_type, 'CHAR') > 0
             THEN
                v_tempc := '''''''''||' || col_rec.column_name || '||''''''''';
             ELSIF INSTR (col_rec.data_type, 'DATE') > 0
             THEN
                v_tempc :=
                      '''to_date(''''''||to_char('
                   || col_rec.column_name
                   || ',''mm/dd/yyyy hh24:mi'')||'''''',''''mm/dd/yyyy hh24:mi'''')''';
             ELSE
                v_tempc := col_rec.column_name;
             END IF;
             v_tempb :=
                   v_tempb
                || '''||decode('
                || col_rec.column_name
                || ',Null,''Null'','
                || v_tempc
                || ')||''';
          END LOOP;
          v_tempa :=
                v_tempa
             || ') values ('
             || v_tempb
             || ');'' from '
             || tab_rec.table_name
             || ';';
       END LOOP;
       IF NOT b_found
       THEN
          v_tempa := '- Table ' || v_table_name || ' not found';
       ELSE
          v_tempa := v_tempa || CHR (10) || 'select ''- commit;'' from dual;';
       END IF;
       RETURN v_tempa;
    END;(copied and pasted from a commercial site)
    *009*
    Edited by: 009 on Jan 14, 2010 10:43 PM
    (Function after debug)

  • Printing sap script for multiple customers

    Hi,
    I have a requiremnt to print the form for multiple customers. How should i use the sap script function modules? i.e. in which sequence?
    for example customer A has 5 pages. customer B has 4 pages.
    after printing 5 pages of the customer A, it should print 4 pages of the customer B.
    regards,
    CK

    To print accroding to your requirment you should modify your driver program like this...
    Sort <Internal table by KUNNR.
    LOOP AT <internal table>
    AT NEW KUNNR. "Customer..
    **Call Function module OPEN_FORM
    END AT.
    AT END OF KUNNR.
    ***Call function CLOSE_FORM
    ENDAT.
    ***Call all your Write_FORM
    ENDLOOP.
    Regards,
    SaiRam

  • One script for multiple loaded movie clips

    Hello,
    I am sure that this has been asked or answered before, but
    could not locate the correct response.
    Problem:
    There are 20 movie clips loaded onto the stage through
    actionscript. I have 20 different onPress scripts to start the drag
    for each (which also contain custom variable).
    Problem, I have one single onRelease script which is to be
    used for each, but do now wish to give 20 custom handled scripts.
    Can I somehow use certain scripting for using one single
    generic script for the onRelease? So no matter what was released it
    will go through this one script.
    Thanks
    D

    like this...
    activate
    set the_folder to choose folder with prompt "Select the folder you want to add folders to..."
    tell application "Finder"
    set the_name to "Name"
    set the_count to 3
    repeat with this_num from 1 to the_count
    set new_num to this_num as string
    if (count new_num) is 1 then set new_num to "0" & new_num
    make new folder at the_folder with properties {name:the_name & " " & new_num}
    end repeat
    end tell

  • Script for Multiple Folders (Changeable)

    Okay, here is what I am needing but can't figure out. I need a script that will allow me to make multiple folders with "name and number sequence" that I specify in a folder that I specify. For example:
    Main Folder (Whatever one I choose)
    Name 01
    Name 02
    Name 03
    I would like to be able to change the name at will and how many folders that are created. If anyone could help me I would be grateful as it would save me a ton of time.
    Thanks

    like this...
    activate
    set the_folder to choose folder with prompt "Select the folder you want to add folders to..."
    tell application "Finder"
    set the_name to "Name"
    set the_count to 3
    repeat with this_num from 1 to the_count
    set new_num to this_num as string
    if (count new_num) is 1 then set new_num to "0" & new_num
    make new folder at the_folder with properties {name:the_name & " " & new_num}
    end repeat
    end tell

  • FDM integration script for multiple locations

    Hi,
    I have a slight problem with FDM integration script (SQL integration).
    From what I've understood and tested within one FDM-application (tablespace) I'm not able to have multiple integration scripts. This because the integration script needs to be named SQLIntegration.uss, otherwise there will be an error.
    I have multiple locations within one FDM-application where I would like to use an integration script. Due to the above mentioned naming "bug", I need to include all my locations' integration information in one script. As imagined this is not a solution that easy to maintain or easy to read.
    - Is there a workaround for the name-bug?
    - Can I call a function within the main function? I tried without any success, but maybe you would have a solution.
    Any input would be beneficial

    user10757003 wrote:
    Not sure what you mean when you say you rename the file and you get the error.
    Is this a new integration script you have created and cut / pasted the existing integration script contents? If so, did you remember to change the SQLINTEGRATION = TRUE statement at the end of the script to the new integration script name? this might be the reason why you get the 'Import Successful' popup and the Import error dropdown.What I mean is that scripts are name xxx.uss abc.uss. This should be fairly clear.
    Now I have the SQLIntegration.uss, if I change the name of the script to SQLIntegration1.uss or any name. The script will not work. And I receive one error and one success message as stated above.
    Note: I'm not changing the content or anything else inside the script.

  • Script for generating insert statements

    I have different tables with data and I would like to have the insert statements generated of the data in the tables. Does someone have a generic script to do the job?

    Hi trafoc,
      You can also check out SQL Developer which has function to output table ddl and/or
    data under Tools selection.  Link is "http://www.oracle.com/technology/software/products/sql/index.html"
    Below is a sample output :
    --   DATA FOR TABLE PEOPLE
    --   FILTER = none used
    REM INSERTING into PEOPLE
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('SMITH','CLERK',800,20);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('ALLEN','SALESMAN',1600,30);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('WARD','SALESMAN',1250,30);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('JONES','MANAGER',2975,20);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('MARTIN','SALESMAN',1250,30);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('BLAKE','MANAGER',2850,30);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('CLARK','MANAGER',2450,10);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('KING','PRESIDENT',5000,10);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('TURNER','SALESMAN',1500,30);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('GRIZZLY','CLERK',1100,20);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('JAMES','CLERK',950,30);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('FORD','ANALYST',3000,20);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('MILLER','CLERK',1300,10);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('SCOTT','Clerk',9999,20);
    Insert into PEOPLE (USERNAME,JOB,SALARY,DEPTNO) values ('TEST_VPD','Clerk',1500,20);
    --   END DATA FOR TABLE PEOPLE
    HTH
    Zack

  • Simple Script for Multiple Objects?

    Someone recently helped me with setting an opacity level for an object using this one line script and binding a keyboard shortcut to it: app.selection[0].transparencySettings.blendingSettings.opacity=50; (Pressing "5" sets the object's opacity to 50%)
    Although the script works perfectly for one object, when mutiple objects are selected it only affects the first selected object. Can someone show me how to get this script to affect multiple objects at once?
    Thanks in advance!

    Thanks for the help man, but what's with the snarky comment? lol. Yeah I use my "5" key daily as well. But in ID it does nothing while in the default context, so why not put it, and the other digits to use to quickly set object opacity? (this function is similar to setting opacity for Photoshop layers by the way).
    Have a nice day, and cheer up. Spring's almost here.

  • OpenScript 9.1 - use one script for multiple environments

    Greetings everyone.
    I am using Openscript 9.1 on Windows XP. I want to record a script on a web application hosted in one environment and reuse the same script (with minimal re-work) against the same web application hosted in a different environment. For example, record in development and reuse in test and production.
    From what I read on the Internet, the only way to do it is to find the URL in the Java code of the script and replace it as needed. Is there a more sophisticated way of doing this? Thanks in advance for your time and response.

    This one could work:
    WITH t AS (SELECT ROWNUM rn,
                      ' abcdefghijklmnopqrstuvwxyz' char_table
                 FROM all_objects)
    SELECT 1000 + ROWNUM - 1 empid,
           'king ' || char_counter,
           100 + (ROWNUM - 1) * 100 sal
      FROM (SELECT char_counter
              FROM (SELECT SUBSTR(t1.char_table, t1.rn, 1) || SUBSTR(t2.char_table, t2.rn, 1) char_counter
                      FROM t t1,
                           t t2
                     WHERE t1.rn <= 27
                       AND t2.rn <= 27
                       AND t2.rn >  t1.rn
             ORDER BY char_counter
    WHERE ROWNUM <= 100
    ; C.

  • Script for multiple tp addtobuffer and tp import in windows OS

    Hi Gurus,
    Can someone extend some asssitance? I need to transport 5000 transport request in OS level (window). I wanted to create a script that will enable me to addtobuffer and tp import all this 5000 request and will show the error code of the particular TPs that encountered an error.
    Need your immediate assistance please?

    Hi,
    You can do the following
    1.     Compose all the requests in the given specified format.
    tp addtobuffer REQUEST SID client=XXX pf= Transport domain profile  Using excel sheet.
      We should have following things
    a.     Request IDs such as <SID>K9XXXXX
    b.     SID of the system for which these requests are to be imported.
    c.     Specific client no.
    d.     Transport domain profile.
    The final format of the excel sheet with all the transport requests should look like this.
    This format needs to be pasted on to the text file. (transports.txt), in windows you can save as .cmd  or bat format may be.
    tp     addtobuffer     <SID>K9XXXXX     <target SID>     client=XXX pf=TP_DOMAIN_SID.PFL
    tp     addtobuffer     <SID>K9XXXXX     <target SID>     client=XXX pf=TP_DOMAIN_SID.PFL
    tp     addtobuffer     <SID>K9XXXXX     <target SID>     client=XXX pf=TP_DOMAIN_SID.PFL
    tp     addtobuffer     <SID>K9XXXXX     <target SID>     client=XXX pf=TP_DOMAIN_SID.PFL
    u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
    u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026.
    2.     Once the text file or cmd file with all the requests are made, place it on to the target system transport directory.
    /usr/sap/Trans/bin.
    3.     Execute this file (./transports.bat) and redirect this file to one more file (error.txt) for checking the errors
    ./transports.bat >> error.txt
    Once all the transports are attached into buffer, you can do the mass import from STMS
    Thanks and Regards
    Purna
    Edited by: purnachender on Mar 17, 2010 7:11 AM

  • Need a click and drag script for multiple layers.

    Hi. I'm realitivly new to Flash and Action Script.
    For a Majour project school asignment i am trying to create an interactive map for a hypothetical theme park, and i'll cut to the chase, i need a script that allows the player to drag the content of two or three layers around the screen upon mouse click, similar to this example:\
    http://www.dreamworld.com.au/content/drw_2008_shopping.asp?name=ParkMap
    I will have a layer for buttons (probably called Buttons) and a layer for the map graphic (Probably called Map), similar to this tutorial:
    http://www.republicofcode.com/tutorials/flash/interactive_map/
    If anyone could produce, or has a script lying around that could do this; i would really apreciate it.
    This assignment has a large impact on my UAI (universities admission index).
    Thanks for your time,
    Pat

    Thanks for your help. I really appreciate it.
    The problem is; this is the script i am using to make the map interactive:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var cities:Array = ["muscat", "sohar", "dubai","abu_dhabi"]
    function mover (targetX, targetY){
    currentX = marker_mc._x;
    currentY = marker_mc._y;
    var xTween:Tween = new Tween(marker_mc, "_x", Strong.easeOut, currentX, targetX, .5, true);
    var yTween:Tween = new Tween(marker_mc, "_y", Back.easeOut, currentY, targetY, 1.5, true);
    for (var i = 0; i<cities.length; i++){
    var my_btn = this[cities[i]+"_btn"];
    my_btn.myCity = cities[i];
    my_btn.onRollOver = function() {
    mover( this._x, this._y);
    marker_mc.gotoAndStop(this.myCity);
    And when the buttons are made to be part of a movie clip with the image i am using for the background this script does not work.
    The script is located in a layer called "Actions", if that is of any help at all.
    Any ideas?
    I am sorry if I am being a newsense.
    Thanks

  • Rowcount for multiple insert statements

    Hi all,
    Is there a way I can get separate rowcount in multi table insert?
    My sql is written as below:
        INSERT ALL
          INTO TAB1 (COL1, COL2....)  VALUES          (VAL1, VAL2....)
          INTO TAB2 (COL1, COL2....)  VALUES          (VAL1, VAL2....)
            (SELECT * FROM TABLE);
    rowcount of tab1?
    rowcount of tab2?
    Thank you,
    Niroop

    Here is the work around to get the multi-table insert counts.
    SQL>
    SQL> select * from v$version;
    BANNER                                                                         
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production   
    PL/SQL Release 11.2.0.1.0 - Production                                         
    CORE    11.2.0.1.0    Production                                                     
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production                        
    NLSRTL Version 11.2.0.1.0 - Production                                         
    SQL>
    SQL> DROP PACKAGE utils_pkg;
    Package dropped.
    SQL> DROP TABLE src_tab;
    Table dropped.
    SQL> DROP TABLE tab1;
    Table dropped.
    SQL> DROP TABLE tab2;
    Table dropped.
    SQL>
    SQL> CREATE OR REPLACE
      2  PACKAGE utils_pkg
      3  IS
      4    v_tab1_rec_count pls_integer :=0;
      5    v_tab2_rec_count pls_integer :=0;
      6    FUNCTION fCounter(
      7        pTab_Name IN VARCHAR2)
      8      RETURN NUMBER;
      9    FUNCTION fGetInsCounts(
    10        pTab_Name IN VARCHAR2)
    11      RETURN NUMBER;
    12    FUNCTION fResetCounts
    13      RETURN NUMBER;
    14  END utils_pkg;
    15  /
    Package created.
    SQL> CREATE OR REPLACE
      2  PACKAGE body utils_pkg
      3  IS
      4  FUNCTION fcounter(
      5      pTab_Name IN VARCHAR2)
      6    RETURN NUMBER
      7  IS
      8  BEGIN
      9    IF pTab_Name        = 'TAB1' THEN
    10      v_tab1_rec_count := v_tab1_rec_count +1;
    11    ELSE
    12      v_tab2_rec_count := v_tab2_rec_count +1;
    13    END IF;
    14    RETURN 0;
    15  END fcounter;
    16  FUNCTION fGetInsCounts(
    17      pTab_Name IN VARCHAR2)
    18    RETURN NUMBER
    19  IS
    20  BEGIN
    21    IF pTab_Name = 'TAB1' THEN
    22      RETURN v_tab1_rec_count;
    23    ELSE
    24      RETURN v_tab2_rec_count;
    25    END IF;
    26  END fGetInsCounts;
    27  FUNCTION fResetCounts
    28    RETURN NUMBER
    29  IS
    30  BEGIN
    31    v_tab1_rec_count :=0;
    32    v_tab2_rec_count :=0;
    33    RETURN NULL;
    34  END fResetCounts;
    35  END utils_pkg;
    36  /
    Package body created.
    SQL> CREATE TABLE src_tab AS
      2  SELECT *
      3  FROM
      4    (SELECT 1 col1, 'TEST' col2, 'TAB2_DATA' col3 FROM dual
      5    UNION ALL
      6    SELECT 2, 'TESTING', 'NO_TAB2_DATA' FROM dual
      7    )temp;
    Table created.
    SQL>
    SQL> CREATE TABLE tab1 AS
      2  SELECT col1, col2 FROM src_tab WHERE 1=2;
    Table created.
    SQL>
    SQL> CREATE TABLE tab2 AS
      2  SELECT col3 FROM src_tab WHERE 1=2;
    Table created.
    SQL>
    SQL> SELECT utils_pkg.fGetInsCounts('TAB1') AS tab1_inserts,
      2    utils_pkg.fGetInsCounts('TAB2')      AS tab2_inserts,
      3    utils_pkg.fresetcounts    AS reset_done
      4  FROM dual;
    TAB1_INSERTS TAB2_INSERTS RESET_DONE                                           
               0            0                                                      
    SQL>
    SQL> INSERT ALL
      2  INTO tab1
      3    (
      4      col1,
      5      col2
      6    )
      7    VALUES
      8    (
      9      DECODE(utils_pkg.fcounter('TAB1'),0,col1),
    10      col2
    11    )
    12  INTO tab2
    13    (
    14      col3
    15    )
    16    VALUES
    17    (
    18      DECODE(utils_pkg.fcounter('TAB2'),0,col3)
    19    )
    20  SELECT col1, col2, col3 FROM src_tab;
    4 rows created.
    SQL>
    SQL>
    SQL> SELECT utils_pkg.fGetInsCounts('TAB1') AS tab1_inserts,
      2    utils_pkg.fGetInsCounts('TAB2')      AS tab2_inserts,
      3    utils_pkg.fresetcounts    AS reset_done
      4  FROM dual;
    TAB1_INSERTS TAB2_INSERTS RESET_DONE                                           
               2            2                                                      
    SQL>
    SQL> rollback;
    Rollback complete.
    SQL>
    SQL> INSERT  WHEN 1=1 THEN
      2  INTO tab1
      3    (
      4      col1,
      5      col2
      6    )
      7    VALUES
      8    (
      9      DECODE(utils_pkg.fcounter('TAB1'),0,col1),
    10      col2
    11    )
    12    WHEN col3 = 'TAB2_DATA' THEN
    13  INTO tab2
    14    (
    15      col3
    16    )
    17    VALUES
    18    (
    19      DECODE(utils_pkg.fcounter('TAB2'),0,col3)
    20    )
    21  SELECT col1, col2, col3 FROM src_tab;
    3 rows created.
    SQL>
    SQL>
    SQL> SELECT utils_pkg.fGetInsCounts('TAB1') AS tab1_inserts,
      2    utils_pkg.fGetInsCounts('TAB2')      AS tab2_inserts,
      3    utils_pkg.fresetcounts    AS reset_done
      4  FROM dual;
    TAB1_INSERTS TAB2_INSERTS RESET_DONE                                           
               2            1                                                      
    SQL>
    SQL> rollback;
    Rollback complete.
    Thanks,
    GPU

  • One single insert for multiple inserts if the tables in from are same

    Hi all,
    Can I have a single insert for below 3 insert stm.
    declare
    v_z number;
    begin
    v_z :=0.0;
    INSERT INTO rd_carry_new1
    SELECT  s.ssm_id,
         s.ssm_id as adjusted_cusip,
         v_z as rolldown, --= @zero,                     
         v_z as oas, --=@zero,                     
         nvl(srm.carry_rate, 0.0) as carry,
         v_z as finance_rate, --= @zero,                           
         v_z as price_drop, --= @zero,
         sw.heldby_pco_sw,
         v_z as carry_bk1, --= @zero,        -- place holders for interim results
         v_z as carry_bk2, --= @zero,
         'Y              ' AS r_srm_flag,     --r_srm_flag     = "Y              ", /*-- Indicates value from SRM, stale these should not be updated at any point*/
         'Y              ' AS o_srm_flag,     --o_srm_flag     = "Y              ",
         'Y              ' AS c_srm_flag,     --c_srm_flag     = "Y              ",
         'Y              ' AS f_srm_flag,     --f_srm_flag     = "Y              "
         'SRM' AS oas_method                         --,          oas_method='SRM'
    FROM  sec_tab_sdb s,
      sr_measures srm,
      sec_sw sw
    WHERE s.ssm_id = srm.ssm_id
    AND   s.ssm_id = sw.ssm_id;
    insert into rd_finance_new1
    select  s.ssm_id,
         v_z as rolldown,                     
         v_z as oas,                     
         v_z as carry,                        
         nvl(srm.financing_rate,0) as finance_rate,    
         v_z as price_drop,
         sw.heldby_pco_sw,
         v_z as rolldown_bk1,        -- place holders for interim results
         v_z as rolldown_bk2,
         'SRM'  as finance_method, -- audit for financing_rate queries
         'Y              ' as r_srm_flag,    -- Indicates value from SRM, stale these should not be updated at any point
         'Y              ' as o_srm_flag,
         'Y              ' as c_srm_flag,
         'Y              ' as f_srm_flag
    from  sec_tab_sdb s,
      sr_measures srm,
      sec_sw sw
    where s.ssm_id = srm.ssm_id
    and   s.ssm_id = sw.ssm_id;
    insert into  pco_on.rd_rolldown_new1
    select s.ssm_id,
            nvl(srm.rolldown,0) as rolldown,    
            v_z as oas,                     
            v_z as carry,                          
            v_z as finance_rate,                           
            v_z as price_drop,
            sw.heldby_pco_sw,
            v_z as rolldown_bk1,             -- place holders for interim results
            v_z as rolldown_bk2,
            'Y              ' as r_srm_flag,   -- Indicates value from SRM, stale these should not be updated at any point
            'Y              ' as o_srm_flag,     
            'Y              ' as c_srm_flag,     
            'Y              ' as f_srm_flag,     
            'SRM'        as  rolldown_method
    from  sec_tab_sdb s,
      sr_measures srm,
      sec_sw sw
    where s.ssm_id = srm.ssm_id
    and   s.ssm_id = sw.ssm_id;
    end;

    try this please
    INSERT ALL
    INTO RD_CARRY_NEW1 VALUES
        SSM_ID,
        ROLLDOWN,
        OAS,
        carry,
        finance_rate,
        price_drop,
        heldby_pco_sw,
        rolldown_bk1,
        rolldown_bk2,
        r_srm_flag,
        o_srm_flag,
        c_srm_flag,
        F_SRM_FLAG,
        rolldown_method
    INTO RD_FINANCE_NEW1 VALUES
        SSM_ID,
        ROLLDOWN,
        OAS,
        carry,
        finance_rate,
        price_drop,
        heldby_pco_sw,
        rolldown_bk1,
        rolldown_bk2,
        r_srm_flag,
        o_srm_flag,
        c_srm_flag,
        F_SRM_FLAG,
        rolldown_method
    INTO PCO_OWN.RD_ROLLDOWN_NEW1 VALUES
        SSM_ID,
        ROLLDOWN,
        OAS,
        carry,
        finance_rate,
        price_drop,
        heldby_pco_sw,
        rolldown_bk1,
        rolldown_bk2,
        r_srm_flag,
        o_srm_flag,
        c_srm_flag,
        F_SRM_FLAG,
        rolldown_method
    SELECT s.ssm_id,
      NVL(srm.rolldown,0) AS rolldown,
      v_zero              AS oas,
      v_zero              AS carry,
      v_zero              AS finance_rate,
      v_zero              AS price_drop,
      sw.heldby_pco_sw,
      v_zero            AS rolldown_bk1,
      v_zero            AS rolldown_bk2,
      'Y              ' AS r_srm_flag,
      'Y              ' AS o_srm_flag,
      'Y              ' AS c_srm_flag,
      'Y              ' AS f_srm_flag,
      'SRM'             AS rolldown_method
    FROM sec_tab_sdb s,
      sr_measures srm,
      sec_sw sw
    WHERE s.ssm_id = srm.ssm_id
    AND s.ssm_id   = sw.ssm_id;

  • Package for multiple inserts

    I have a development question for someone. First off, I am not a developer but can get my head around most things. Here is the potential scenario -
    If I have a schema that has a header table with primary key and date and detail table with foreign key (which is header primary key) and another sequence (which is also unique for each row of the detail table) making up the composite primary key. I want to create a form that will give a list of items with quantity and then insert the items into the detail table, one by one so that I can write a report that will put all the items under header no 00001 on the same report ( as an example below). So ideally what I want is
    Header Table
    Header_no Date
    00001 31/09/10
    Detail Table
    Header_no Detail_no Item_no Quantity
    00001 0000001 4 3
    00001 0000002 5 2
    00001 0000003 7 10
    What is the best way of doing this i.e. should I create a trigger that calls a package which will iterate an insert (and replace the changing values for Detail_no,Item_no and Quantity for the same Header_no) for each entry in the list until all entries are exhausted? I am assuming that is possible and not too difficult to do.
    Alternatively, I could have a table with very long rows and then have every item in my list as a column. This will create a lot of null values as a negative but will only require a single entry for each request and so I could do away with Header table. Not really in favor of this choice.
    I prefer the first option but am not sure if it is doable, although should be, and it will have less redundancy. Any advice is welcome. Thanks in advance.
    P.S. not sure if the format will come out as I want it to for the tables
    Edited by: user8025501 on Sep 27, 2010 12:57 PM

    I have another question. I want to print information from a report generated by some PL/SQL code to a page, what is the best way of doing this in Apex?

  • How to use the same script for multiple buttons

    Hi,
    I've only just started using flash so any help would be great!
    I'm creating a blockbusters type game, I have a grid of 20 buttons and I need  them (individually) to turn blue on click and red on double click. I've managed to do it with the first one using this code;
    var clicked:Boolean = false;
    bn1.addEventListener(MouseEvent.CLICK, bn1click);
    function bn1click(event:MouseEvent):void {
        clicked = true;
        var newColorTransform:ColorTransform = bn1.transform.colorTransform;
        if(clicked){
        newColorTransform.color = 0x064258;
        bn1.transform.colorTransform = newColorTransform;
    bn1.doubleClickEnabled = true;
    var doubleclicked:Boolean = false;
    bn1.addEventListener(MouseEvent.DOUBLE_CLICK, bn1dclick);
    function bn1dclick(event:MouseEvent):void {
        doubleclicked = true;
        var newColorTransform:ColorTransform = bn1.transform.colorTransform;
        if(clicked){
        newColorTransform.color = 0xac1e23;
        bn1.transform.colorTransform = newColorTransform;
    Now I'm having trouble getting the same to work for the rest of the buttons, they are each named bn2, bn3 etc. They need to work individually and remain blue/red once clicked. I've tried listing them as addEventListener commands but not having a great deal of success!
    Any help would be greatly appreciated, thanks!
    Tomo

    One way to do this is to use arrays to keep track of the buttons and their properties.
    var buttonList:Array = new Array(bn1,bn2,bn3);
    var clickedList:Array = new Array();
    var doubleClickedList:Array = new Array();
    //then use a for loop to assign the functions and properties for each button:
    var thisMany:int = buttonList.length; // this will give you the number of items in the buttonList array
    for(var i:int = 0; i<thisMany; i++) {
         buttonList[i].addEventListener(MouseEvent.CLICK,btnClick); // assign the click function to each button
         buttonList[i].addEventListener(MouseEvent.DOUBLE_CLICK,btnDClick); // assign the double click function
         clickedList.push(false);  // add a false value for each button to this array
         doubleClickedList.push(false);
               buttonList[i].doubleClickEnabled = true; // set the double click property for each button
    function btnClick(event:MouseEvent):void {
              var thisButton:int = buttonList.indexOf(event.target);  // figure out which button was clicked as an item in the array
              clickedList[thisButton] = true;  // change the value in the array
               var newColorTransform:ColorTransform = buttonList[thisButton].transform.colorTransform;
        if(clickedList[thisButton]){
        newColorTransform.color = 0x064258;
        buttonList[thisButton].transform.colorTransform = newColorTransform;
    function btnDClick(event:MouseEvent):void {
              var thisButton:int = buttonList.indexOf(event.target);
              doubleClickedList[thisButton] = true;
        var newColorTransform:ColorTransform = buttonList[thisButton].transform.colorTransform;
        if(doubleClickedList[thisButton]){
        newColorTransform.color = 0xac1e23;
        buttonList[thisButton].transform.colorTransform = newColorTransform;
    Now you can have any number of buttons, just add their instance names to the array at the top.

Maybe you are looking for

  • Questions on sending audio tracks from a short film into Audition for mastering

    Ok so basically I have a 4 minute film in which i need to master the audio. I have a few quesions as to how to best go about this. 1: Some of the clips came with 2 tracks off the camera yet they are both labeled channel 1 on the beginning of the clip

  • Watch the MacBook Pro Boot Up!

    For those of us still waiting for it, lets embrace the boot up process and imagine that its us who are booting up the MacBook Pro. Unfortunetely this is from the same idiot who tested the MagSafe on it by dropping the MacBook Pro. http://mobilitytoda

  • Patterns Question

    Hey everyone, got a question regarding patterns in Illustrator and this one is sorta bugging me. Basically, I have a single object, a 3 leaf clover. When I import this object into the swatch pallet, it can make a pattern...yet it is more of a x and y

  • How to make the wdDoIniiit() function executived twice in the view of WebDy

    Hi Guyes, How can i make the  wdDoIniiit() function executived twice in the view of WebDynpro? Thank you

  • Need to put 2 managers on Manager attributes field.

    Hello, Need to fill two manager name on users attribute (manager attribute) on windows server 2012 active directory. Please help... Thanks & Regards Anil