SQL Loader and foreign characters in the data file problem

Hello,
I have run into an issue which I can't find an answer for. When I run SQL Loader, one of my control files is used to get file content (LOBFILE) and one of the fields in the data file has a path to that file. The control file looks like:
LOAD DATA
INFILE 'PLACE_HOLDER.dat'
INTO TABLE iceberg.rpt_document_core APPEND
FIELDS TERMINATED BY ','
doc_core_id "iceberg.seq_rpt_document_core.nextval",
-- created_date POSITION(1) date "yyyy-mm-dd:hh24:mi:ss",
created_date date "yyyy-mm-dd:hh24:mi:ss",
document_size,
hash,
body_format,
is_generic_doc,
is_legacy_doc,
external_filename FILLER char(275) ENCLOSED by '"',
body LOBFILE(external_filename) terminated by EOF
A sample data file looks like:
0,2012-10-22:10:09:35,21,BB51344DD2127002118E286A197ECD4A,text,N,N,"E:\tmp\misc_files\index_testers\foreign\شیمیایی.txt"
0,2012-10-22:10:09:35,17,CF85BE76B1E20704180534E19D363CF8,text,N,N,"E:\tmp\misc_files\index_testers\foreign\ลอบวางระเบิด.txt"
0,2012-10-22:10:09:35,23552,47DB382558D69F170227AA18179FD0F0,binary,N,N,"E:\tmp\misc_files\index_testers\foreign\leesburgis_á_ñ_é_í_ó_ú_¿_¡_ü_99.doc"
0,2012-10-22:10:09:35,17,83FCA0377445B60CE422DE8994900A79,binary,N,N,"E:\tmp\misc_files\index_testers\foreign\làm thế nào bạn làm ngày hôm nay"
The problem is that whan I run this, SQL Loader throws an error that it can't find the file. It appears that it can't interpret the foreign characters in a way that allows it to find that path. I have tried adding a CHARACTERSET (using AL32UTF8 or UTF8) value in the control file but that only has some success with Western languages, not the ones listed above. Also, there is no set of defined languages that could be found in the data file. It essentaially could be any language.
Does anyone know if there is a way to somehow get SQL Loader to "understand" the file system paths when a folder and/or file name could be in some other langauge?
Thanks for any thoughts - Peter

Thanks for the reply Harry. If I try to open the file in various text editors like Wordpad, Notepad, GVIM, andTextpad, they all display the foreign characters differently. Only Notepad comes close to displaying the characters properly. I have a C# app that will read the file and display the contents and it renders it fine. If you look at the directory of files in Windows Explorer, they all are displayed properly. So it seems things like .Net and Windows have some mechanism to understand the characters in order to render them properly. Other applications, again like Wordpad, do not know how to render them properly. It would seem that whatever SQL Loader is using to "read" the data files also is not rendering the characters properly which prevents it from finding the directory path to the file. If I add "CHARACTERSET AL32UTF8" in the control file, all is fine when dealing with Western langauges (ex, German, Spanish) but not for the Eastern languages (ex. Thai, Chinese). So .... telling SQL Loader to use a characterset seems to work, but not in all cases. The AL32UTF8 is the characterset that the Oracle database was created with. I have not had any luck if I try to set the CHARACTERSET to whatever the Thai character set is, for example. There problem there though is that even if that did work, I can't target specific lagauages because the data could come from anywhere. It's like I need some sort of global "super set" characterset to use. It seems like the CHARACTERSET is the right track to follow but I am not sure, and even if it is, is there a way to handle all languages.
Thanks - Peter

Similar Messages

  • SQL*Loader . A column value in data file contains comma(,)

    Hi Friends,
    I am getting an issue while loading a csv file to database.
    A column in datafile contains a comma .. how to load such data?
    For ex, a record in data file is :
    453,1,452,N,5/18/2006,1,"FOREIGN, NON US$ CORPORATE",,,310
    Here "FOREIGN, NON US$ CORPORATE" is a column and contains a , in the value.
    I have specified optionally enclosed with " also.. but still not working
    Here is my control file:
    options (errors=100)
    load data
    infile 'TAX_LOT_DIM_1.csv'
    badfile 'TAX_LOT_DIM_1.bad'
    replace
    into table TAX_LOT_DIM
    fields terminated by ',' optionally enclosed by '"'
    trailing nullcols
    TAX_LOT_DIM_ID ,
    TAX_LOT_NBR ,
    TAX_LOT_ODS_ID ,
    RESTRICTION_IND ,
    LAST_UPDATE_DTM ,
    TRAN_LOT_NBR integer,
    MGR_GRP_CD optionally enclosed by '"' ,
    RESTRICTION_AMT "TO_NUMBER(:RESTRICTION_AMT,'99999999999999999999.999999999999')" ,
    RESTRICTION_INFO ,
    SRC_MGR_GRP_CD
    Problem is with MGR_GRP_CD column in ctrl file.
    Please reply asap.
    Regards,
    Kishore

    Thanks for the response.
    Actually my ctrl file is like this with some conversion functions:
    replace
    into table TAX_LOT_DIM
    fields terminated by ',' optionally enclosed by '"'
    trailing nullcols
    TAX_LOT_DIM_ID "TO_NUMBER(:TAX_LOT_DIM_ID ,'999999999999999.99999999')",
    TAX_LOT_NBR ,
    TAX_LOT_ODS_ID "to_number(:TAX_LOT_ODS_ID ,'999999999999999.999999')",
    RESTRICTION_IND ,
    LAST_UPDATE_DTM "to_date(:LAST_UPDATE_DTM ,'mm/dd/yyyy')",
    TRAN_LOT_NBR integer, --"TO_NUMBER(:TRAN_LOT_NBR,'999999999999999.99999999999999999')",
    MGR_GRP_CD char optionally enclosed by '"' ,
    RESTRICTION_AMT "TO_NUMBER(:RESTRICTION_AMT,'99999999999999999999.999999999999')" ,
    RESTRICTION_INFO ,
    SRC_MGR_GRP_CD
    For char columns , even i dont give any datatype, i think it will work.
    And pblm is not with this hopefully.
    Thanks,
    Kishore

  • How to refer the SQL*Loader command line parameters in the control file

    The problem I am trying to resolve is to insert the input file name when SQL*Loader is loading the record from the file. I have multiple files to load and it is nice to associate a record with a particular input file.

    Create the control file dynamically (and fill one of the columns with the file name as a constant) before you start SQL*Loader
    Another option is to use external tables
    Re: Data Loading
    Message was edited by:
    Jens Petersen

  • SQL Loader: refer datafile name in the control file

    Hi All:
    Database: 10GR2
    I have a table as following:
    test (
    filename varchar2(100),
    mydata varchar2(1000)
    I am using sql loader to populate data for this table. I also need store the datafile name to column test.filename as part of dataload. How to refer datafile name in the control file?
    Again, I am processing multiple files in a batch mode. I need store datafile name in filename column so that I can know which "mydata" come from which datafile.
    Thanks in advance!
    Kevin

    As Bravid says, you can't do that from within SQL*Loader, unless the control files are dynamically generated by a script and the filename included as the default value for that particular column as a hardcoded literal.
    It's easier if you use external tables as the table definition contains the "location" which is the list of filenames it is accessing, and the value can be queried as well as being dynamically changed (though if you're dynamically changing it, then you'll programatically know the filename anyway. hint hint!)
    ;)

  • Strange-shaped fonts and unreadable characters in the PDF file

    Hello,
    A colleague of mine printed out a PDF file that I generated. Some of the fonts in the printed PDF file appear out-of-shape (slightly squiggly but still readable). These fonts are in plain body text and some of the heading styles. In addition, unreadable characters appear for fonts in the PDF where a keyboard input character format was specified in the source (in Framemaker a different character format can be specified for individual words within a paragraph format).
    He printed this PDF file a total of eight times. For the first five times there were no issues, but in the last three times the problems occured.
    He printed the files from the same printer and some of the printing was with the PCL profile, while others were with the PS profile.
    My colleague viewed the files using Adobe Reader 8 running on Windows XP.
    My PC is also Windows XP. The document source is FrameMaker 7.2. When generating the file, I used Acrobat Distiller 8.0. It is compatible with Acrobat 5.0 (PDF 1.0). The Acrobat Reader I have on my PC is Acrobat 8.0.
    Thanks,
    Ken

    I'm using acrobat 8.1.0 and I believe I have the same problem as Ken.
    However, I have a question. If the fonts simply weren't installed, wouldn't they also appear as weird characters when looking at a soft copy in acrobat? Why would the problem only occur when printing?

  • Sql Loader and carriage returns

    I am currently trying to use sql loader to load data from flat files that was extracted from sybase using bcp and delimited with pipes. There are text and varchar columns that contain carriage return line feeds. I want to preserve these, but I can not load them into Oracle 8.05 using sql loader as it interprets them as end of record indicators. Does anyone have a way to solve this problem? Any assistance would be appreciated.
    Thanks in advance,
    Jignesh

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • SQL *Loader and External Table

    Hi,
    Can anyone tell me the difference between SQL* Loader and External table?
    What are the conditions under we can use SQL * Loader and External Table.
    Thanx

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • SQL-Loader and Pipes

    I have to insert 300.000.000 datasets (generated dynamically by a seperate process) into an Oracle 8.1.6 database. I'd like to do this via SQL-Loader but since Linux (kernel 2.2 at least) supports only files up to 2Gigs and I don't have the necessary space on my machine to generate a large amount of ASCII files I'd like to ask whether there is a possibility to use an ordinary pipe in combination with SQL-Loader. I tried to use a named pipe but all my attempts failed.
    I don't like to use Perl and the DBI module since this would be far so slow (would take about one week I guess).
    Hans

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • Sql loader and Store Prrocedures

    Hi!!
    I ned load text files with sql loader first at temporal tables,later on put this in tables with Stored Procedures in one data base Oracle 8.1.5.
    My sqlldr version is 8.1.6 and not4s compatible with 8.1.5 of the data base server.
    How can i load the files?
    Thank4s

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • Sql*Loader and Conc. Mgr.

    I would like for our users to submit a request (in GL) that will run sql*loader to load a file of their choosing to an oracle table. Oracle tells me I must use their consulting arm for this kind of question. Does anyone have any ideas on how to do this?

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • SQL LOADER / INFILE filename as variable in .ctl file

    I stumbled over several threads in the OTN-forums regarding this problem, but neither was it finaly solved nor did I find a FAQ that answered my question. Soooo:
    We get several datafiles from several sources and process them via SQL Loader and store 'em in the DB.
    This is done via a CHRON job and a PERL skript, for all datafiles in a specific directory.
    We need the information which file on which date generated the data INSIDE the DB as well.
    So I want to store the filename || SYSDATE combination as well.
    I know, I could parse the .ctl file and replace a key-string with the actual filename and so have it in the input.
    But this seems a bit dirty to me. Isn't there some way, i.e. a keyword or variable for the infile-filename within the SQLLoader that I can access in the .ctl file? Something like:
    INTO TABLE processed_files
    FIELDS TERMINATED BY ';'
    WHEN LOWER(LTRIM(RTRIM(hdr_ftr))) = 'ftr' -- FOOTER??
    (hdr_ftr VARCHAR2(100),
    source INFILE||' on '||TO_CHAR(SYSDATE, 'MM/DD/YYYY'),
    realm VARCHAR2(100),
    version VARCHAR2(20)
    I would be greatfull if you?d share your wisdom with me. ;-))
    Oliver

    I passed this quite similar to 'Ask Tom' and got the advice to put the .ctl's content as a string variable into a Shell skript.
    This shell skript (which had to be written anyway to loop over the datafiles an subsequently call the sqlldr) should then replace the INFILE parameter and the CONSTANTs for the filenames and generate a 'temporarry' .ctl before calling sqlldr!
    That's it, no better and safer way!

  • Where are the data files?

    Hi,
    I'm completely new to Berkeley db and i have some basic questions regarding architecture which i couldnt find in docs. Where does BDB store its data? Is there a default file location? Also, is there a way i can specify maximum file size? I'm developing an application which will store many giga bytes of data and I dont want the data files to grow above the OS limit. I'm using windows as the OS.
    regards,

    Hello,
    This question is probably deserving of its own thread, but I'll answer briefly here. As you've noted, BDB XML itself it designed and tuned to storage and query of XML. Because BDB XML is built on Berkeley DB, you can use DB proper transactionally along with BDB XML. In an application such as yours, you could store XML in BDB XML, and create (application-provided) references between those documents and other data stored in Berkeley DB. In addition, you might want to store some data in regular files (streaming video, large binary data, etc).
    You can store binary data in BDB XML as either document metadata or encoded into ascii, but for the scale you want I would not recommend that approach.
    Regards,
    George

  • SQL Loader and the bad file

    I use SQL Loader to read a file into a table. In my tests a lot of rows are rejected and written to the bad file. But there are no error messages.
    Is there a way to find out why the row was rejected.

    The Bad File
    The bad file contains records that were rejected, either by SQL*Loader or by the Oracle database server. Some of the possible reasons for rejection are discussed in the next sections.
    SQL*Loader Rejects
    Datafile records are rejected by SQL*Loader when the input format is invalid. For example, if the second enclosure delimiter is missing, or if a delimited field exceeds its maximum length, SQL*Loader rejects the record. Rejected records are placed in the bad file.
    Oracle Rejects
    After a datafile record is accepted for processing by SQL*Loader, it is sent to the Oracle database server for insertion into a table as a row. If the Oracle database server determines that the row is valid, then the row is inserted into the table. If the row is determined to be invalid, then the record is rejected and SQL*Loader puts it in the bad file. The row may be invalid, for example, because a key is not unique, because a required field is null, or because the field contains invalid data for the Oracle datatype.
    YOU WILL get more information
    sqlldr help=y
    also send your control file syntax
    kuljeet pal singh

  • Import and process larger data with SQL*Loader and Java resource

    Hello,
    I have a project to import data from a text file in a schedule. A lager data, with nearly 20,000 record/1 hours.
    After that, we have to analysis the data, and export the results into a another database.
    I research about SQL*Loader and Java resource to do these task. But I have no experiment about that.
    I'm afraid of the huge data, Oracle could be slowdown or the session in Java Resource application could be timeout.
    Please tell me some advice about the solution.
    Thank you very much.

    With '?' mark i mean " How i can link this COL1 with column in csv file ? "
    Attilio

  • When I save a pages document as a pdf and then try to email the document, it loads as an application octet-stream dat file instead of a pdf. What's happening?

    When I save a Pages document as a pdf and then try to email the document, it loads as an application octet-stream dat file instead of a pdf and recipients can't open it. Some load correctly, but about half don't load as a pdf. What's happening?

    Hi mjmonck-
    Which email provider are you using? There are different solutions possible for different providers. Yahoo is having trouble with attachments, outside of any Firefox issue. I've seen a Google user fix this by manually adding the mail URL to their ad block program- which mistakenly perceived the webmail page as an advertisement.
    Hope this helps.

Maybe you are looking for

  • Exporting as a PDF - white grainy line appears around object

    When I export as a PDF a white grainy line appears around an object where I've used a gaussian blur? why is this?

  • How can I erase my call/SMS history on the website...

    I really need to erase my call and SMS history on the website, they keep my history for 6 months, but I really need to erase it all now. Thanks in advanced

  • Keyword hierarchy auto fill

    Hi! I wonder if anyone else is experiencing what I perceive to be a bug in LR4.1. Having recently upgraded from LR2.7 (which was considerably faster in performance than this version btw) I notice that the keyword autofill feature does not work when e

  • Strange .dmg showing in Disk Utility

    I just noticed this disk image: I followed the file path and found a locked folder. Only system has read/write access, no one else does. I checked my MBP with Mavericks and found the same folder; however, in Mavericks, it is not showing in Disk Utili

  • Why I can't connect to Oracle Enterprise Manager via browser after install?

    I've installed Oracle9iAS Release2(9.0.2) with Windows 2000 server (servicepack3) and Oracle9i database on the same host.After installation, I can use Oracle enterprise manager(via browser) by connect as "ias_admin" and "12345" for password (It's a p