sqlldr - replace "NULL" string value NULL?

I have a file that I'm loading in the CSV format. An example of a record is something like this:

ID, FirstName, MiddleName LastName,
1, R, DOE
2, NULL, such
3, Jim, F, Doe

My problem lies in the 2nd record. The real "NULL" text inserted in the field middlename. I know that I can use this in my control file to replace it with a real null...


MIDDLENAME "REPLACE(:MIDDLENAME,'',)."



However, I can't use as the string "null" could exist somewhere else (if the someone last name was something like "SNULLING"... bad example, I know).
Is it possible in the control file to use an IF statement to determine if the field is only 'NULL '? I'm going to have no chance and would appreciate any help... (I use 11g R2)

Published by: user9036239 on Sep 9, 2010 09:18

Hello BoredBillJ.
You can try

 , middlename  "CASE  :middlename  WHEN  'NULL'  THEN  NULL  ELSE  :middlename  END"

or

 , middlename  "DECODE(:middlename, 'NULL', NULL, :middlename)"

Hope this helps,
Luke

Please check the answer as helpful or response, if it is so. If this is not the case, further clarification.
Try to always provide create table and table insert to help members of the forum to help you.

Tags: Database

Similar Questions

  • Replace the string value of table

    with cte as)

    Select val '123', 'abwec' double val1

    Union of all the

    Select "456" val, "mowerw" double val1

    Union of all the

    Select val '709', 'wkwere' double val1

    Union of all the

    Select val '078', 'awerwewerwreq' double val1

    )

    Select * from cte;

    -incoming string

    "asdasd123ewrwer@87w8eopiu456werwer@asdwer709@ewrwerewrwqqwezxder078 @..."

    need to replace like 'abwec' 123 and 456 as "mowerw" and 709 as wkwere and 078 as 'awerwewerwreq '.

    How to replace the string value of the string

    I'm going to the table which will have mapping information I need to see the incoming string and replace the appropriate value of the val to val1

    something like

    Of

    "asdasd123456werwer@asdwer709@ewrwerewrwqqwezxder078ewrwer@87w8eopiu @..."

    TO

    "asdasdabwecewrwer@87w8eopiumowerwwerwer@asdwerwkwere@ewrwerewrwqqwezxderawerwewerwreq@..."

    By using the TYPE clause.

    with cte as

    (

    Select val '123', 'abwec' double val1

    Union of all the

    Select "456" val, "mowerw" double val1

    Union of all the

    Select val '709', 'wkwere' double val1

    Union of all the

    Select val '078', 'awerwewerwreq' double val1

    ),

    input_tbl

    as

    (

    Select "asdasd123ewrwer@87w8eopiu456werwer@asdwer709@ewrwerewrwqqwezxder078 @..." input_str

    of the double

    )

    Select max (input_str) Dungeon (first order by desc NWR dense_rank) input_str

    de)

    Select rno, input_str

    de)

    Select rownum NWR

    val

    val1

    input_str

    count (*) over() cnt

    from cte

    Cross

    Join input_tbl

    )

    model

    dimension (NWR)

    measures (val, val1, cnt, CAST (input_str AS VARCHAR2 (4000)) input_str)

    (

    input_str [any] = replace (nvl (input_str [cv () - 1], input_str [cv ()]), val [cv ()], val1 [cv ()])

    )

    )

  • Replace NULL values with 0 to Pivot

    Hi all

    I use a union query, I need to display 0 instead of NULL values. I tried various methods such as ifnull(), case; I could see in the table, but not in pivot of 0.
    I tried and succeeded in placing '-' instead of null. If I put a line chart the chart seems meaningless.
    Can someone suggest me this chart & pivot.

    Thanks in advance,
    Jerome

    Hi Leila,

    Hope this link helps you

    [http://total-bi.com/2010/10/replace-nulls-in-obiee-pivot-table/]

    By,.
    KK

  • Find and replace the delimited string value by the

    Hi all

    I have a requirement where I need to find and replace the delimited string values.

    For example, the string is "GL ~ 1001 ~ 157747 ~FEB-13~ CREDIT ~ A ~ N ~ US ~ NULL ~". The 4th column gives the month and year. I need to replace it with the name of the previous month. For example: "GL ~ 1001 ~ 157747 ~JAN-13~ CREDIT ~ A ~ N ~ US ~ NULL ~". I need to do the same thing for the past 12 months.

    I thought initially divide the values and store it in a variable and then after him substituting the value required, join the return.

    I just wanted to know if there is a better way to do it?

    Like this:

    with a model like

    (select "GL ~ 1001 ~ 157747 ~ FEB-13 ~ CREDIT ~ A ~ N ~ $ ~ NULL ~' double UNION ALL data")

    Select ' GL ~ 1001 ~ 157747 ~ JAN-13 ~ CREDIT ~ A ~ N ~ US ~ NULL ~' double data)

    Select

    REPLACE (DATA, TO_CHAR (to_date (substr (data, 16.6), "MON-RRRR"), 'MON - RR'), TO_CHAR (to_date (substr (data, 16.6), "MON-RRRR")-1, 'MON - RR'))

    modeling;

    GL ~ 1001 ~ 157747 ~ JAN-13 ~ CREDITS ~ HAS ~ N ~ US ~ NOTHING ~

    GL ~ 1001 ~ 157747 ~ DEC-12 ~ CREDITS ~ HAS ~ N ~ US ~ NOTHING ~

    Ishan

  • RTF model - replace null with 0

    Hello

    I created an RTF model for burst into BI Publisher. For specific fields I use COUNT/SUM functions, I find here where there is no value returned in a calculation does not return NULL (Blank). Is is possible to replace with 0 instead? I am also using a conditional region where point is equivalent to... and using a COUNT/SUM function to roll up the data.

    I just want to replace NULL values with 0

    Can anyone help?

    Thank you

    Were you able to solve this problem?
    If not send an email with your sample xml and RTF

  • How to use CFPARAM with a list of string values

    Hi all

    I have a field value that can be stored with multiple values for a single record: Work_Order = '555555,666666,111111' (note that these are actually stored as a single string value in the comics with commas.)

    I need to analyze this field and enter a new query clause where the string values:

    < CFSET WOIDS = CapProjects.Work_Order >

    < cfloop condition = "#find(',,',WOIDS) #" >

    < cfset WOIDS = "#rereplace (WOIDS, ',',', null, ',' ALL') #" > < br >

    < / cfloop >

    < cfquery name = "CapProjectsWOIDS" datasource = "#URL. DB #">"
    SELECT [ENGOPSMTRLSID]
    [Work_Order]
    OF ENGOPSMTRLS
    WHERE
    < CFOUTPUT >
    ENGOPSMTRLSID = #URL. INDEX #.
    < / CFOUTPUT >
    AND
    < CFOUTPUT >
    Work_Order in (< cfloop index = list "idx" = "#variables.) WOIDS #">"
    < cfqueryparam
    value = #WOIDS #.
    cfsqltype = "cf_sql_varchar".
    list = 'true '.
    (/ > < / cfloop >)
    < / CFOUTPUT >
    < / cfquery >

    I'm doing this right? I get the following error: error running query database. [Macromedia] [SQLServer JDBC Driver] [SQL Server] Incorrect syntax near '@P4 '. What's the length of the loop? How do I drop?

    Thank you

    John

    First of all, you need not use CFOUTPUT in a CFQUERY (or most / all other CFtags)-CF knows.

    Second, you need not complete a list for an 'IN '.  Unless you use a dark database is not MS - SQL, MySQL or Oracle.  And you already know that CFQUERYPARAM has an attribute from the list.

    NOTE: This assumes that the Work_Order data type is char or varchar, not whole.

    
      SELECT [ENGOPSMTRLSID]
          ,[Work_Order]
      FROM ENGOPSMTRLS
      WHERE  ENGOPSMTRLSID = #URL.INDEX# /* <--- I didn't see URL anything, before this.  And I REALLY cannot stress how bad of an idea it is to use a URL variable for your DSN.  Just sayin'.  */
    AND
      Work_Order in  ()
    
    

    Given that you use for the varchar type, you must put quotation marks around the value (line 08), as I have demonstrated.

    HTH,

    ^_^

  • Replace the text values

    Hello.

    I have problem with replacement of values in text strings and I can't find a solution.

    I have two or three channels filled with only 2 values: OK and NOK. How can I replace these values with for example 1 for OK and 0 for NOK?

    This replacement is necessary for drawing a chart. I can't draw the chart because the tiara do not accept the values of text like a ladder with the current values.

    Thanks in advance :-)

    Hello Domin,

    replaces a substring in a text with another text can be done with VBS 'Replace' function

    The execution of a function on an entire channel can be made using ChnCalculate.

    Combine the two and you get:

    ("ChnCalculate ("ch ()"" statistics text"" "") = Replace (ch ("' statistics text" "" '), '' value' ', "" LLL"") ")

    It is a channel in the DIAdem example data set. The above command executes the command "Replace" for each value of the text string "text of statistics". He replaces each occurrence of 'value' by 'LLL '.

    Hope this helps

    Andreas

  • splitting the query string values

    all,
    I do not remember this, but my problem is that I have a collection of forwarded to my query as string values "X 234234: 23466 X: X 03287: X 457675 ', so my request should be able to divide each data value and use in the filter as below,

    Select * from emp where EmpID in ("X 234234: 23466 X: X 03287: X 457675")

    so, how can I divide each individual value and pass through the filter?

    Thank you.

    SELECT trim(x.column_value.extract('e/text () ')) CLO
    Of
    TABLE (XMLSEQUENCE (XMLTYPE (""
    || REPLACE ('1:2:3:4:6:7:8',': ','
    ')
    || ((("
    ").extract('e/e'))) x

    Try customizing the syntax above using the column in the function replace instead of my hard-coded string and pass it to the filter predicate using an in operator.

    Edited by: Chandrakaanth Ramamurthy on April 25, 2013 16:29

  • Find + replace text (string constant) does not work for screw Statechart module

    Hello

    I tried to do a mass find + replace a string in my code. Using Ctrl + F, LabVIEW 2012 correctly locates all the places where this string exists, including within the States transitions guards who have paths in this form:

    XYZ.lvsciagram.vi / Transition: Guard - diagram, Transition, data/part

    However, when I've specified that a replacement string, then click on 'Replace all', only 'normal' instances of screws replaced - instances in my diagrams had not changed.

    What is going on? Is there anything else I need to do?

    Thanks in advance.

    Looks like those that does not include how to find and replace is implemented in LabVIEW. You can try to replace just the statechart and see if that makes a difference, but it may simply not work.

  • How to use a String function Find() during a Test of a string value?

    Hello

    I intend to match a substring of the string returned by my USE when the use of a string value test - call of VI.

    I write the string returned for a string variable local (Locals.data_read) and tab limits - under the expected string value using Find (Locals.data_read, 'Connected'). When I check the expression to find errors - I get a warning "expected a string number found {comma floating 64}.» This value will cause a runtime error. »

    What Miss me?

    Thank you

    Kech

    Here is an example showing both.

  • Save the alphanumeric string value

    Hello!
    How to save a value to a variable so that I can use it in the future? I have a string of output of a case structure proposed by an OK botton. I want to save the string value when I press the ok botton...
    Thanks in advance
    GM

    Just write the string in a text file.  When you want to use it later, to read the text file.

  • Search and replace the string formatting

    Hello

    I try to do a search and replace the formatting of a string.

    In the example, I'm looking for the string 'SUCCESSFUL', but it must also begin by usbflash and some number + PASSED.

    I can't get the format to have a number between 1 and 99. The number of replacements should add up to 6 in this case. I tried with \d for any number, and I also tried [1-99].

    Make a right-click on the function search and replace the string.  There is an option to use regular Expressions.  Then give it a try.

    EDIT: You need to set the entry replace all to TRUE.

  • Have to reset the flag of string value

    Hello everyone

    I'm trying to reset the flag of string value.

    I use node string indicator property to change the color, its evolution, but when the program runs again it should start default how to do it. Thanks in advance

    Here, it's in 2009

  • Put the string value in a table

    Hello

    Probably an easy question, but I am reading data of a RFID reader that returns a string value of 12 bytes. Whenever a RFID reads, I want the tag to be inserted in a string table on the front panel. So, basically, a newspaper of the each tag [read-> Insert row 0] then [read-> Insert level 1] and so on. I work RFID reader, I don't know how to put the string in the table.

    I'm not sure of the steps necessary to achieve control of the table (or if the table control is the right thing to use).

    Any help would be greatly appreciated. Thank you.


  • replace a string

    is it possible to replace a string? I mean, as in any programming language when you:

    String data = "abc";

    data = 'zxc ';

    I am trying to get the substrings of an initial string like '123.456.789.432.567' separated by the "." character, and when I get "123" at the first iteration, I do not know how to init the second iteration with "456.789.432.567" that I can't change the original string the process gets.

    Thank you

    A quick detour to the String\ vi.llb\Advanced might help a little to that.

    but the Crossrulz method has merit too.

    This period can be a delicate delimiter!

Maybe you are looking for

  • Why content poster that my post has been resolved when he doesn't?

    In my content / author I see this: But the issue is NOT resolved. In the forum of Yosemite, filtered for any unresolved question, I see this: The forums have been pretty difficult to navigate before they have been reworked. They are even more difficu

  • I've just updated to 13.0 and ALL my favorites have disappeared - how to bring them back?

    I've just updated to Firefox 13.0 (I use a MacBook OSX 10.5.8 running). She started very well, but my favorites are now gone. When I opened the menu bookmark is completely empty - as if I just started to use Firefox for the first time. Is there anywa

  • can't connect!

    to a particular user on my MacBook Pro, I constantly get messages to Sign In to iCloud then I put in my password at all times and the message is delivered without interruption until I click on cancel What happens here?

  • Problem starting on my Satellite L50-B-1DZ

    Hello I have problem when I boot from the room as first priority set bios settings, the disc never start, need to install window, but unable to do it,the dvd is bootable and I tried different discs, but result is still the same

  • How can I improve the rate of acquisition with daqmx and usb-6008?

    Hello I am trying to acquire data of analog voltage with a USB-6008. I'm under Labview 8.5 student on an HP laptop with a 1.33 Ghz cpu and 736MB RAM, apparently. I tried using the Daq assistant and the low-level Daqmx functions. My best results come