How can I validate the data in the control file?
Consider that the SQLLoader reads the data entry of the path file and loads the data in the base tables up on top of the description specified in the control file.First, the form is created:
create table sql_loader_1 (load_time date, digital Champ_1, Champ_2 varchar2 (10))
Example of control file:
load_1.CTL
load data
INFILE "load_1.dat", "str"\r\n"
insert into table sql_loader_1
(
load_time sysdate,
Champ_2 position (01:10).
Champ_1 position(11:20)
)
Note that positions 11 to 20 are loaded in positions 1 to 10 in Champ_2 and Champ_1. The load_time field is filled with time current (sysdate) load.
Here is the data. The name of the file (load_1.dat) had been specified with the statement for infile in the control file.
load_1.dat
0123456789abcdefghij
**********##########
foo bar
This is a very long line
and the next one is
short
declared the Champ_1 as a numeric data type, but the input data file contains the data "Sue"(position 11:20) so the sql loader adds not the record to the database instead the record is written in the bad file. But I want to validate the data of the "(position 11:20) is digital or not." How can I post this in the control file itself? If it is not possible, how can I validate it in the database? give me a sample code to explain this
Here are two ideas.
Idea 1: This control file will check to see if the data to be loaded in Champ_1 contains a number (including the negative and decimal).
load data
infile 'load_1.dat' "str '\r\n'"
insert into table sql_loader_1
(
load_time sysdate,
field_2 position( 1:10),
field_1 position(11:20) "decode(trim(translate(:field_1,'-0123456789.',' ')),null,:field_1,-999)"
)
If Champ_1 is a number or null, it is passed through, as is. If there is no numeric characters (in addition to '-'and'.') a distinct value-999 will be inserted for you allow to load the rest of the columns and easy to see the lines had data that cannot be loaded in Champ_1. This idea has its flaws (a string like "... ("will always drain the .bad file)
Idea 2: Load the data into a staging table first (or define an external table) where all columns are VARCHAR2. Then use SQL or PL/SQL to validate data in the staging table in your process to move the data into the table with the actual data types.
Tags: Database
Similar Questions
-
I have music in a cd rw. How can I delete the music file.
I have music in a cd rw. How can I delete the music file.
Open the disk, click with the button straight on delete?
-
How can I have the binary file for BIOS for HP G62-b53SE?
Hello
How can I have the binary file for BIOS for HP G62-b53SE?
My bios of the laptop is damaged and I need the BIOS file in binary mode
Help me please
Thank you.
Ilmaz wrote:
Hello
How can I have the binary file for BIOS for HP G62-b53SE?
My bios of the laptop is damaged and I need the BIOS file in binary mode
Help me please
Thank you.
Hello
Download the BIOS.exe file from here: http://ftp.hp.com/pub/softpaq/sp55001-55500/sp55430.exe
Then rename it to sp55430.zip or simply extract the exe using WinRAR. The binary file is called: 01439.fd. Rename it to 01439.bin if you need...
-
When a file turns to an ink file, how can I recover the functional file
When a file turns to an ink file, how can I recover the operational files. ??
Right-click on the link, check the location of the open file, find the file and either make a new shortcut or double-click the executable.
-
How can I access the control panel?
Original title - Control Panel
How can I access the control panel?
Hello
Press Windows key + I when you are on the desktop and click on Control Panel option from the control panel side, called charm so open. This will take you to the Control Panel.Hope this helps, good luck :) -
How can I find the hidden files in Windows 8
How can I find the hidden files in windows 8... Explorer 10. 64 bit?
Moved from feedback
Original title: the HIDDEN FILES
How can I find the hidden files in windows 8... Explorer 10. 64 bit?
Moved from feedback
Original title: the HIDDEN FILES
(1) open a file at the office or anywhere... then click on view tab and do the following...
(2) you can view it by using a command prompt
Open a command prompt and Type attrib - a s h - r "filepath:\Your file name".(3) otherwise you can use a third-party tool like http://www.xyplorer.com/index.php
-
I need a file to an exact width and height and it must be in png format, because it allows to translucency. My graphics are only the top of the page and when I export only the graph is not exported the entire file. How can I get the entire file of export including blank parts?
in the export dialog box, you have chcked 'use of work plans? ''
-
How can I view the Photoshop files on my Mac to my iPad and iPhone?
How can I view the Photoshop files on my Mac to my iPad and iPhone? I am new to Adobe products and understand with the latest version creative Cloud is no longer does.
Hi leonoraw51296428,
It is not possible to synchronize files from the computer to your phone.
Then I suggest you to download and install the Application Photoshop (Photoshop Mix, or Photoshop Fix) on your phone.
Kind regards
Tanuj
-
When I drag a file audio and video of the source on the timeline monitor, only the video file is transferred. How can I move the two files on the timeline? Adobe first Pro 2015 CC only!
Please make sure that the audio and video tracks are highlighted.
-
How can I open the RAW files in Photoshop CS4 to Canon EOS 6 d camera?
How can I open the RAW files in Photoshop CS4 to Canon EOS 6 d camera?
You can't directly but can use DNG Converter to convert your files so ACR can read and process the.
-
I'm trying to install Acrobat 8 Standard on a PC with Windows 7, 64 bit. During installation, you asked me to provide 'File PDF.dll Adobe for Windows Vista'. How can I get the required file?
Hi Alan Horan.
This link appears corresponding to your query, please visit this link ( error "the file AdobePDF.dll is needed" |) CS3 | 64 - bit Windows ) and let me know if you face any problem.
Kind regards
Rahul Tyagi -
When I drag a file audio and video of the source on the timeline monitor, only the video file is transferred. How can I move the two files on the timeline? Thank you for your help in advance
You must set the source patch:
-
I just bought Elements 8 online. How can I get the exercise files? Thank you!
I just bought Elements 8 online. How can I get the exercise files? Thank you!
Do you mean the exercise files that are given with PSE8 box?
-
I have Vista and Windows Movie Maker. I created a movie and he sent an email, but the recipient could not open. The message was that it was an unsupported file type. How can I help them?
The file is a MSWMM. When I emailed the file to others they cannot open it because the message indicates that it is an unsupported file Type. How can I email the film so that my e-mail recipients can open it?
===================================
The .mswmm file is project Movie Maker file... it's
is useful for a re-issue of the project.To create a file .wmv video that your recipients can view
You must publish the project.Take a look at the following article:
Windows Vista-
Publish a movie in
Windows Movie Maker
http://Windows.Microsoft.com/en-us/Windows-Vista/publish-a-movie-in-Windows-Movie-Maker John Inzer - MS - MVP - Digital Media Experience - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *. -
How can I get the .psd files to overprint in Illustrator cs5?
Hello
I have a client Illustrator file. It has a placed image .psd (flower) and they did an another psd file as a strong support of the form even color of the flower psd. The solid is where a spot vanish will be printed on top of the flower. How can I get the solid spot psd to overprint so that I can make a single pdf with all 4 color an tone?
Thank you
Thanks for the input guys.
What I could do was select the image in Illustrator, make vectorization, remove white background, complete with the image with the color of the task vanish and place it to overprint.
The goal was to get a pdf file that included the four colors and spot varnish without anything to be eliminated.
Maybe you are looking for
-
How to upgrade my 256 MB RAM on the Satellite 2450-201?
How to upgrade my 256 MB RAM on my Toshiba Satellite 2450 201? Where is the RAM located on it?
-
Avoid the button clicks duplicated in the structure of the event
Hello I have an apparently easy problem that I can't solve. I enclose a VI that illustrates my problem. My problem is this: when an event runs, the OK button is disabled, but if the user clicked the event is pending, and when the process is finished,
-
What happens when ClearTask is never called?
I use a NOR-6259 with the C API of Linux. What happens when a task program is interrupted and the ClearTask function is never called? Is it possible to query the driver for all running tasks, or better yet, is it possible I can assure that the device
-
When connecting line power screen bright decreeses, when I disconnect light increases. (Bright increases with the power of the battery). How can I adapt this function?. Thank you very much.
-
How to reinstall xp home edition? It came with no disk__ restart
It is bogged down and I want to restore the computer to its factory settings and to clean the disc for my husband to use. I've defragged and clean the disc until I'm blue in the face and it has not solved the problem.