Comma-delimited values

I need to load a flat file with lane and average cost which look slike below
"AKRON, OH-ALSIP, IL",623.00
"AKRON, OH-BENTON HARBOR, MI",877.00
"AKRON, OH-FOGELSVILLE, PA",1187.00
"AKRON, OH-GRAND PRAIRIE, TX",2335.00
The lane value itself has comma in it. How to load such a csv file if one value has comma in it.

Hi Sachin,
You cannot load this data  "," as  Data Separator, Try to replace this in Flat File with anything else like ";" ...in flatfile  Use Edit --> Replace ..
Hope this helps,
Sudhakar.

Similar Messages

  • Form field with comma delimited value list to cfc

    I have a form that passes a field to an action page with a
    comma delimited value.
    For instance the field name is: Program_ID
    value for program_ID is: 31, 32
    I am able to treat this variable as a list and check its
    length, and loop over the list prior to passing it to a cfc using
    the attached code:
    When I try and pass the variable as a string to a cfc and
    invoke a query, cf no longer recognizes my var as a list.
    Therefore the code attached does not function...
    Is there a specific var type that will pass through as a list
    and allow me to run the code block attached?
    thanks
    Craig

    Ok answered my own question.. Here is the answer for those
    who are interested...
    initialize var for cfc in cfinvoke statement
    <cfinvokeargument name="Program_ID"
    value="#Form.Program_ID#">
    pass argument to cfc as a string
    <cfargument name="Program_ID" type="string"
    required="true">
    use listqualify to parse list in cfc and set new var
    <cfset selectedProgramID =
    ListQualify(Program_ID,"'",",","CHAR")>
    use the new var in the following statement in sql code:
    ((Program_ID) IN (#PreserveSingleQuotes(selectedProgramID)#))
    The following code handles a form field with a single value
    or a comma delimited value.

  • Oracle Stored Procedure Not Accepting Comma delimited values in database

    I have a stored procedure which does the following, declares variables and assigns values retrieved from a parameter temp_table database to each variable, then it reads column headings from a master table. Using the variables assigned to each parameter from the temp_table as a filter, the rows from the MASTER TABLE are finally output by the procedure. The stored procedure works fine when dealing with single value string values passed from the parameter temp_table.
    The problem comes in when multiple values are selected and stored in the database parameter field as a comma separated string, eg. A045, A012
    So, the strored procedure has been modified to use a function to split the string into separate values: 'A045' and 'A012'. So that: A045, A012 from the database will be returned to the stored procedure variable as *('A045', 'A012')* . When testing the stored procedure using the static values *('A045', 'A012')* , data is returned.
    eg. EMPLOYEE_MASTER.CODE IN ('*A045*', '*A012*') will return results
    However, when *('A045', 'A012')* is dynamically concatenated from the function and assigned to variable:
    paramCode := split_str(paramCode) with paramCode eventually being passed: *('A045', 'A012')*
    to become:
    EMPLOYEE_MASTER.CODE IN (paramCode)
    then NO DATA is returned.
    I am stuck and don't know what the problem is. If anyone has any ideas, please feel free to help. I have included the Actual Stored Procedure below for a better understanding.
    --------------------------------------------- STORED PROCEDURE-------------------------------------------------------
    create or replace
    PROCEDURE GETEMPLOYEEDATA
    ( sesId IN VARCHAR2,
    l_cursor in out sys_refcursor
    ) is
    compCode varchar(200);
    businessUnit varchar(200);
    locCode varchar(200);
    hrDeptID varchar(200);
    glDept varchar(200);     plat varchar(200);
    deptFunc varchar(200);     empType varchar(200);
    unionCode varchar(200);     jobCode varchar(200);     
    careerLvl varchar(200);     
    empStatus varchar(200);
    zid varchar(200);
    superID varchar(200);
    counter varchar(200) ;
    token_index number;
    --v_errm VARCHAR2(256);
    BEGIN
    dbms_output.put_line('Start of BEGIN');
    /* Counter to get number of Unique Employee ID based on valid Session ID */
    select count(*) into counter from XXCCHRWEB.hr_web_sessionid_tmp where parameter_20=sesId;
    open l_cursor for SELECT counter EMPLOYEE_ID, '' LAST_NAME,
    '' FIRST_NAME from dual;
    dbms_output.put_line('OPENING FIRST CURSOR');
    /* If no valid session ID returned then error gently */
    if counter=0 then
    open l_cursor for SELECT '' EMPLOYEE_ID, '' LAST_NAME,
    '' FIRST_NAME,'' MIDDLE_NAME,'' NAME,
    '' EMPLOYEE_TYPE, '' COMPANY, '' COMPANY_DESCRIPTION,
    '' BUSINESS_UNIT, '' BUSINESS_UNIT_DESCRIPTION, '' LOCATION,
    '' LOCATION_NAME, '' HR_DEPARTMENT_ID,'' DEPARTMENT_NAME,
    '' DEPARTMENT_FUNCTION, '' PLATFORM, '' JOB_CODE,
    '' JOB_TITLE, '' BUSINESS_TITLE, '' MANAGER_LEVEL,
    '' JOB_FUNCTION, '' GL_DEPARTMENT_ID, '' GL_OP_UNIT,
    '' GL_RESPONSIBILITY_CENTER, '' HR_CHANNEL,'' FULL_OR_PART_TIME,
    '' REGULAR_OR_TEMP, '' GRADE,'' UNION_CODE,
    '' BARGAINING_UNIT, '' ANNUAL_RATE,'' HOURLY_RATE,
    '' HIRE_DATE, '' BIRTH_DATE, '' REHIRE_DATE,
    '' SERVICE_DATE, '' POSITION_NUMBER, '' REPORTS_TO,
    '' REPORTS_TO_TITLE, '' SUPERVISOR_ID, '' SUPERVISOR_NAME,
    '' LAN_ID from dual;
    dbms_output.put_line('End of counter=0');
    -- return;
    end if;
    /* read from hr_web_sessionid_tmp */
    select
    parameter_1,parameter_2, parameter_3, parameter_4,
    parameter_5,parameter_6, parameter_7, parameter_8,
    parameter_9,parameter_10, parameter_11, parameter_12,
    parameter_13, parameter_14
    into
    compCode,     businessUnit,     locCode, hrDeptID,
    glDept,     plat,     deptFunc,     empType,
    unionCode, jobCode,     careerLvl, empStatus,
    zid, superID
    from
    XXCCHRWEB.hr_web_sessionid_tmp
    where
    parameter_20= sesId;
    /*Assigning All Value to NULL superID*/
    IF superid is null then
    superID:= 'All';
    END IF;
    jobCode:='('''|| get_token(jobCode, 1)||''')'||','||'('''|| get_token(jobCode, 2)||''')';
    dbms_output.put_line('SELECTING PARAMETERS FROM TEMP TABLE WITH ROW COUNT : '||l_cursor%ROWCOUNT);
    /* read from Employee Master */
    open l_cursor for SELECT DISTINCT * FROM ( SELECT HR_EMPLOYEE_MASTER.EMPLOYEE_ID, HR_EMPLOYEE_MASTER.LAST_NAME,
    HR_EMPLOYEE_MASTER.FIRST_NAME, HR_EMPLOYEE_MASTER.MIDDLE_NAME, HR_EMPLOYEE_MASTER.NAME,
    HR_EMPLOYEE_MASTER.EMPLOYEE_TYPE, HR_EMPLOYEE_MASTER.COMPANY, HR_EMPLOYEE_MASTER.COMPANY_DESCRIPTION,
    HR_EMPLOYEE_MASTER.BUSINESS_UNIT, HR_EMPLOYEE_MASTER.BUSINESS_UNIT_DESCRIPTION, HR_EMPLOYEE_MASTER.LOCATION,
    HR_EMPLOYEE_MASTER.LOCATION_NAME, HR_EMPLOYEE_MASTER.HR_DEPARTMENT_ID, HR_EMPLOYEE_MASTER.DEPARTMENT_NAME,
    HR_EMPLOYEE_MASTER.DEPARTMENT_FUNCTION, HR_EMPLOYEE_MASTER.PLATFORM, HR_EMPLOYEE_MASTER.JOB_CODE,
    HR_EMPLOYEE_MASTER.JOB_TITLE, HR_EMPLOYEE_MASTER.BUSINESS_TITLE, HR_EMPLOYEE_MASTER.MANAGER_LEVEL,
    HR_EMPLOYEE_MASTER.JOB_FUNCTION, HR_EMPLOYEE_MASTER.GL_DEPARTMENT_ID, HR_EMPLOYEE_MASTER.GL_OP_UNIT,
    HR_EMPLOYEE_MASTER.GL_RESPONSIBILITY_CENTER, HR_EMPLOYEE_MASTER.HR_CHANNEL, HR_EMPLOYEE_MASTER.FULL_OR_PART_TIME,
    HR_EMPLOYEE_MASTER.REGULAR_OR_TEMP, HR_EMPLOYEE_MASTER.GRADE, HR_EMPLOYEE_MASTER.UNION_CODE,
    HR_EMPLOYEE_MASTER.BARGAINING_UNIT, HR_EMPLOYEE_MASTER.ANNUAL_RATE, HR_EMPLOYEE_MASTER.HOURLY_RATE,
    HR_EMPLOYEE_MASTER.HIRE_DATE, HR_EMPLOYEE_MASTER .BIRTH_DATE, HR_EMPLOYEE_MASTER.REHIRE_DATE,
    HR_EMPLOYEE_MASTER.SERVICE_DATE, HR_EMPLOYEE_MASTER.POSITION_NUMBER, HR_EMPLOYEE_MASTER.REPORTS_TO,
    HR_EMPLOYEE_MASTER.REPORTS_TO_TITLE, HR_EMPLOYEE_MASTER.SUPERVISOR_ID, HR_EMPLOYEE_MASTER.SUPERVISOR_NAME, HR_EMPLOYEE_MASTER.GENDER,
    HR_EMPLOYEE_MASTER_1.LAN_ID
    FROM
    (XXCCHR.HR_EMPLOYEE_MASTER HR_EMPLOYEE_MASTER_1
    LEFT OUTER JOIN
    XXCCHR.HR_DEPARTMENT_SECURITY HR_DEPARTMENT_SECURITY
    ON
    HR_EMPLOYEE_MASTER_1.EMPLOYEE_ID=HR_DEPARTMENT_SECURITY.EMPLOYEE_ID)
    LEFT OUTER JOIN
    XXCCHR.HR_EMPLOYEE_MASTER HR_EMPLOYEE_MASTER
    ON
    -- HR_DEPARTMENT_SECURITY.DEPARTMENT_SECURITY=HR_EMPLOYEE_MASTER.HR_DEPARTMENT_ID
    (HR_DEPARTMENT_SECURITY.DEPARTMENT_SECURITY=HR_EMPLOYEE_MASTER.HR_DEPARTMENT_ID
    or
    HR_DEPARTMENT_SECURITY.DEPARTMENT_SECURITY in ('DPALL','DPCAG009'))
    WHERE
    HR_EMPLOYEE_MASTER_1.LAN_ID=upper(zid) and
    (compCode = 'All' or HR_EMPLOYEE_MASTER.COMPANY IN compCode)
    (jobCode = 'All' or HR_EMPLOYEE_MASTER.JOB_CODE IN (jobCode) ) ) ;
    dbms_output.put_line('END OF SELECT for counter number : ' || counter ||' Cursor row count : '|| l_cursor%ROWCOUNT || ' with Job Code : ' || (jobCode));
    dbms_output.put_line('Company Code is:' || compCode);
    COMMIT;
    dbms_output.put_line('Data has been Output with session id:' || sesId);
    --delete from XXCCHRWEB.hr_web_sessionid_tmp where parameter_20= sesId;
    dbms_output.put_line('Data should have been DELETED, please check the session temp table');
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('AN EXCEPTION HAS BEEN CAUGHT for counter number : ' || counter ||' Cursor row count : '|| l_cursor%ROWCOUNT || ' from session id : ' || sesId);
    dbms_output.put_line('The error code is ' || SQLERRM);
    END GETEMPLOYEEDATA;
    Edited by: user10384134 on Nov 4, 2009 8:37 AM

    This seems to work for me:
    define param="'ABC','XYZ'"; --- Set up a test in clause
    --- Test data
    with test as
    (select 'ABC' fld from dual union all
    select 'DEF' from dual union all
    select 'PQR' from dual union all
    select 'XYZ' from dual)
    --- Query starts here.
    select fld
    from test,
           table (sys.ODCIVarchar2List (&param)) p
    where fld = p.column_valueOr Using an actual "IN" clause:
    define param="'ABC','XYZ'";
    with test as
    (select 'ABC' fld from dual union all
    select 'DEF' from dual union all
    select 'PQR' from dual union all
    select 'XYZ' from dual
    p as
    (select column_value from table (sys.ODCIVarchar2List (&param))
    select fld
    from test
    where fld in (select column_value from p)Edited by: AlanWms on Nov 4, 2009 9:08 AM

  • How to insert comma delimited values into a table

    I have a variable holding values like,
    'A,Ba,Ccc' OR
    '1,2,3,4'
    I want to know how to convert and insert these values in oracle table as seperate rows like,
    A
    Ba
    Ccc[ OR ]
    1
    2
    3
    4
    Thanks,
    Previn

    Answered (I guess) in this dbms_utility.comma_to_table.
    Cheers, the ever helpful APC

  • Comma-delimited field values

    Hello all,
    Hope someone can help... :-)
    I've been trying to put values from a comma-delimited
    Database field into variables...
    The field is called "Related_Products" and I can pull the
    recordset fine... it's just the part of looping through the
    comma-delimited field and placing them in variables that's killing
    me...
    The field will contain up to 6 comma-delimited values at
    most.
    And if the recordset field has 5 comma-delimited values... I
    want 5 variables.. 2 comma-delimited values then 2 variables, etc.
    <cfquery name="getRelatedProducts"
    datasource="fikestudioDB">
    SELECT New_category_dataport.Category_DataPort_Id,
    New_category_dataport.Name, New_category_dataport.Hide,
    New_category_dataport.Thumbnail, New_category_dataport.Sort_Order,
    category_details.CategoryID, category_details.Related_Products
    FROM New_category_dataport LEFT JOIN category_details ON
    New_category_dataport.Category_DataPort_Id =
    category_details.Category_DataPort_Id
    WHERE (((category_details.CategoryID)=#URL.productID#))
    </cfquery>
    <!--- define and set variable --->
    <cfparam name="ProductList" default="">
    <cfset ProductList=getRelatedProducts.Related_Products
    />
    <!--- define variables for however many comma-delimited
    values exist.. up to 6 --->
    <CFLOOP INDEX="i" LIST="#ProductList#" DELIMITERS=",">
    <cfset variable1="">
    <cfset variable2="">
    ... up to 6 values
    </CFLOOP>
    Hope someone can help :-)
    Thanks so much,
    John

    Thanks for your help Sankalan...
    But, when I use your code as such :
    <!--- define variables for however many comma-delimited
    values exist.. up to 6 --->
    <CFLOOP INDEX="i" LIST="#ProductList#" DELIMITERS=",">
    <cfset "variable_#i#"="">
    </CFLOOP>
    <cfoutput>
    #variable_1#
    </cfoutput>
    and hoping for something like :
    variable_1 = a
    variable_2 = b
    variable_3 = c
    variable_4 = d
    variable_5 = e
    variable_6 = f
    Variable_1 is undefined...
    I think it's putting the value of the field in the variable
    name and not of the value of variable_1 ........
    think I need something like :
    <CFLOOP INDEX="i" LIST="#ProductList#" DELIMITERS=",">
    <cfset "variable_"="#i#">
    </CFLOOP>
    But not sure how to increment the variable name by 1 each
    time ... like :
    variable_1 = a
    variable_2 = b
    variable_3 = c
    variable_4 = d
    variable_5 = e
    variable_6 = f
    Hope this makes sense....
    Thanks again,
    John

  • SQL to match a single value in a field with comma-delimited text

    I have a column that can contain none, one or many recordIDs
    (from another table) stored as comma-delimited text strings (i.e.,
    a list). I need to retrieve all records that match a single value
    within that list.
    For example, if I want to match all values that equal
    recordID 3, and I use ... WHERE MyColumn IN ('3') ... , I will get
    all records that have EXACTLY 3 as the value of MyColumn, but not
    any MyColumn records whose values include 3, if they are instances
    such as "3,17" or the like.
    Also using the LIKE operator -- as WHERE MyColumn LIKE '%3%'
    -- will get me unwanted records with values such as 35 or 13 ...
    Can I use some sort of intervening ColdFusion list processing
    to output only the desired records?

    Normalize your database so that your data becomes
    accessible.

  • HT2486 The selected file does not appear to be a valid comma separated values (csv) file or a valid tab delimited file. Choose a different file.

    The selected file does not appear to be a valid comma separated values (csv) file or a valid tab delimited file. Choose a different file.

    I guess your question is, "what's wrong with the file?"
    You're going to have to figure that out yourself, as we cannot see the file.
    Importing into Address book requires either a tab-delimited or a comma-delimited file. You can export out of most spreadsheets into a csv file. However, you need to make sure you clean up the file first.  If you have a field that has commas in the field, they will create new fields at the comma. So, some lines will have more fields than the others, causing issues like the error you saw.

  • DRM Function to divide comma delimited string to list value

    Hi
    Any one knows how to seperate comma delimited string into list values.
    Thanks

    Are you wanting to dynamically set the list values for a property? If so there are a couple options:
    1. You can update them via the API.
    2. You can write a sql script to update the table Property_List. This requires an application server restart and generally isn't recommended for support reasons but it makes sense in some instances.
    Edited by: Naren Truelove on 16/02/2011 22:08

  • Is it possible to convert a table of values into a comma-delimited-list?

    Hi,
    I'd like to turn the following dataset:
    Parent | Child
    Charles | William
    Charles | Harry
    Anne | Peter
    Anne | Zara
    Andrew | Beatrice
    Andrew | Eugenie
    into this:
    Parent | Children
    Charles | Diana,Camilla
    Anne | Peter,Zara
    Andrew | Beatrice,Eugenie
    In other words, I'd like to take a list of values pertaining to some key and produce them as a comma-delimited-list.
    I know its is possible in T-SQL although the method is a bit of a nasty hack. Is it possible in PL-SQL?
    Thaks in advance
    Jamie

    Hi,
    With model clause (10g)
    with t  as(
    select 'Charles' parent, 'William' child from dual union
    select 'Charles', 'Harry' from dual union
    select 'Anne', 'Peter' from dual union
    select 'Anne', 'Zara' from dual union
    select 'Andrew', 'Beatrice' from dual union
    select 'Andrew', 'Eugenie' from dual
    select parent,substr(res,2) res
    from t
    model
    return updated rows
    partition by ( parent)
    dimension by ( row_number()over(partition by parent order by child) rn)
    measures(child, cast( null as varchar2(4000)) as res)
    rules
    iterate(100000)
    until(presentv(res[iteration_number+2],1,0)=0)
    ( res[0]=res[0]||','||child[iteration_number+1]);
    PARENT  RES                                              
    Anne    Peter,Zara                                       
    Andrew  Beatrice,Eugenie                                 
    Charles Harry,William                                    
    3 rows selected.

  • Regular Expression to Search Comma Delimited File for any of 3 Values

    Hi,
    I'd like to parse a table column that contains a comma delimited string for any of 3 values, 1200, 1400, 1600 just to see if they're present using Regexp_instr. If someone has an expression available please pass it along.
    Thanks,
    Victor

    Or you could do it like this too...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 1 as id, '1000,2000,3000' as txt from dual union all
      2             select 2, '1200,1300,1400' from dual union all
      3             select 3, '1000,1300,1600' from dual)
      4  -- end of test data
      5  select *
      6  from t
      7* where regexp_like(txt,'(^|,)(1200|1400|1600)(,|$)')
    SQL> /
            ID TXT
             2 1200,1300,1400
             3 1000,1300,1600

  • REGEXP_SUBSTR for comma delimited list with null values

    Hi,
    I have a column which stores a comma delimited list of values. Some of these values in the list may be null. I'm having some issues trying to extract the values using the REGEXP_SUBSTR function when null values are present. Here are two things that I've tried:
    SELECT
       REGEXP_SUBSTR (val, '[^,]*', 1, 1) pos1
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 2) pos2
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 3) pos3
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 4) pos4
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 5) pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);
    POS P POS P P
    AAA   BBB
    SELECT
       REGEXP_SUBSTR (val, '[^,]+', 1, 1) pos1
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 2) pos2
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 3) pos3
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 4) pos4
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 5) pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);
    POS POS POS POS P
    AAA BBB DDD FFFAs you can see neither of the calls works correctly. Does anyone know how to modify the regular expression pattern to handle null values? I've tried various other patterns but was unable to get anyone to work for all cases.
    Thanks,
    Martin
    http://www.ClariFit.com
    http://www.TalkApex.com

    Hi, Martin,
    This does what you want:
    SELECT
       RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 1), ',') pos1
      ,RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 2), ',') pos2
      ,RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 3), ',') pos3
      ,RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 4), ',') pos4
      ,RTRIM (REGEXP_SUBSTR (val || ','
                          , '[^,]*,', 1, 5), ',') pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);The query above works in Oracle 10 or 11, but in Oracle 11, you can also do it with just REGEXP_SUBSTR, without using RTRIM:
    SELECT
       REGEXP_SUBSTR (val, '([^,]*),|$', 1, 1, NULL, 1) pos1
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 2, NULL, 1) pos2
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 3, NULL, 1) pos3
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 4, NULL, 1) pos4
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 5, NULL, 1) pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);The problem with your first query was that it was looking for sub-strings of 0 or more non-commas. There was such as sub-string. consisting of 3 characters, starting at position 1, so it returned 'AAA', as expected. Then there was another sub-string, of 0 characters, starting at position 4, so it returned NULL. Then there was a sub-string of 3 characters starting at position 5, so it returned 'BBB'.
    The problem with your 2nd query was that it was looking for 1 or more non-commas. 'DDD' is the 3rd such sub-string.
    Edited by: Frank Kulash on Feb 16, 2012 11:36 AM
    Added Oracle 11 example

  • Use PL/SQL Table values as a comma delimited list in a in (...) clause

    Hi,
    One my procedure's parameters is a PL/SQL table of id's (NUMBER) that the GUI sends it, based on the user's selections.
    Now, I want to use the table's values in my select's where clause to return only the correct records.
    However,
    select ......
    from ....
    where id in (i_array_ids)
    doesn't work of course, and my attempts of transfering the ids to a comma delimited list of numbers (as opposed to a lenghty varchar2 string) that could work between the ( ) have all failed.
    Thanks

    And here's an example I gave with some more up-to-date syntax than in that old AskTom thread:
    Re: DYNAMIC WHERE CLAUSE in PROCEDURE

  • Import Format for Separte Debit and Credit Columns (comma delimited file)

    I have a file that is comma delimited with a sparate debit column and a separate credit column:
    Sample:
    Ent,Acct,description,Dr,Cr
    ,1000,test,100,
    ,110010,another test,,100
    My import format is this:
    Comma delimited
    Field Number Number of Fields Expression
    Entity 1 5 SGB_ABC
    Account 2 5
    Amount 5 5 Script=DRCRSplit_Comma_Del.uss
    I've tried writing the following script to pull the amount from the debit column into the credit column but it just skips the lines with no amount in field 5.
    'Declare Variables
    Dim Field4
    Dim Field5
    'Retrieve Data
    Field4 = DW.Utilities.fParseString(strRecord, 4, 4, ",")
    Field5 = DW.Utilities.fParseString(strRecord, 5, 5, ",")
    'If Field4 has a value then fld 5 is to equal fld 4.
    If IsNumeric(Field5) Then
    Field5 = Field5
    Else
    Field5 = Field4
    End If
    'Return Result into FDM
    SQFLD5 = Field5
    End Function
    Can anyone tell me what I am doing wrong?
    Thanks!

    I got it to work using this script:
    Function DRCR_Comma_Del(strField, strRecord)
    'Hyperion FDM DataPump Import Script:
    'Created By:     testuser
    'Date Created:     7/22/2009 9:31:15 AM
    'Purpose: If Amount is in the DR column move it to the CR amount column.
    Dim DR
    Dim CR
    DR = DW.Utilities.fParseString(strRecord, 5, 4, ",")
    CR = DW.Utilities.fParseString(strRecord, 5, 5, ",")
    If IsNumeric(DR) Then
    strField = DR
    Else
    strField = "-" & CR
    End If
    DRCR_Comma_Del = strField
    End Function

  • SSIS importing comma delimited with double quote text qualifier - Works in VS - SQL Job ignores text qualifier and fails (truncation)

    I've created an SSIS package to import a comma delimited file (csv) with double quotes for a text qualifier ("). Some of the fields contain the delimiter inside the qualified text. An example row is:
    15,"Doe, John",IS2,Alabama
    In SSIS I've specified the text qualifier as ". The sample output in the connection manager looks great. The package runs perfectly from VS and when manually executed on the SSIS server itself. The problem comes when I schedule the package to run via SQL
    job. At this point the package ignores the text qualifier, and in doing so pushes half of a field into the next available column. But instead of having too many columns, it concatenates the last 2 columns ignoring the delimiter. For example (pipes are fields):
    15|"Doe| John"|IS2,Alabama
    So the failure happens when the last half of a field is too large to fit into the next available field. In the case above _John" is 6 characters where the IS2 field is char(3). This would cause a truncation failure, which is the error I receive from the
    job history.
    To further test this I created a failure flow in my data flow to capture the records failing to be pulled from the source csv. Out of ~5000 records, ~1200 are failing, and every one of the failures has a comma delimiter inside the quoted text with a 'split'
    length greater than the next ordinal field. The ones without the comma were inserted as normal and records where the split fit into the next ordinal column where also imported, with the last field being concatenated w/delimiter. Example records when selected
    from table:
    25|"Allan Percone Trucking"|GI6|California --Imported as intended
    36|"Renolds| J."|UI6,Colorado --Field position offset by 1 to right - Last field overloaded
    To further ensure this is the problem, I changed the csv file and flat file connection manager to pipe delimited, and sure enough every record makes it in perfectly from the SQL job execution.
    I've tried comma delimited on the following set ups. Each set up failed.
    SSIS Server 2008 R2 RTM
    DB Server 2008 RTM
    DB Compat 80
    SSIS Server 2008 R2 RTM
    DB Server 2008 R2 RTM
    DB Compat 80
    SSIS Server 2008 R2 RTM
    DB Server 2008 RTM
    DB Compat 100
    SSIS Server 2008 R2 RTM
    DB Server 2008 R2 RTM
    DB Compat 100
    Since a lot of our data comes in via comma delimited flat files, I really need a fix for this. If not I'll have to rebuild all my files when I import them to use pipe delimiters instaed of commas. I'd like to avoid the extra processing overhead if possible.
    Also, is this a known bug? If so can someone point me to the posting of said bug?
    Edit: I can't ask the vendor to change the format to pipe delimited because it comes from a federal government site.

    Just wanted to share my experience of this for anyone else since I wasted a morning on it today.
    I encountered the same problem where I could run the package fine on my machine but when I deployed to a server and ran the package via dtexec, the " delimeter was being replaced with _x0022_ and columns all slurped up together and overflowing columns/truncating
    data etc.
    Since I didn't want to manually hack the DTS XML and can't install updates, the solution I used was to set an expression on the textdelimiter field of the flat file connection with the value "\"" (a double quote). That way, even if the one stored in XML
    gets bodged somewhere along the way, it is overridden with the correct value at run time. The package works fine everywhere now.

  • How to handle comma separated values in OLE DB Source query for a parameter variable from XML file in SSIS

    Hi,
    I am using OLE DB Source to fetch the records with Data Access Mode as SQL COMMAND which is using the below query with a parameter,
    SELECT CON.Title,CON.FirstName,EMP.MaritalStatus,EMP.Gender,EMP.Title AS Designation, EMP.HireDate, EMP.BirthDate,CON.EmailAddress, CON.Phone
    from HumanResources.Employee EMP INNER JOIN Person.Contact CON ON EMP.ContactID=CON.ContactID WHERE EMP.Title in (?) 
    In this query for the parameter I am passing the value from a variable and which is configured (XML Configuration). While passing value
    Buyer it works correctly. But while passing values Accountant,Buyer
    it is not working as expected.
    How to handle while passing such multiple values Or is it possible to pass such values or not in SSIS 2012 ?
    Kindly help me to find a solution.
    NOTE: I placed the whole query in a variable as a expression as below it is working fine.
    "select CON.Title,CON.FirstName,EMP.MaritalStatus,EMP.Gender,EMP.Title AS Designation,EMP.HireDate,EMP.BirthDate,CON.EmailAddress,CON.Phone from HumanResources.Employee EMP
    INNER JOIN Person.Contact CON ON EMP.ContactID=CON.ContactID WHERE EMP.Title in ('" + REPLACE(@[User::temp],",","','")  +"')"
    Any other solution is there ? without placing the query in a variable. May be a variable can have some limitations for no. of characters stored not sure just a thought.
    Sridhar

    Putting the whole thing into a variable is certainly a valid solution.  The other involves putting the comma delimited list into a table valued variable.
    http://gallery.technet.microsoft.com/scriptcenter/T-SQL-Script-to-Split-a-308206f3
    For an odd ball approach: 
    http://www.sqlmovers.com/shredding_multiline_column_using_xml/ .
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

Maybe you are looking for

  • Need help: Can't import old video into Final Cut Pro X or iMovie

    I am trying to import some footage from my old camcorder into my iMac. I have a Sony DVMC-DA1 connected via firewire. The setup works great in iChat. We were able to video chat to my wife's computer and she could see and hear the camcorder footage. i

  • Problem to bb id sing in

    hello when i sing in my bb id by z10 I get a message that : ""unable to sing in to black berry ID.make sure that you have set current date and time and try again."" why?? help me plz

  • Video import from Canon A640 now hanging iPhoto

    Hello, I used to be able to import pictures AND video AVI files from my Canon A640 camera, but since I don't do video that often, at some point (I'm not sure exactly when) when I import into the latest iPhoto it just hangs with the beach ball. If I m

  • Poor print quality HP Photosmart c8180 Printer

    When printer is idle for several hours,  first sheet printed is faint. blurred, streaked. Quality improves on subsequent sheets and will be normal by 2nd, 3rd, or 4th.  Printer is 5 years old.  No problems until recently.      

  • Axis 1.4 web services xmlbeans

    Hi, I just started with using xmlbeans and that part seems all ok. I am currently using axis 1.4 to expose a web service. I extended the AxisServlet class the be able to validate the request message before it reaches the web service. My problem is wh