Sql loader ?.  CSV file need 2 load to multi tbls

I have a CSV file i.e.
3 columns on file (qy_type_cd,cd_description,tablename)
example data:
PAST,Past Program Quantity,MASTER_QY
FUT_PEACE,Future Peace Program Quantity,MASTER_QY
TM_PHAS_USE,Time Phased Users Quantity,ADDITIVE_QY
MISTR_RPR,MISTR Repair Quantity,USAGE_QY
I need to load to 3 tables. Tables have two columns (qy_type,description).
How can i read the tablename from csv file and load the qy_type_cd and cd_description INTO a table
something like this. but I dont know the syntax
into table api_mstr_qy
fields terminated by ","
when tablename ='MASTER_QY'
(qy_type,description,tablename)

First you need to create a directory that corresponds to where the csv file is located
create directory mydir as 'c:\loaddata\'
Then you need to define the metadata for the
external table:
CREATE TABLE myExternal (
qy_type_cd varchar2,
cd_description varchar2,
tablename varchar2
ORGANIZATION EXTERNAL
(DEFAULT DIRECTORY mydir
ACCESS PARAMETERS
(RECORDS DELIMITED BY NEWLINE
BADFILE 'bad_external'
LOGDILE 'log_external'
FIELDS TERMINATED BY ','
qy_type_cd char,
cd_description char,
tablename char
LOCATION (mycsv.csv))
PARALLEL 1 --PUT 2 or the amount of clustered servers you want to use for the process
REJECT LIMIT 1;
Now you are able to run selects on this table
ie: select * from myExternal will produce:
PAST,Past Program Quantity,MASTER_QY
FUT_PEACE,Future Peace Program Quantity,MASTER_QY
TM_PHAS_USE,Time Phased Users Quantity,ADDITIVE_QY
MISTR_RPR,MISTR Repair Quantity,USAGE_QY
So here is where you use the conditional INSERT:
INSERT
WHEN tablename ='MASTER_QY' THEN
     INTO api_mstr_qy (qy_type,description,tablename)
     VALUES (qy_type,description,tablename)
WHEN tablename = 'OTHER' THEN
FROM myExternal

Similar Messages

  • PL/SQL-Generate CSV file

    I was told I was able to generate out a CSV file through UTL_FILE method. Can someone provide the skeleton of how should I create it in PL/SQL?
    I tried google search but it only says in words and not code itself.
    I have this PL/SQL that I will want to generate a CSV file.
    SET SERVEROUTPUT ON;
    SET TIMING ON;
    DECLARE
        CURSOR C1
        IS
        select balance from contract ;
    BEGIN
        FOR i IN C1 LOOP
    IF i.balance <> '0' THEN
          DBMS_OUTPUT.PUT_LINE('Amount is not 0 '); 
    I will like to put the statement 'Amount is not 0 ' in a CSV file here
         else
         DBMS_OUTPUT.PUT_LINE('Amount is 0 '); 
         END IF;
         end loop;
    END;
    /How am I suppose to do this?
    Edited by: JoannaLee on Aug 26, 2008 7:14 PM

    Your question is a bit confusing. In your subject line, and again in your question, you talk about generating a CSV file. That is a file of comma-separated values (hence the acryonym). But your question seems to be asking about generating a file with a sentence in it-- that would be a flat file but not a CSV file.
    The links that were provided show you exactly how to generate a CSV file based on an arbitrary query.
    If you are not looking to generate a CSV file, and instead you just want to generate a flat file to which you can write data, you'd just need to use the UTL_FILE package. Assuming you're on a recent version of Oracle, you would need to create a directory object, i.e.
    CREATE DIRECTORY directory_name AS 'path_to_directory_on_database_server'Then you'd grant privileges on that directory object to whatever user will own the procedure that wants to write to the directory
    GRANT read, write ON directory_name TO some_userIn your code, you'd just need to open the file and write to it
    DECLARE
      l_file utl_file.file_type;
    BEGIN
      l_file := utl_file.fopen( 'DIRECTORY_NAME', 'name_of_file', 'w' );
      <<Other code>>
      utf_file.put_line( l_file, 'String you want to write to the file' );
      <<More code>>
      utl_file.fclose( l_file );
    END;Justin

  • Setting required to process incomming Email with CSV file attached

    Dear all,
    We are having a scenario where in the supplier receives a PO confirmation CSV file from the download center as an Email attachment. The supplier updates the file by confirming PO's and replies back. The CSV file needs to update the confirmed PO's in SNC.
    The SO50 settings are in place but still we are not able to receive the Email back in SNC. Any suggestion on what settings we need in SNC to receive and process the CSV file?
    thanks,
    mahehs

    Hi,
    You can use the upload center to process the changed data. Isnt that helpful?
    Best Regards,
    Harsha Gatt

  • Csvde update user info with csv file

    I see many ways how to do this online but I don't understand how to write the entire script myself from what's being showed online, being it from a video or from another forum - due to everyone else s' methods involves different scenarios.
    I would like know what does my excel/csv file need to look like if I'm updating only each AD object inside an OU with the following:
    TELEPHONE NUMBER, FAX NUMBER, MOBILE NUMBER, TITLE - the other entries are already there, such as web address, email address, display name.
    And then what am I going to add in the command line: CSVDE -i -f mailboxdetails.csv ect?

    I agree with Ed.
    If you have a Windows 2008 R2 AD in place , you can achive this goal by using a .csv file and a script with couple of lines in PowerShell  .
    First create the csv file which must contains the following header and its value  (any other if you want) :
    SamAccountName,Title,FaxNumber,MobilNumber,TelephoneNumber 
    then use the below script :
    Import-Module activeDirectory
    $allusers =Import-Csv c:\users.csv
    foreach($user in $allusers)
    Set-aduser -identity $user.samaccountname -Title $user.title -mobilePhone $user.mobileNumber -Fax $user.faxNumber -add @{TelephoneNumber=$user.telephonenumber }
    Note : just change the .csv file name and it's path .
    If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer. ---------- MCITP - Exchange 2010 | MCITP - Windows Server 2008 R2

  • Oracle data int CSV file

    Hello,
    Is there a tool that I can use that capture output of Oracle SQL into CSV files?
    Thanks

    There are many tools that do this - SQLDeveloper is a "free" one (assuming you have a valid database license). TOAD, SQLNavigator, Discoverer etc are other tools you can use for a fee. As noted above, none of these tools can represent LOB data in csv format - they can be only used to export traditional data to csv.
    HTH
    Srini

  • SQL*Loader - How to load only a few columns from a .csv file to ora table

    Hi there,
    Could anyone please let me know how to load few columns from a .csv
    file into a oracle table using SQL*Loader.
    I know how to create a .dat and .ctl file and run the sql loader.
    Suppose I have a .csv file with
    col1, col2, col3, col4
    and I only need to load col1 and col3 into col_a and col_b respectively
    in table_a?
    structure of table_ a
    col_a,
    col_b
    Please advice

    Try like..it i will work..
    LOAD DATA
    INFILE 'test.txt'
    LOAD DATA
    TRUNCATE INTO TABLE T1
    FIELDS TERMINATED BY ','
    (col1,
    col2 FILLER,
    col3,
    col4 FILLER
    )

  • Regarding sql loader ---  can we have  control file  to do a check on csv?

    Hi,
    I normally get a csv having data as
    column1 ;columnb;columnc;
    13 ; 12 ; 13 ;
    11 ;13 ;33;
    as the table where it needs to go is say table
    xys( a number, b number , c number).
    so the control file is fairly simple ...
    But from now I need to restrict data entry if the change in format happens in the csv
    say if it is like
    column2;column1;column3,
    12,13;12;
    11;13;14;
    or say the csv like
    column1;column2;column3;column4;
    11;13;14;15;
    111;134;14;12;
    in both cases sql loader should not run and throw the error saying the reason in the log.
    how do i manage it in the control file `???
    any ideas???
    it is urgent pls help !!!
    regards
    SHUBH
    Message was edited by:
    SHUBH

    Try changing the following properties:
    autosubmit = true;
    immediate = true;
    Here is a link where the user uses a transient attribute for the rows in his table:
    Technology on my way...:): ADF 11g : CheckBox Demo (Select one checkbox in table, Select all/Deselect all)
    Hope that helps.
    Regards,
    Frederico.

  • Using SQL LOADER in Oracle to import CSV file

    I'm pretty new to databases and programming. Im not very good with the computer lingo so stick with me. I have a csv file that I'm trying to load into my oracle database. It contains account information such as name telephone number service dates ect. I've installed Oracle 11g Release 2. This is what I've done so far step by step..
    1) Ran SQL Loader
    I created a new table with the columns that I needed. For example
    create table Billing ( TAP_ID char(10), ACCT_NUM char(10), MR_ID char(10), HOUSE_NUM char(10), STREET char(30), NAME char(50)
    2) It prompted me that the Table was created. Next I created a control file for the data in notepad which was located in the same directory as my Billing table and has a .ctl extension. GIS.csv is the file im getting the data from and is also in the same directory and named it Billing.ctl, which looked like so..
    load data
    infile GIS.csv
    into table Billing
    fields terminated by ','
    (TAP_ID, ACCT_NUM, MR_ID, HOUSE_NUM, STREET, NAME)
    3) Run sqlldr from command line to use the control file
    sqlldr myusername/mypassword Billing.ctl
    This is where I am stuck. Ive seen video tutorials of exactly what I'm doing but I get this error:
    SQL*Loader-350: Syntax error at line 1.
    Expecting keyword LOAD, found "SERV TAP ID". "SERV TAP ID","ACCT NUMBER","MTR ID","SERV HOUSE","SERV STREET","SERV ^'
    I dont understand why its coming up with that error. My billing.ctl has a load.
    load data
    infile GIS.csv
    into table Billing
    fields terminated by ','
    (TAP_ID, ACCT_NUM, MTR_ID, SERV_HOUSE, SERV_STREET, SERV_TOWN, BIL_NAME, MTR_DATE_SET, BIL_PHONE, MTR_SIZE, BILL_CYCLE, MTR_RMT_ID)
    Any thoughts?

    938115 wrote:
    I also got this text file after the command was executed along with the GIS.bad file
    SQL*Loader: Release 11.2.0.1.0 - Production on Fri Jun 1 09:56:52 2012
    Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
    Control File: bill.ctl
    Data File: GIS.csv
    Bad File: GIS.bad
    Discard File: none specified
    (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
    I have thousands of records in this file and only 64 of them updated.How many record were in the table before and after? I doubt the difference is 64, unless you have exactly 64 rows but you said thousands. I believe you are probably misinterpreting the log file. can you share the full log file? As a test, create a empty table, use the same script and load same data file in this empty table. Once loading is complete, check if it has 64 rows or more. I believe what log file is saying, it is 'commiting after every 64 rows', not 'stopping after loading 64 rows'.
    So, unless you show us the log file there is no way to be certain, feel free to mask confidential info, at-least top 15 and bottom 15 lines ?

  • Unable to Load CSV file with comma inside the column(Sql Server 2008)

    Hi,
    I am not able load an CSV file with Comma inside a column. 
    Here is sample File:(First row contain the column names)
    _id,qp,c
    "1","[ ""0"", ""0"", ""0"" ]","helloworld"
    "1","[ ""0"", ""0"", ""0"" ]","helloworld"
    When i specify the Text Qualifier as "(Double quotes) it work in SQL Server 2012, where as fail in the SQL Server 2008, complaining with error:
    TITLE: Microsoft Visual Studio
    The preview sample contains embedded text qualifiers ("). The flat file parser does not support embedding text qualifiers in data. Parsing columns that contain data with text qualifiers will fail at run time.
    BUTTONS:
    OK
    I need to do this in sql server 2008 R2 with Service pack 2, my build version is 10.50.1600.1.
    Can someone let me know it is possible in do the same way it is handle in SQL Server 2012?
    Or
    It got resolved in any successive Cumulative update after 10.50.1600.1?
    Regards Harsh

    Hello,
    If you have CSV with double quotes inside double quotes and with SSIS 2008, I suggest:
    in your data flow you use a script transformation component as Source, then define the ouput columns id signed int, Gp unicode string and C unicode string. e.g. Ouput 0 output colmuns
    Id - four-byte signed
    gp - unicode string
    cc - unicode string
    Do not use a flat file connection, but use a user variable in which you store the name of the flat file (this could be inside a for each file loop).
    The user variable is supplied as a a readonly variable argument to the script component in your dataflow.
    In the script component inMain.CreateNewOutputRows use a System.IO.Streamreader with the user variable name to read the file and use the outputbuffer addrow method to add each line to the output of the script component.
    Between the ReadLine instraction and the addrow instruction you have to add your code to extract the 3 column values.
    public override void CreateNewOutputRows()
    Add rows by calling the AddRow method on the member variable named "<Output Name>Buffer".
    For example, call MyOutputBuffer.AddRow() if your output was named "MyOutput".
    string line;
    System.IO.StreamReader file = new System.IO.StreamReader( Variables.CsvFilename);
    while ((line = file.ReadLine()) != null)
    System.Windows.Forms.MessageBox.Show(line);
    if (line.StartsWith("_id,qp,c") != true) //skip header line
    Output0Buffer.AddRow();
    string[] mydata = Yourlineconversionher(line);
    Output0Buffer.Id = Convert.ToInt32(mydata[0]);
    Output0Buffer.gp = mydata[1];
    Output0Buffer.cc = mydata[2];
    file.Close();
    Jan D'Hondt - SQL server BI development

  • SQL loader with *.csv file

    Good morning,
    I have a *.CVS file containing data like this:
    A123456789,Ah Tong Station,Jalan Dungun
    I would like insert the data into a table that returns 1 row for each value
    id outlet_name addr_1A123456789 Ah Tong Station Jalan Dungun
    etc
    In the stored procedure, SQL loader, I used
    Insert into XXXXX values
    (SUBSTR(input_buffer, 1, 10),
    SUBSTR(input_buffer, 11, 60),
    SUBSTR(input_buffer, 61, 110);
    but the problem is that insertion of the outlet_name and addr_1 will not follow the subcripts that provided. Instead in gave an output like that:
    id outlet_name addr_1
    A123456789 ,Ah Tong Station,Jalan Dungun NULL
    Hope to get some advice asap. Thanks. :)
    Pauline

    Why not use the SQL*Loader proper to load this in to your table? It will be significantly faster than anything you could do in PL/SQL, especially if your volumes increase. And it will take care of the parsing for you, as long as you tell it the field delimiter. You've already seen that you can't rely on fixed widths when using delimited data.
    Given this data...
    A123456789,Ah Tong Station,Jalan Dungun
    A234,Some Station,Some Place...the following SQL*Loader control file ( stored in a file called mytable.ctl ) will load your table ( note I've used truncate - you could also append )...
    load data
    infile 'mydata.csv'
    truncate
    into table mytable
    fields terminated by ','
    (  id
    ,  outlet_name
    ,  addr_1
    )This is invoked using the following:-
    sqlldr userid/password@tns control=mytable.ctlThe results are:-
    SQL> select * from mytable;
    ID                             OUTLET_NAME                    ADDR_1
    A123456789                     Ah Tong Station                Jalan Dungun
    A234                           Some Station                   Some PlaceYou will find this much easier. Of course, you could always avoid the database altogether if you don't need to actually store this data. You could just parse the source .csv ( if you are on UNIX this will be really easy using an awk one-liner ) and write it to an output file.
    Anyway, hope this helps.
    Regards
    Adrian

  • CSV FILES DOESN'T LOAD WITH RIGHT DATA USING SQL LOADER

    Hi pals, I have the following information in csv file:
    MEXICO,Seretide_Q110,2010_SEE_01,Sales Line,OBJECTIVE,MEXICO,Q110,11/01/2010,02/04/2010,Activo,,,MEXICO
    MEXICO,Seretide_Q210,2010_SEE_02,Sales Line,OBJECTIVE,MEXICO,Q210,05/04/2010,25/06/2010,Activo,,,MEXICO
    When I use SQLLOADER the data is loaded as follow:*
    EXICO,Seretide_Q110,2010_SEE_01,Sales Line,OBJECTIVE,MEXICO,Q110,11/01/2010,02/04/2010,Activo,,,MEXICO
    And for the next data in a csv file too:
    MX_001,MEXICO,ASMA,20105912,Not Verified,General,,RH469364,RH469364,Change Request,,,,,,,Y,MEXICO,RH469364
    MX_002,MEXICO,ASMA,30094612,Verified,General,,LCS1405,LCS1405,Change Request,,,,,,,Y,MEXICO,LCS1405
    the data is loaded as follow:
    X_001,MEXICO,ASMA,20105912,Not Verified,General,,RH469364,RH469364,Change Request,,,,,,,Y,MEXICO,RH469364
    X_002,MEXICO,ASMA,30094612,Verified,General,,LCS1405,LCS1405,Change Request,,,,,,,Y,MEXICO,LCS1405
    I mean the first character is truncated and this bug happens with all my data. Any suggestion? I really hope you can help me.
    Edited by: user11260938 on 11/06/2009 02:17 PM
    Edited by: Mariots on 12/06/2009 09:37 AM
    Edited by: Mariots on 12/06/2009 09:37 AM

    Your table and view don't make sense so I created a "dummy" table to match your .ctl file.
    SQL> create table CCI_SRC_MX
      2  (ORG_BU               varchar2(30)
      3  ,name                 varchar2(30)
      4  ,src_num              varchar2(30)
      5  ,src_cd               varchar2(30)
      6  ,sub_type             varchar2(30)
      7  ,period_bu            varchar2(30)
      8  ,period_name          varchar2(30)
      9  ,prog_start_dt        date
    10  ,prog_end_dt          date
    11  ,status_cd            varchar2(30)
    12  ,X_ACTUALS_CALC_DATE  date
    13  ,X_ACTUAL_UPDATE_SRC  varchar2(30)
    14  ,prod_bu              varchar2(30)
    15  ,ROW_ID               NUMBER(15,0)
    16  ,IF_ROW_STAT          VARCHAR2(90)
    17  ,JOB_ID               NUMBER(15,0)
    18  );
    Table created.
    SQL> create sequence GSK_GENERAL_SEQ;
    Sequence created.I simplified your .ctl file and moved all the constant and sequence stuff to the end. I also changed the format masks to match the dates in your data.
    LOAD DATA
    INFILE 'SBSLSLT.txt'
    BADFILE 'SBSLSLT.bad'
    DISCARDFILE 'SBSLSLT.dis'
    APPEND
    INTO TABLE CCI_SRC_MX
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (ORG_BU
    ,NAME
    ,SRC_NUM
    ,SRC_CD
    ,SUB_TYPE
    ,PERIOD_BU
    ,PERIOD_NAME
    ,PROG_START_DT          DATE 'dd/mm/yyyy'
    ,PROG_END_DT            DATE 'dd/mm/yyyy'
    ,STATUS_CD
    ,X_ACTUALS_CALC_DATE    DATE 'dd/mm/yyyy'
    ,X_ACTUAL_UPDATE_SRC
    ,PROD_BU
    ,row_id                 "GSK_GENERAL_SEQ.nextval"
    ,if_row_stat            CONSTANT 'UPLOADED'
    ,job_id                 constant 36889106
    {code}
    When I run SQL Loader, I get this:
    {code}
    SQL> select * from CCI_SRC_MX;
    ORG_BU  NAME           SRC_NUM      SRC_CD      SUB_TYPE   PERIOD_BU  PERIOD_NAME  PROG_START_DT        PROG_END_DT          STATUS_CD  PROD_BU  ROW_ID IF_ROW_STAT    JOB_ID
    MEXICO  Seretide_Q110  2010_SEE_01  Sales Line  OBJECTIVE  MEXICO     Q110         11-JAN-2010 00:00:00 02-APR-2010 00:00:00 Activo     MEXICO        1 UPLOADED     36889106
    MEXICO  Seretide_Q210  2010_SEE_02  Sales Line  OBJECTIVE  MEXICO     Q210         05-APR-2010 00:00:00 25-JUN-2010 00:00:00 Activo     MEXICO        2 UPLOADED     36889106
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Need to load data from source .CSV files to oracle target database.

    Hi,
    This is the my scenario
    I have .CSV files in ftp folder and need to load the data into target tables.
    For that i need to create package and load the data into daily basis.
    But some time .csv file name will vary daily basis.
    can you any one suggest me???
    Thanks in Advacne.
    Zakeer

    Dear Roy,
    Thanks for your response
    Now I am able to extract the .zip file OdiUnZip (file). and loading data into target this is chapping in static way
    and my scenario is that some time i will get .zip files with different names with different .csv files
    i need to dynamically find the new .zip file and extract it and load the data into target.
    Please advice me..
    Thanks in advance
    Zakeer

  • Issue while loading a csv file using sql*loader...

    Hi,
    I am loading a csv file using sql*loader.
    On the number columns where there is data populated in them, decimal number/integers, the row errors out on the error -
    ORA-01722: invalid number
    I tried checking the value picking from the excel,
    and found the chr(13),chr(32),chr(10) values characters on the value.
    ex: select length('0.21') from dual is giving a value of 7.
    When i checked each character as
    select ascii(substr('0.21',5,1) from dual is returning a value 9...etc.
    I tried the following command....
    "to_number(trim(replace(replace(replace(replace(:std_cost_price_scala,chr(9),''),chr(32),''),chr(13),''),chr(10),'')))",
    to remove all the non-number special characters. But still facing the error.
    Please let me know, any solution for this error.
    Thanks in advance.
    Kiran

    control file:
    OPTIONS (ROWS=1, ERRORS=10000)
    LOAD DATA
    CHARACTERSET WE8ISO8859P1
    INFILE '$Xx_TOP/bin/ITEMS.csv'
    APPEND INTO TABLE XXINF.ITEMS_STAGE
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
    ItemNum                    "trim(replace(replace(:ItemNum,chr(9),''),chr(13),''))",
    cross_ref_old_item_num               "trim(replace(replace(:cross_ref_old_item_num,chr(9),''),chr(13),''))",
    Mas_description               "trim(replace(replace(:Mas_description,chr(9),''),chr(13),''))",
    Mas_long_description               "trim(replace(replace(:Mas_long_description,chr(9),''),chr(13),''))",
    Org_description               "trim(replace(replace(:Org_description,chr(9),''),chr(13),''))",
    Org_long_description               "trim(replace(replace(:Org_long_description,chr(9),''),chr(13),''))",
    user_item_type                    "trim(replace(replace(:user_item_type,chr(9),''),chr(13),''))",
    organization_code               "trim(replace(replace(:organization_code,chr(9),''),chr(13),''))",
    primary_uom_code               "trim(replace(replace(:primary_uom_code,chr(9),''),chr(13),''))",
    inv_default_item_status          "trim(replace(replace(:inv_default_item_status,chr(9),''),chr(13),''))",
    inventory_item_flag               "trim(replace(replace(:inventory_item_flag,chr(9),''),chr(13),''))",
    stock_enabled_flag               "trim(replace(replace(:stock_enabled_flag,chr(9),''),chr(13),''))",
    mtl_transactions_enabled_flag          "trim(replace(replace(:mtl_transactions_enabled_flag,chr(9),''),chr(13),''))",
    revision_qty_control_code          "trim(replace(replace(:revision_qty_control_code,chr(9),''),chr(13),''))",
    reservable_type               "trim(replace(replace(:reservable_type,chr(9),''),chr(13),''))",
    check_shortages_flag               "trim(replace(replace(:check_shortages_flag,chr(9),''),chr(13),''))",
    shelf_life_code               "trim(replace(replace(replace(replace(:shelf_life_code,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    shelf_life_days               "trim(replace(replace(replace(replace(:shelf_life_days,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    lot_control_code               "trim(replace(replace(:lot_control_code,chr(9),''),chr(13),''))",
    auto_lot_alpha_prefix               "trim(replace(replace(:auto_lot_alpha_prefix,chr(9),''),chr(13),''))",
    start_auto_lot_number               "trim(replace(replace(:start_auto_lot_number,chr(9),''),chr(13),''))",
    negative_measurement_error          "trim(replace(replace(replace(replace(:negative_measurement_error,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    positive_measurement_error          "trim(replace(replace(replace(replace(:positive_measurement_error,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    serial_number_control_code          "trim(replace(replace(:serial_number_control_code,chr(9),''),chr(13),''))",
    auto_serial_alpha_prefix          "trim(replace(replace(:auto_serial_alpha_prefix,chr(9),''),chr(13),''))",
    start_auto_serial_number          "trim(replace(replace(:start_auto_serial_number,chr(9),''),chr(13),''))",
    location_control_code               "trim(replace(replace(:location_control_code,chr(9),''),chr(13),''))",
    restrict_subinventories_code          "trim(replace(replace(:restrict_subinventories_code,chr(9),''),chr(13),''))",
    restrict_locators_code               "trim(replace(replace(:restrict_locators_code,chr(9),''),chr(13),''))",
    bom_enabled_flag               "trim(replace(replace(:bom_enabled_flag,chr(9),''),chr(13),''))",
    costing_enabled_flag               "trim(replace(replace(:costing_enabled_flag,chr(9),''),chr(13),''))",
    inventory_asset_flag               "trim(replace(replace(:inventory_asset_flag,chr(9),''),chr(13),''))",
    default_include_in_rollup_flag          "trim(replace(replace(:default_include_in_rollup_flag,chr(9),''),chr(13),''))",
    cost_of_goods_sold_account          "trim(replace(replace(:cost_of_goods_sold_account,chr(9),''),chr(13),''))",
    std_lot_size                    "trim(replace(replace(replace(replace(:std_lot_size,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    sales_account                    "trim(replace(replace(:sales_account,chr(9),''),chr(13),''))",
    purchasing_item_flag               "trim(replace(replace(:purchasing_item_flag,chr(9),''),chr(13),''))",
    purchasing_enabled_flag          "trim(replace(replace(:purchasing_enabled_flag,chr(9),''),chr(13),''))",
    must_use_approved_vendor_flag          "trim(replace(replace(:must_use_approved_vendor_flag,chr(9),''),chr(13),''))",
    allow_item_desc_update_flag          "trim(replace(replace(:allow_item_desc_update_flag,chr(9),''),chr(13),''))",
    rfq_required_flag               "trim(replace(replace(:rfq_required_flag,chr(9),''),chr(13),''))",
    buyer_name                    "trim(replace(replace(:buyer_name,chr(9),''),chr(13),''))",
    list_price_per_unit               "trim(replace(replace(replace(replace(:list_price_per_unit,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    taxable_flag                    "trim(replace(replace(:taxable_flag,chr(9),''),chr(13),''))",
    purchasing_tax_code               "trim(replace(replace(:purchasing_tax_code,chr(9),''),chr(13),''))",
    receipt_required_flag               "trim(replace(replace(:receipt_required_flag,chr(9),''),chr(13),''))",
    inspection_required_flag          "trim(replace(replace(:inspection_required_flag,chr(9),''),chr(13),''))",
    price_tolerance_percent          "trim(replace(replace(replace(replace(:price_tolerance_percent,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    expense_account               "trim(replace(replace(:expense_account,chr(9),''),chr(13),''))",
    allow_substitute_receipts_flag          "trim(replace(replace(:allow_substitute_receipts_flag,chr(9),''),chr(13),''))",
    allow_unordered_receipts_flag          "trim(replace(replace(:allow_unordered_receipts_flag,chr(9),''),chr(13),''))",
    receiving_routing_code               "trim(replace(replace(:receiving_routing_code,chr(9),''),chr(13),''))",
    inventory_planning_code          "trim(replace(replace(:inventory_planning_code,chr(9),''),chr(13),''))",
    min_minmax_quantity               "trim(replace(replace(replace(replace(:min_minmax_quantity,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    max_minmax_quantity               "trim(replace(replace(replace(replace(:max_minmax_quantity,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    planning_make_buy_code               "trim(replace(replace(:planning_make_buy_code,chr(9),''),chr(13),''))",
    source_type                    "trim(replace(replace(:source_type,chr(9),''),chr(13),''))",
    mrp_safety_stock_code               "trim(replace(replace(:mrp_safety_stock_code,chr(9),''),chr(13),''))",
    material_cost                    "trim(replace(replace(:material_cost,chr(9),''),chr(13),''))",
    mrp_planning_code               "trim(replace(replace(:mrp_planning_code,chr(9),''),chr(13),''))",
    customer_order_enabled_flag          "trim(replace(replace(:customer_order_enabled_flag,chr(9),''),chr(13),''))",
    customer_order_flag               "trim(replace(replace(:customer_order_flag,chr(9),''),chr(13),''))",
    shippable_item_flag               "trim(replace(replace(:shippable_item_flag,chr(9),''),chr(13),''))",
    internal_order_flag               "trim(replace(replace(:internal_order_flag,chr(9),''),chr(13),''))",
    internal_order_enabled_flag          "trim(replace(replace(:internal_order_enabled_flag,chr(9),''),chr(13),''))",
    invoice_enabled_flag               "trim(replace(replace(:invoice_enabled_flag,chr(9),''),chr(13),''))",
    invoiceable_item_flag               "trim(replace(replace(:invoiceable_item_flag,chr(9),''),chr(13),''))",
    cross_ref_ean_code               "trim(replace(replace(:cross_ref_ean_code,chr(9),''),chr(13),''))",
    category_set_intrastat               "trim(replace(replace(:category_set_intrastat,chr(9),''),chr(13),''))",
    CustomCode                    "trim(replace(replace(:CustomCode,chr(9),''),chr(13),''))",
    net_weight                    "trim(replace(replace(replace(replace(:net_weight,chr(9),''),chr(13),''),chr(32),''),chr(10),''))",
    production_speed               "trim(replace(replace(:production_speed,chr(9),''),chr(13),''))",
    LABEL                         "trim(replace(replace(:LABEL,chr(9),''),chr(13),''))",
    comment1_org_level               "trim(replace(replace(:comment1_org_level,chr(9),''),chr(13),''))",
    comment2_org_level               "trim(replace(replace(:comment2_org_level,chr(9),''),chr(13),''))",
    std_cost_price_scala               "to_number(trim(replace(replace(replace(replace(:std_cost_price_scala,chr(9),''),chr(32),''),chr(13),''),chr(10),'')))",
    supply_type                    "trim(replace(replace(:supply_type,chr(9),''),chr(13),''))",
    subinventory_code               "trim(replace(replace(:subinventory_code,chr(9),''),chr(13),''))",
    preprocessing_lead_time          "trim(replace(replace(replace(replace(:preprocessing_lead_time,chr(9),''),chr(32),''),chr(13),''),chr(10),''))",
    processing_lead_time                "trim(replace(replace(replace(replace(:processing_lead_time,chr(9),''),chr(32),''),chr(13),''),chr(10),''))",
    wip_supply_locator               "trim(replace(replace(:wip_supply_locator,chr(9),''),chr(13),''))"
    Sample data from csv file.
    "9901-0001-35","390000","JMKL16 Pipe bend 16 mm","","JMKL16 Putkikaari 16 mm","","AI","FJE","Ea","","","","","","","","","","","","","","","","","","","","","","","","","21-21100-22200-00000-00000-00-00000-00000","0","21-11100-22110-00000-00000-00-00000-00000","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","0.1","Pull","AFTER PROD","","","Locator for Production"
    The load errors out on especially two columns :
    1) std_cost_price_scala
    2) list_price_per_unit
    both are number columns.
    And when there is data being provided on them. It errors out. But, if they are holding null values, the records go through fine.
    Message was edited by:
    KK28

  • Loading a CSV file to Sql Server

    Hi,
    How can i load a csv file, which is in a shared location itn osql using bods.
    Where can i create the data source pointing to csv file

    Hi,
    Use fileformat to load CSV file into SQL server, below the details
    A file format defines a connection to a file. Therefore, you use a file format to connect to source or target data when the data is stored in a file rather than a database table. The object library stores file format templates that you use to define specific file formats as sources and targets in data flows.
    To work with file formats, perform the following tasks:
    • Create a file format template that defines the structure for a file.
    • Create a specific source or target file format in a data flow. The source or target file format is based on a template and specifies connection information such as the file name.
    File format objects can describe files of the following types:
    • Delimited: Characters such as commas or tabs separate each field.
    • Fixed width: You specify the column width.
    • SAP transport: Use to define data transport objects in SAP application data flows.
    • Unstructured text: Use to read one or more files of unstructured text from a directory.
    • Unstructured binary: Use to read one or more binary documents from a directory.
    More details, refer the designer guide
    http://help.sap.com/businessobject/product_guides/sbods42/en/ds_42_designer_en.pdf

  • SQL Loader - CSV Data file with carraige returns and line fields

    Hi,
    I have a CSV data file with occasional carraige returns and line feeds in between, which throws my SQL loader script off. Sql loader, takes the characters following the carraige return as a new record and gives me error. Is there a way I could handle carraige returns and linefeeds in SQL Loader.
    Please help. Thank you for your time.
    This is my Sql Loader script.
    load data
    infile 'D:\Documents and Settings\user1\My Documents\infile.csv' "str '\r\n'"
    append
    into table MYSCHEMA.TABLE1
    fields terminated by ','
    OPTIONALLY ENCLOSED BY '"'
    trailing nullcols
    ( NAME CHAR(4000),
    field2 FILLER,
    field3 FILLER,
    TEST DEPT CHAR(4000)
    )

    You can "regexp_replace" the columns for special characters

Maybe you are looking for

  • How do I create an image of our standard MacBook build?

    Hi, I've been set the job of creating a standard image for all our companies MacBooks. We currently have a build process, but this takes several hours for each MacBook and isn't very convienient. What I would like to do is install all the required so

  • Packaging IDOCS in one single Scenario from R3 to XI

    Hi experts, i m looking for help to make a IDOc to FILE scenario where i can integarte all idocs sent from R3 toxi be treated together in one call scenario, the problem is when i made a package in idx5 et idxpw i got all the idocs treated separatly.

  • T410i keeps doing restart if i am not in home wireless network!!!

    Good day, I am having a problem with my band new laptop ( Lenovo t410i – windows  7 professional ) less than a week old!!! It keeps restarting by itself! In the first few days nothing was happening, but starting from today suddenly a blue screen with

  • Primary and Standby database: same Oracle release?

    Hi , we have to create a standby database in our new datacenter. The primary database is of Oracle release 9.2.0.8 - but on the server for the standby site only Oracle release 9.2.0.5.0 is installed. Is that supported by Oracle anyway? No need to tel

  • Service Form interface with RACF DB2 Databases

    We are looking for a way to have service form interface with RACF using DB2 connect. This function is needed to perform data validation against mainframe system. Any advice or instructions of how to implement this is greatly appreciated.