- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Sqlloader / Sh Shell Script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2003 07:46 PM
тАО05-14-2003 07:46 PM
Sqlloader / Sh Shell Script
SQLLoad < ...... >
this loads data file into my database table.After loading i do lot of process.
But at this point i want to compare no of rows in datafile and database table and ensure that all rows are loaded successfully and then proceed with other process, else i need to throw error EXIT and come out.
How to do this ? Pls help very urgent ....
Thanks!!!!
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2003 08:23 PM
тАО05-14-2003 08:23 PM
Re: Sqlloader / Sh Shell Script
Are your using 9iR1 or up?
If yes, you can try external tables (provides the ability to query a flat file using SQL). With this the need to use sqlldr is lessened. I find the flexibility of SQL over SQLLDR control files to be so useful that I would opt for an external table over sqlldr in most all cases.
This should help fix the problem.
Otherwise, you can compare the log file generated by the load with the number of records processed after each load process.
For example:
the log file will contain a section with the following lines:
...
Table DEPT:
4 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded all fields were null.
....
hope this helps!
Regards
Yogereaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2003 08:26 PM
тАО05-14-2003 08:26 PM
Re: Sqlloader / Sh Shell Script
here is an example of oracle.
u load data file using sqlldr
sqlldr user/passwd controll=file.ctl data=datafile.dat
u will get the datafile.log
datafile.bad
if datafile.bad is zero then all your rows and tables are in tact.
u can check other wise datafile.log it will tell errors reported.
u can compare controlfile.log and datafile.bad and u can find it out.
radhakrishnan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2003 08:35 PM
тАО05-14-2003 08:35 PM
Re: Sqlloader / Sh Shell Script
Thanks for ur reply....
i think i can check for .BAD file and if it doesnt exist then i can assume the table is loaded completely..
am i right ?
Raj !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2003 09:03 PM
тАО05-14-2003 09:03 PM
Re: Sqlloader / Sh Shell Script
when you load the data, make sure to use the BAD=
sqlldr userid=yd/yd@mydb control=load_working.ctl bad=working.bad data=new.bad
After the load, if there are any records in WORKING.BAD, they would be really bad records, records that violated some other constraint, and must be reviewed.
hope this helps!
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2003 10:17 AM
тАО05-16-2003 10:17 AM
Re: Sqlloader / Sh Shell Script
The internal table option allows you to create a table that loads the flat file using sqlldr in a behind the scenes manner. To you it looks like a table, but it is really a flat file.
For example:
create table employees_ext
(employee_id number,
first_name char(30),
last_name char(30),......)
ORGANIZATION EXTERNAL( -- External Table
TYPE oracle_loader -- Access driver
DEFAULT DIRECTORY data_dir -- Files Directory
ACCESS PARAMETERS -- Similar to SQLLDR
( RECORDS DELIMITED BY NEWLINE
FIELDS TERMINATED BY ', '
BADFILE 'bad_emp_ext'
LOGFILE 'log_emp_ext'
MISING FIELDS ARE NULL)
LOCATION ('empl.txt'))
REJCECT LIMIT UNLIMITED;
This example creates a table employees_ext. You can do select count(*) on it and any read operation that you would normally do. Note that the same sqlldr parameters are the same as the access parameters.
So, you can do stuff like:
insert into emp as (select * from employees_ext);
select count(*) into extcount from employees_ext;
select count(*) into empcount from emp;
if extcount <> empcount then
dbms.output.putline('COUNTS DO NOT MATCH');
rowback;
exit;
endif;
This is one of my personal favorite features of 9i.
-Good Luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2003 11:59 AM
тАО05-16-2003 11:59 AM
Re: Sqlloader / Sh Shell Script
:-(
Thanks all.
Raj!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2003 12:00 PM
тАО05-16-2003 12:00 PM
Re: Sqlloader / Sh Shell Script
:-(
Thanks all.
Raj!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2003 12:00 PM
тАО05-16-2003 12:00 PM
Re: Sqlloader / Sh Shell Script
:-(
Thanks all.
Raj!!!