Insert record incrementing date - low cost

Hi,
I have following record structure
PLAN_LEVEL     PERIOD_NUM     DAYS     OPERATIONSEQ     GROUP_ID     ALLOY     PLANNER_CODE     DEPARTMENT_CLASS     DEPARTMENT     LOAD_HOUR     OFFSET_DATE     OFFSET
0     1     20     150     525150     INCONEL alloy 625     WIRE ROD     CD     WP     8.45402793     3/19/2007     14
0     1     20     140     525150     INCONEL alloy 625     WIRE ROD     CD     BA     4.586287974     3/17/2007     30
0     1     20     90     525150     INCONEL alloy 625     WIRE ROD     MM     MW2     0.750050215     3/12/2007     51
0     1     20     70     525150     INCONEL alloy 625     WIRE ROD     MM     M2M     0.027779638     3/12/2007     72
1     1     20     160     525150     INCONEL alloy 625     WIRE ROD     PMD     DPP     1.453799581     3/4/2007     101
1     1     20     140     525150     INCONEL alloy 625     WIRE ROD     CHP     CHP     0.97472359     3/2/2007     132
1     1     20     130     525150     INCONEL alloy 625     WIRE ROD     CHP     SG     4.873617025     2/25/2007     168
1     1     20     120     525150     INCONEL alloy 625     WIRE ROD     CHP     CHP     1.091515669     2/24/2007     205
1     1     20     110     525150     INCONEL alloy 625     WIRE ROD     PMD     PM     0.210131401     2/24/2007     242
1     1     20     90     525150     INCONEL alloy 625     WIRE ROD     PMD     PM     0.262927179     2/18/2007     285
1     1     20     60     525150     INCONEL alloy 625     WIRE ROD     B30     ESR     15.18807308     2/15/2007     331
1     1     20     20     525150     INCONEL alloy 625     WIRE ROD     VIM     VIM     2.191847409     2/12/2007     380there is days column in the table i just need to replicate/insert above data into same table incrementing offset_date.
e.g.
as days value is 20 i have to insert above record group 20 times and increment offset_date by 1 every time so...
for I 1..days here is 20
insert table
offset_date+1 for each record value in this case 12 recordso total insert for this record group will be 12*20 and for each data set it should increase offset_date+1
is there any low cost ( good performance )solution than looping through it.
thanks in advance

May be better:
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as SYS
SQL>
SQL> drop table t;
Table dropped
SQL> create table t(i number, d1 date, offset number);
Table created
SQL> insert into t values(1, sysdate - 37, 3 );
1 row inserted
SQL> insert into t values(2, sysdate - 34, 7 );
1 row inserted
SQL> select * from t;
         I D1              OFFSET
         1 26.12.2006           3
         2 29.12.2006           7
SQL> SELECT t.i, t.d1 + t2.i - 1, t.offset
  2    FROM t
  3        ,(SELECT rownum i
  4            FROM dual
  5          CONNECT BY LEVEL <= (SELECT MAX(offset) FROM t)) t2
  6   WHERE t.offset + 1 >= t2.i
  7   ORDER BY t.i, t.d1 + t2.i - 1;
         I T.D1+T2.I-1     OFFSET
         1 26.12.2006           3
         1 27.12.2006           3
         1 28.12.2006           3
         1 29.12.2006           3
         2 29.12.2006           7
         2 30.12.2006           7
         2 31.12.2006           7
         2 01.01.2007           7
         2 02.01.2007           7
         2 03.01.2007           7
         2 04.01.2007           7
11 rows selected
SQL> drop table t_temp;
drop table t_temp
ORA-00942: table or view does not exist
SQL> CREATE TABLE t_temp AS
  2    SELECT t.i, t.d1 + t2.i - 1 d1, t.offset
  3      FROM t
  4          ,(SELECT rownum i
  5              FROM dual
  6            CONNECT BY LEVEL <= (SELECT MAX(offset) FROM t)) t2
  7     WHERE t.offset + 1 >= t2.i;
Table created
SQL> SELECT * FROM t_temp;
         I D1              OFFSET
         1 26.12.2006           3
         2 29.12.2006           7
         1 27.12.2006           3
         2 30.12.2006           7
         1 28.12.2006           3
         2 31.12.2006           7
         1 29.12.2006           3
         2 01.01.2007           7
         2 02.01.2007           7
         2 03.01.2007           7
         2 04.01.2007           7
11 rows selected
SQL>

Similar Messages

  • Insert record wizard date format

    Hi,
    How can i change the default insert from mm/dd/yyyy to uk format dd/mm/yyyy
    currently if i insert 08/05/2010 which is the 8th may 2010 in uk it will put it into database as 2010/08/05 which when i retrieve is the 5th august 2010 in uk.
    is there a config folder anywhere i can change this?
    many thanks

    thanks bregent.
    it is php/mysql
    not sure what that other reply is about after yours but thanks for your advice.
    is there no way in dreamweaver to change the preferences like in addt to a specific date format?
    thanks
    Date: Wed, 19 May 2010 12:25:47 -0600
    From: [email protected]
    To:
    Subject: Dreamweaver Application Development Insert record wizard date format
    You didn't mention what DBMS or scripting language you are using.
    The best way to get dates from a user is to supply 3 fields for input; day, month, year - then assemble them into the string format that the DBMS is expecting.
    >

  • Insert record via data tab of table detail display

    I am using SQL Developer 3.0.04
    When I tries to insert more than 200 rows into a table via data tab of table detail display, it takes more than 8 minutes. It takes more than 19 minutes for 400+ rows. It is slow and it is not so slow in previous version (e.g. 1.5.4)
    Had anyone experienced the same issue and is there any workaround (other than loading data via SQL loader and stop using SQL Developer)?
    [Timer of SQL Developer 3.0| http://i.imgur.com/KVAdI.png]

    I've seen this also sometimes but i rarely load large amount of data using SQLDeveloper anyway.
    Please make sure you have patch1 installed and provide information on the database used.
    You can check if patch1 is installed at the
    Help -> About -> Extensionyou should find a "SQL Developer Patch" entry there.

  • Add date stamp to insert record

    This should be easy. I would think it's a standard procedure but 5 hours of searching the net, the forums, and experimenting has left me with a loss.
    I've created a simple form with 3 fields, firstName, lastName, eMail
    I've created a SQL database and table with the fields id, date, firstName, LastName, eMail
    The id is an int and the primary key, date is set to datetime the rest are varchar
    I've created a successful Insert Record behavior and now all I want to do is to update the date field with the datetime value when the record is added.
    Things I've tried include a java script to create a date variable, SQL NOW in various forms, a ton of other complex solutions. I've added hidden fields to the form, which got me the closest when I manually entered a value in the same format that I see in the SQL table when I add a row to the table from the PHP admin page.
    Please tell me this is not going to require 30 lines of code and another half day of fussing around.

    Hi Rick,
    Please tell me this is not going to require 30 lines of code and another half day of fussing around.
    with ADDT it´s pretty easy: just make sure that your datetime column gets ADDT´s "datetime" placeholder {NOW_DT} inserted as "entered value":
    Open the Insert Record Transaction dialog box, select the date column and define these settings:
    - Submit as: Date
    - Get value from: Entered Value
    - Value: {NOW_DT}
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Low-Cost data migration and ETL tools

    Hi, Im building a database for my company. We are a rather small size book company with a lot of references and still growing.
    We have a Mysql database here and are trying to find some good tools to use it at its best. Basically we are just starting up the database after dealing with Excel: we had a size problemu2026 So im trying to find a program that will allow us to do two different things: the migration of our data from the old system to the new one and a specialized software to perform ETL (Extract, transform and load) on our database.
    About the price of the tools, if we were one year ago, the accounting department would have been pretty relaxed about this. But today, we have some budget restrictions and therefore need a low cost tool. So could you give me some advice on a good data migration and etl tool for a low cost?
    Thanks for your help.

    Hi,
    Some companies have budget problems and are having to reduce their cost of operation.
    Have you ever heard of open source tools? They can do the job easily and less expensive than proprietary solutions that cost a lot of money.
    You can have a look at a good ETL open source program called Talend Open Studio: it is user-friendly but also has advanced features intended for technical users (java debugger, code injectionu2026). It can perform data migration and ETL as you wrote in your first post.
    The website is [here|http://www.talend.com/solutions-data-integration/data-migration.php] to download the open source program. They have a forum and documentation you can read. Tell us what you think about the software.
    For an ETL benchmark: [ETL Benchmark|http://blogs.sun.com/aja/entry/talend_s_new_data_processing]

  • Insert Record and Redirect Data

    I have a website where we are adding articles to categories.
    I need to be able to have a user add an article and then have the
    option to add that same article into another category.
    I'm using the INSERT RECORD behavior now but I'm looking for
    an extension that will INSERT RECORD plus redirect the record/data
    to another page so the user can add it to another category.

    I found this in the upload scripts read me file:
    The clsUpload object contains public functions and methods
    which enable you to upload and save files to a web server using
    pure VBScript.
    Read only
    Data Type: Dictionary Collection
    Syntax: object.Form
    Returns a Forms collection consisting of all the Form objects
    parsed from the HTTP header.
    This collection contains all the HTML form elements which are
    not "Files"
    This collection should be used instead of the typical
    "request.form" method to access data from the other form elements
    (if you decide to combine "file" upload elements with other form
    element types, like checkboxes, text boxes, drop-down lists,
    textareas). Why? Because the form data is posted using
    "multipart/form-data" encoding (and needs to be retrieved like
    binary data instead of text data) and therefore the typical
    "request.form" method isn't effective.
    I changed request.form to clsUpload.form but it still did not
    work.

  • How to Insert record in IT0014 along with cost Assignment details - FM Pls.

    Hi,
    I want to insert record in info type 0014 along with Cost Assigment details.
    I used FM - HR_INFOTYPE_OPERATION and RP_PLANT_DATA_UPDATE_TABLES.
    It works fine, but if I go and check PA20 after execution of program, ICON (Cost Assignment details) is not showing up on screen PA20. But If I check cost assignment tables (ASSOB & ASSHR) the record is present.
    Please let me know how to insert record in IT0014 along with Cost Assignment details.
    Thanks in Advance,
    Krishna

    Hi,
    I want to insert record in info type 0014 along with Cost Assigment details.
    I used FM - HR_INFOTYPE_OPERATION and RP_PLANT_DATA_UPDATE_TABLES.
    It works fine, but if I go and check PA20 after execution of program, ICON (Cost Assignment details) is not showing up on screen PA20. But If I check cost assignment tables (ASSOB & ASSHR) the record is present.
    Please let me know how to insert record in IT0014 along with Cost Assignment details.
    Thanks in Advance,
    Krishna

  • I need an app or software that records the date/time each time a write something and press enter. This needs to be quick so I can continue writing right after I press enter, and the date/time is inserted for each word. Does this sort of software exist?

    I need an app or software that records the date/time each time a write something and press enter. This needs to be quick so I can continue writing right after I press enter, and the date/time is inserted for each word. Imagine a spreadsheet - each time a write something in a cell and press enter to go into the next cell, I need the app/software to automatically insert the corresponding dat and time. Does this sort of software exist?

    No one here is going to do anything about it. Send feedback to Apple.
    http://www.apple.com/feedback/ipad.html
    Basic troubleshooting steps. 
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 

  • Insert new Master Data Record for an InfoObject using a Function Module

    Hi @ all,
    is there any Function Module for creating a new master data record for an InfoObject? Implementing a FM for inserting a master data record into a master data table is done quickly. I think there will be problems with inconsistency implementing a FM using a simple "Insert" Statement. Isn´t it?
    I know it is possible to maintain an InfoObject in RSA1 (Master data IO> right click>Maintain Master data>execute(F8)> ...) but I have another requirement for using a FM.
    Thanks!
    Regards,
    Johannes

    use this
    RSNDI_MD_ATTRIBUTES_UPDATE

  • MySQL Insert Record

    I have a database for an operational application & I am trying to build some simple insert pages to insert records into the database.
    I have constructed the insert forms, yet when I try to inserta  record, the primary key is not automatically applying to the record, as is an auto-number that should apply to another field? yet the data is populatin within the table? I am assuming that the database would apply this automatically as it does in the application??
    what am i missing?
    Thanks
    Pete

    Hi
    Thanks for the response.
    I have edited the insert statement to take these fields out, however when I insert a record it does go into the database, but again the primary key & the autonumber do not increment?
    If i try to enter another record i get
    Duplicate entry '' for key 'PRIMARY'
    Thanks
    Pete

  • Most recently inserted record

    how can i get most recently inserted record?
    note: there is no date columns.

    It's possible, but not probable (given how your table is likely created).
    TUBBY_ORCL?create table not_likely
      2  (
      3    column1 number
      4  )
      5  rowdependencies;
    Table created.
    Elapsed: 00:00:00.01
    TUBBY_ORCL?
    TUBBY_ORCL?begin
      2    for i in 1 .. 100
      3    loop
      4      insert into not_likely values (i);
      5      commit;
      6    end loop;
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.03
    TUBBY_ORCL?
    TUBBY_ORCL?select *
      2  from not_likely
      3  where ORA_ROWSCN =
      4  (
      5    select
      6      max(ORA_ROWSCN)
      7    from not_likely
      8  );
               COLUMN1
                   100
    1 row selected.
    Elapsed: 00:00:00.01Uses the pseudo column ORA_ROWSCN which increments with each commit performed against the table (as i've enabled row dependencies, otherwise it would track at the block level).
    Assuming you don't have row dependencies enabled on your table, you could consider using flashback query if you know roughly when you are trying to compare to.
    All in all ... if you need to do this for part of the application design, then you need to do more design work on the structures at hand.

  • Continuously Recording Thermocouple Data to Report

    Hello,
    I am trying to cotinously record thermocouple data and generate an Excel report using the Report Generation tool box. The problem I am having is currently I am only able to capture the final data upon clicking the stop botton. How can I continously collect every data point and insert them into the
    table?
    I am using Labview 2011 (but I have 2010 still installed if that is a problem) on XP and I am aquiring the data using a NI 9211.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    Thermocouple Logger 1.1.0.vi ‏174 KB

    The shift registers are good design, but I think the core issue is writing to the same Start pos. It needs to be incremented like this.
    Edit: To the Left, that blue wire is comming from the iteration terminal of the loop.
    Richard

  • Insert old missing data from one table to another(databaase trigger)

    Hello,
    i want to do two things
    1)I want to insert old missing data from one table to another through a database trigger but it can't be executed that way i don't know what should i do in case of replacing old data in table_1 into table_2
    2)what should i use :NEW. OR :OLD. instead.
    3) what should i do if i have records exising between the two dates
    i want to surpress the existing records.
    the following code is what i have but no effect occured.
    CREATE OR REPLACE TRIGGER ATTENDANCEE_FOLLOWS
    AFTER INSERT ON ACCESSLOG
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    V_COUNT       NUMBER(2);
    V_TIME_OUT    DATE;
    V_DATE_IN     DATE;
    V_DATE_OUT    DATE;
    V_TIME_IN     DATE;
    V_ATT_FLAG    VARCHAR2(3);
    V_EMP_ID      NUMBER(11);
    CURSOR EMP_FOLLOWS IS
    SELECT   EMPLOYEEID , LOGDATE , LOGTIME , INOUT
    FROM     ACCESSLOG
    WHERE    LOGDATE
    BETWEEN  TO_DATE('18/12/2008','dd/mm/rrrr') 
    AND      TO_DATE('19/12/2008','dd/mm/rrrr');
    BEGIN
    FOR EMP IN EMP_FOLLOWS LOOP
    SELECT COUNT(*)
    INTO  V_COUNT
    FROM  EMP_ATTENDANCEE
    WHERE EMP_ID    =  EMP.EMPLOYEEID
    AND    DATE_IN   =  EMP.LOGDATE
    AND    ATT_FLAG = 'I';
    IF V_COUNT = 0  THEN
    INSERT INTO EMP_ATTENDANCEE (EMP_ID, DATE_IN ,DATE_OUT
                                ,TIME_IN ,TIME_OUT,ATT_FLAG)
         VALUES (TO_NUMBER(TO_CHAR(:NEW.employeeid,99999)),
                 TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'),       -- DATE_IN
                 NULL,
                 TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'),      -- TIME_IN
                 NULL ,'I');
    ELSIF   V_COUNT > 0 THEN
    UPDATE  EMP_ATTENDANCEE
        SET DATE_OUT       =  TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_OUT,
            TIME_OUT       =   TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'), -- TIME_OUT
            ATT_FLAG       =   'O'
            WHERE EMP_ID   =   TO_NUMBER(TO_CHAR(:NEW.employeeid,99999))
            AND   DATE_IN <=  (SELECT MAX (DATE_IN )
                               FROM EMP_ATTENDANCEE
                               WHERE EMP_ID = TO_NUMBER(TO_CHAR(:NEW.employeeid,99999))
                               AND   DATE_OUT IS NULL
                               AND   TIME_OUT IS NULL )
    AND   DATE_OUT  IS NULL
    AND   TIME_OUT IS NULL  ;
    END IF;
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN RAISE;
    END ATTENDANCEE_FOLLOWS ;
                            Regards,
    Abdetu..

    INSERT INTO SALES_MASTER
       ( NO
       , Name
       , PINCODE )
       SELECT SALESMANNO
            , SALESMANNAME
            , PINCODE
         FROM SALESMAN_MASTER;Regards,
    Christian Balz

  • Error while inserting records in sqlLite database

    Hi all
    I am building a hybrid web app in SMP using phonegap and html.
    I am trying to insert records in sql database but i get an error with an undefined error code
    Please see below :
    function openDatabaseFoo() {
      db = window.openDatabase(clientDBName, clientDBVersion, clientDBDisplayName, clientDBMaxSize);
    function createDBTables() {
      db.transaction(function(tx) {
      // Create mine table
      var fooCreate = 'CREATE TABLE IF NOT EXISTS ' + fooTable+ ' (empNo, empName)';
      tx.executeSql(fooCreate , [],
      function (tx, resultSet) {
                //success
      var msg = 'Sucessfully created';
      alert(msg);
      logSuccessMessage(msg);
                function (err) {
                //error code
                var msg = "Error creating table = " + err.code;
                alert(msg);
                logErrorMessage(msg);
    the creation of tables is happening properly because i am getting a success message in the alerts.
    I am getting the error when i am trying to insert records in the above table
    function insertDataTable(){
    db.transaction(function(tx) {
    var insertSql = 'INSERT INTO ' + fooTable + ' (empNo, empName) VALUES ("1603","baker")';
    tx.executeSql(insertSql, [],
      function (tx, resultSet) {
                //success
      var msg = 'Sucessful insertingdata.';
      alert(msg);
      logSuccessMessage(msg);
                function (err) {
                //error code
                var msg = "Error inserting data sql = " + insertSql + " Error code = " + err.code;
                alert(msg);
                logErrorMessage(msg);
    can some one please help.Also guide me where can i check the sqlLite database logs to see more about the error.
    I would really appreciate the help.I have been onto this since past few days now
    Regards
    Shweta

    What is err.code, or the value of msg when the error occurs?
    Thanks,
    Andrew.

  • XSQL error when trying to insert record

    hi,
    I encounter a problem using INSERT statement in xsql:query action. If I try to use INSERT statement in my xsql page like this:
    <xsql:ze_action bean="TaskentryIn">
    <xsql:query>
    INSERT
    Grundtab( Datum,Startzeit,Endzeit)
    VALUES
    ('{@date}',{'@begin}','{@ende}')
    </xsql:query>
    </xsql:ze_action>
    I always get this xsql-error:
    Statement.executeQuery - No result sets were produced by 'INSERT...'
    So far so good, I think this shouldn't be an error rather a warning.
    But this is not my primary problem.
    Anyway the record is inserted in the DB. But since I call the above <xsql:query>, from within my own action handler, I call a sendRedirect() to my next page after the <xsql:query> tag was processed.
    After sendRedirect(), when I am on my next page, I check the DB for the inserted records, and it shows up that the insert was made two times, so I have two identically records in my DB.
    If I am not sendRedirect() to the next xsql page, then the insert is only made once. So I assume that there is a problem if an xsql-error occurs and afterwards a sendRedirect().
    I am using the same way to make my SELECT statements and I dont have any trouble with them. Only when I use INSERT.
    Any adive or help is appreciated.
    Peter

    <xsql:query> is only for queries.
    Use <xsql:dml> for a DML statement.

Maybe you are looking for

  • How to make more pages

    I did my first fluid layout index.html.  Do I just save that using SAVE AS and give it the name of another page such as contact.html, then save that as learning.html etc... also to make the mobile.css, tablet.css and desktop.css as the instuctions su

  • Report Generation Overwrite

    Hello! I'm having serious trouble using the Report Generation Toolkit. LabVIEW 8.6, RGT 1.1.3, Word/Excel 2007. The starting premise is that we are taking data, sending it to a waveform graph, then we want to write the picture to a file (either Word

  • HT201401 my pc only recognizes my iphone as a camera

    This is just frustrating.  I've never downloaded software because i didn't know i was supposed to LOL.  This is the first phone i've ever purchased that didn't come with a freaking huge instruction book..... 

  • Why isn't unchecked music synced to my iPhone?

    I have an iphone 4 connected to windows 7 computer. All going well until recently, last time I connected to itunes I had a warning that all my music was unchecked, so no music would sync to iphone. (This was not a change I had made.) In itunes howeve

  • Installed Mountain Lion.  Now internet not working

    Does anyone know how to get the internet working again after installing Mountain Lion? Thanks.