Create sequence numbers when importing data

Hi I am looking at inserting some data into a table that already has data in.
I have a 2 sequence numbers that I need to include in the statement. The First (RSC_RDSS) needs to be pulled from another table SRS_RDS field RDS_SEQ2 where the RDS_SCJC is the same on both records. The second RSC_SEQN needs to increment by 1 from any existing records.
I currently have a basic script:
INSERT INTO SRS_RSC (RSC_SCJC, RSC_FTIT, RSC_RDSS, RSC_SEQN, RSC_BEGD, RSC_ENDD, RSC_NOTE)
VALUES ('0848633/2','ELC100/10: Academic Grammar','1','50',to_date('04-Apr-11'),to_date('04-Apr-11'),'Test heading');
How can I get the RSC_RDSS from another table and how can I get the RSC_RDSS to look at what is in the table in terms of how many records for that person (RSC_SCJC) and increment by one?
Many thanks in advance.
Jonathan

Sorry one more question my script is now below and will work for the one record specified '0848633/2':
INSERT INTO SRS_RSC (RSC_SCJC, RSC_FTIT, RSC_RDSS, RSC_SEQN, RSC_BEGD, RSC_ENDD, RSC_NOTE)
select
'0848633/2' as RSC_SCJC,
'ELC100/10: Academic Grammar' AS RSC_FTIT,
(select max(RSC_RDSS) from SRS_RSC where RSC_SCJC ='0848633/2') as RSC_RDSS,
(select max(RSC_SEQN)+1 as RSC_SEQN from SRS_RSC) as RSC_SEQN,
to_date('04-Apr-11') RSC_BEGD,
to_date('04-Apr-11') RSC_ENDD,
'Test heading' RSC_NOTE
from dual;
I plan to import a few records and need to get the RSC_SCJC used in line 5:
(select max(RSC_RDSS) from SRS_RSC where RSC_SCJC ='0848633/2') as RSC_RDSS,
From the first field RSC_SCJC. Its currently hard coded but I need to pull it in from the first line of teh insert query.
I hope that makes sense and again thanks in advance.
Jonathan

Similar Messages

  • Performance issue with FDM when importing data

    In the FDM Web console, a performance issue has been detected when importing data (.txt)
    In less than 10 seconds the ".txt" and the ".log" files are created the INBOX folder (the ".txt" file) and in the OUTBOX\Logs (the ".log" file).
    At that moment, system shows the message "Processing, please wait” during 10 minutes. Eventually the information is displayed, however if we want to see the second page, we have to wait more than 20 seconds.
    It seems a performance issue when system tries to show the imported data in the web page.
    It has been also noted that when a user tries to import a txt file directly clicking on the tab "Select File From Inbox", the user has to also wait other 10 minutes before the information is displayed on the web page.
    Thx in advance!
    Cheers
    Matteo

    Hi Matteo
    How much data is being imported / displayed when users are interacting with the system.
    There is a report that may help you to analyse this but unfortunately I cannot remember what it is called and don't have access to a system to check. I do remember that it breaks down the import process into stages showing how long it takes to process each mapping step and the overall time.
    I suspect that what you are seeing is normal behaviour but that isn't to say that performance improvements are not possible.
    The copying of files is the first part of the import process before FDM then starts the import so that will be quick. The processing is then the time taken to import the records, process the mapping and write to the tables. If users are clicking 'Select file from Inbox' then they are re-importing so it will take just as long as it would for you to import it, they are not just asking to retrieve previously imported data.
    Hope this helps
    Stuart

  • Error message when importing data using Import and export wizard

    Getting below error message when importing data using IMPORT and EXPORT WIZARD
    Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    <dir>
    <dir>
    Messages
    Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "Could not allocate a new page for database REPORTING' because of insufficient disk space in filegroup 'PRIMARY'.
    Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.".
    (SQL Server Import and Export Wizard)
    Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "Destination - Buyer_.Inputs[Destination Input]" failed because error code 0xC020907B occurred, and the error row disposition on "Destination
    - Buyer_First_Qtr.Inputs[Destination Input]" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
    (SQL Server Import and Export Wizard)
    Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "Destination - Buyer" (28) failed with error code 0xC0209029 while processing input "Destination Input" (41). The
    identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information
    about the failure.
    (SQL Server Import and Export Wizard)
    Error 0xc02020c4: Data Flow Task 1: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.
    (SQL Server Import and Export Wizard)
    </dir>
    </dir>
    Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on Source - Buyer_First_Qtr returned error code 0xC02020C4.  The component returned a failure code when the pipeline engine called PrimeOutput().
    The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
    (SQL Server Import and Export Wizard)
    Smash126

    Hi Smash126,
    Based on the error message” Could not allocate a new page for database REPORTING' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting
    autogrowth on for existing files in the filegroup”, we can know that the issue is caused by the there is no sufficient disk space in filegroup 'PRIMARY' for the ‘REPORTING’ database.
    To fix this issue, we can add additional files to the filegroup by add a new file to the PRIMARY filegroup on Files page, or setting Autogrowth on for existing files in the filegroup to increase the necessary space.
    The following document about Add Data or Log Files to a Database is for your reference:
    http://msdn.microsoft.com/en-us/library/ms189253.aspx
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • ORA-00926: missing VALUES keyword | when importing data

    Hello,
    I get the missing VALUES keyword error when importing data from an Excel spreadsheet. Until yesterday everything worked fine. Today I'm having this problem because OSD does not build the DML correctly. See:
    insert into WFT_GROEPEN (CODE,OMSCHRIJVING,NIVEAU,INDIC_LAAGSTE_NIVEAU) VALUES('1.1.1.1','- Value of business acquired',4,'N');
    Working with OSD 1.2.1 on Windows XP.
    Anyone got a clue?
    Kind regards,
    Dennis

    Hi,
    Thanks for your reply. I found the problem myself. I got 2 columns in the Excel sheet with the same name. Then OSD creates an insert statement like following which gives the 'missing VALUES keyword' error.
    insert into WFT_GROEPEN (CODE,OMSCHRIJVING,NIVEAU,INDIC_LAAGSTE_NIVEAU)NIVEAU) VALUES('3','Toelichting balans beleggingen',NULL,'N',NULL);
    Regards,
    Dennis

  • Error when importing data using DTW template

    Dear All gurus/experts,
    I have a problem when importing data into SBO system using DTW. The error message is "sort error, pls check the prepared data and delimeter. I use SBO 2004 SP 00 PL 41. I don't understand to cope with this problem, I have no idea anymore. I appreciate your answer. TIA
    Rgds,

    Tks for your reply. I have seen it and the error message relates to delimeter. I have tried to correct the error by recreate the file and save as tab delimeted. Right now I am trying to import the files.
    Rgds,

  • Error occured when importing data from dmp

    Hello friends
    when i am importing data from dmp file
    the following error occured
    Please help me to solve this
    Error message :
    Export file created by EXPORT:V09.02.00 via conventional path
    import done in WE8PC850 character set and AL16UTF16 NCHAR character set
    export client uses US7ASCII character set (possible charset conversion)
    Import terminated successfully without warnings.

    This is not really an error message but a information about possible character conversion from US7ASCII to WE8PC850 which should NOT be an issue since all US7ASCII characters are in most WExxx character sets.
    Message was edited by:
    Pierre Forstmann

  • Need help when importing data

    Hi All,
    When iam importing data into excel, leading zero's are truncating.
    Eg: I have a column orgid in a table. Data is like 00067509,056429...
    When importing into excel, leading zeros are truncated and orgid data shown in excel as 67509,56429...
    Please help to get zero's in excel.

    you did not post info how you create the data to be available for excel. it is important to us that you also describe how you create the data. i will assume that you create the text file on oracle and i'll try to give an example as a workaround that might work to you. we create a .csv file that can be opened to excel and each of the column is enclosed by double quotes and separated by comma. the column whose values had leading zeroes we added an equal sign before enclosing them to a double quotes (e.g. ="000123456") this way when it is opened on excel it preserves the leading zeroes.
    .

  • How to show NULL value when import data into excel

    when retrieve data from sql server and import these data into excel.
    data source  is like : select a ,b c from tab
    if a,b,c is nullable. when import these NULL value into excel, it becomes blank value, there is nothing in the excel cell.
    if i don't want to use select isnull(a,'NULL') as a to convert the values.
    what's else can i do to make it? is there a way to prevent changing the NULL to blank ?
    or is there an easy solution to replace all the blank value to NULL in the excel ?

    help me ~

  • The SQL statement is not valid - when importing data from SQL Server using a query

    Hi there,
    I am trying to import data from SQL to Power Pivot using a SQL query like below:
    SELECT Score.FieldCount, Score.Record.GetAt(0), Score.Record.GetAt(1),  Score.Record.GetAt(2),  Score.Record.GetAt(3),  Score.Record.GetAt(4)
    FROM 
    SELECT * FROM dbo.CLR1(
    dbo.CLR2('c:\FILES\Test.xml'), 
    'SELECT * FROM [dbo].[CXCustomer_Small]') Input
    ) Score
    And when I tried to validate it, it returns
    The SQL statement is not valid. A column name cannot be blank.
    I ran the above SQL statement in Management Studio and it works without problem. Any idea?
    Thanks!
    Chu
    -- Predict everything. http://www.predixionsoftware.com

    Never mind, I figured out - I need to give each column a name.
    -- Predict everything. http://www.predixionsoftware.com

  • Data with "," overflows to the next field when importing data with DTW

    Dear all,
    When I tried to import data with DTW, for the data that includes ",", the data after "," all jumps into the next field after import.
    E.g. Column A(memo): bank, United state
           Column B(project code): blank
           Result in SBO: Memo field : bank
                                  Project code: United state
    I  have tried 2 ways.
    1. Save the file as csv, and adding double quote(") at the beginning and ending of the data. However, it didn't work. It didn't work with single quote as well.
    2. Save the file as txt, without amending the data at all.
    It worked, however, in SBO, double quote is auto added, it becomes "bank, United state".
    Please kindly advise how to handle such case.
    Thank you.
    Regards,
    Julie

    Hi,
    Check this if it is useful :
    Upload of BP Data using DTW
    Rgds,
    Jitin

  • Numbers '08 importing data and merging data from address book .....

    HI all,
    This is the time of year we have to tot-up all of our kilometers travelled to clients which is a real headache.
    I am really keen to get this automated somehow and would be very grateful for some help.
    Here are the details:
    We use the address book app as our client database which includes name, address and kilometers from our base.
    We have an accounting appcilation which lists all invoices by name, includes a date and I could also input the km in here if needed.
    I would like to create a spread sheet in numbers that will contain a list of all clients invoiced and the kms traveled to their place from our base.
    I can get the client list by getting our accounting software to output the data in CSV format, then input the data into numbers, however, I have a couple of queeries regarding the kms values and the import process ....
    (a) firstly, I used to use in excel a very useful function of importing text from text edit, where I was able to choose what delimited a field, spaces, commas, even just width, does this also exist in Numbers? I have looked with no you.
    (b) next the kms values, is there any automated way to match the client names in my excel sheet and pull in the kms values from the address book field?
    If not, they could be inputed into my accounting software each time I enter a record, it just means a bit more work for me on a daily basis.
    Many thanks in advance for your thoughts on this. I'm sure there is a clever way of getting round this somehow ....

    rmeynie wrote:
    (a) firstly, I used to use in excel a very useful function of importing text from text edit, where I was able to choose what delimited a field, spaces, commas, even just width, does this also exist in Numbers? I have looked with no you.
    Feature unavailable in Numbers '09 too
    (b) next the kms values, is there any automated way to match the client names in my excel sheet and pull in the kms values from the address book field?
    Feature unavailable in Numbers '09 too
    Numbers have no provision to communicate with other applications.
    With Numbers '09, we may fit the gap with AppleScript but there is no AppleScript support in Numbers '08.
    Yvan KOENIG (VALLAURIS, France) samedi 9 avril 2011 09:46:20

  • How to disabled all constraints when importing data (urgent)

    Hi,
    I am running import on my database. It’s dump file size 40GB & I forget to set import parameter constraint=N. due to that import is very slow.
    Could any body help me out.
    Thanks,
    AT

    Hi,
    >>due to that import is very slow
    I'm not sure whether this is the "source" of low performance, because just in the end of the process that integrity constraints are enabled.
    1) New tables are created. (Type definitions, Table definitions)
    2) Data is imported. (Table data)
    3) Indexes are built. (Table indexes)
    4) Triggers are imported. (integrity constraints, views, procedures, and triggers)
    5) Integrity constraints are enabled on the new tables.
    6) Any bitmap, functional, and/or domain indexes are built.
    Cheers
    Legatti

  • APEX Sequence number when passing data from different instances

    Hello there,
    I have a question for you guys.
    I have an application sitting in my Production area, and the one in test needs to be up-to-date (the data). So I grab the excel file, truncate the table in my test area and load the table from prod into the one in TEST.
    The problem with this is that when I tried to insert a record to the table it gave me the unique constrain error. Because the sequence for the table in test next number is 500 and the last number (primary key) in PROD is 10,000.
    I tried to change that number in APEX but it won't alow me to. The only thing I can change is the minimum and the maximum value.
    Can I change the min to 10,001 so it can now start fro there or what would you recommend to shance the last sequence number of the table to 10,001?
    Regards,
    Ruben Tapia

    Hi,
    Copy your sequence SQL e.g. to notepad. Drop that sequence.
    Edit SQL in notepad by changing number after START WITH to be 10001.
    Then just recreate sequence from your edited SQL =)
    Br,Jari

  • I/O error 103 encountered when importing data

    Hi all,
    I'm using DRM version 9.3.2.
    When I was trying to import some data into DRM. An 'I/O error 103' msg popped up and stopped the import process. I ever came with this same issue in some other environments (My Virtual Machine, e.g.), and after I rebooted the OS, the issue gone.
    But when I tried to reboot OS again this time, the issue is still there. Very wired isn't it? I searched the internet everywhere, no DRM related information found.
    Do you guys have any idea about this?
    Thanks in advance

    Hi
    The drag & drop is not bad bud I would recommend using the "Nero burning rom" software to burn the DVD.
    This software supports many burning options and allows you to burn the medium with best performance.
    Additional you should know that the drive doesn't support all CD or DVD from all manufacturers.
    In the user manual you will find a list of compatible and supported CD DVD manufacturers.
    But please don't be confused about the unknown names like i.e Mitsubishi.
    These are the manufacturers and not vendors like TDK. Don't mix manufacturer and vendor!
    best regards

  • Getting an error when importing data from legacy to temptables

    SQL*Loader: Release 10.1.0.2.0 - Production on Mon Feb 18 00:27:53 2008
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Control File: C:\Documents and Settings\rocky\Desktop\tempctrl2..CTL
    Data File: C:\Documents and Settings\rocky\Desktop\EMP_DATA.txt
    Bad File: C:\Documents and Settings\rocky\Desktop\EMP_DATA.bad
    Discard File: C:\Documents and Settings\rocky\Desktop\EMP_DATA.dsc
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array: 64 rows, maximum of 256000 bytes
    Continuation: none specified
    Path used: Conventional
    Table "SCOTT"."TEMPTABLE2", loaded from every logical record.
    Insert option in effect for this table: APPEND
    Column Name Position Len Term Encl Datatype
    EMPNO FIRST * , CHARACTER
    ENAME NEXT * , CHARACTER
    JOB NEXT * , CHARACTER
    MGR NEXT * , CHARACTER
    HIREDATE NEXT * , CHARACTER
    SAL NEXT * , CHARACTER
    COMM NEXT * , CHARACTER
    DEPTNO NEXT * , CHARACTER
    Record 1: Rejected - Error on table "SCOTT"."TEMPTABLE2", column EMPNO.
    ORA-01722: invalid number
    Record 2: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 3: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 4: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 5: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 6: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 7: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 8: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 9: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 10: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 11: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 12: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 13: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 14: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Record 15: Rejected - Error on table "SCOTT"."TEMPTABLE2", column HIREDATE.
    ORA-01843: not a valid month
    Table "SCOTT"."TEMPTABLE2":
    0 Rows successfully loaded.
    15 Rows not loaded due to data errors.
    0 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Space allocated for bind array: 132096 bytes(64 rows)
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 15
    Total logical records rejected: 15
    Total logical records discarded: 0
    Run began on Mon Feb 18 00:27:53 2008
    Run ended on Mon Feb 18 00:27:53 2008
    Elapsed time was: 00:00:00.22
    CPU time was: 00:00:00.01
    can anyone help me with this please
    Thankx & Regards
    krish

    Hi,
    HireDate Column int he table SCOTT"."TEMPTABLE2 is date. The data you are trying to insert is not in the Default Date format. Hence it could be the reason.
    Please provide TEMPTABLE2 Column Structure and the sample data for more details,
    Regards
    RK

Maybe you are looking for