Import or load DBF file to Oracle

I use this package to import data from dbase file – foxpro (dbf) to oracle table,

–this is spec
CREATE OR REPLACE PACKAGE DBF2ORA
AS
— PROCEDURE TO A LOAD A TABLE WITH RECORDS
— FROM A FOXPRO FILE.

— USES A BFILE TO READ BINARY DATA AND DBMS_SQL
— TO DYNAMICALLY INSERT INTO ANY TABLE YOU
— HAVE INSERT ON.

— P_DIR IS THE NAME OF AN ORACLE DIRECTORY OBJECT
— THAT WAS CREATED VIA THE CREATE DIRECTORY
— COMMAND

— P_FILE IS THE NAME OF A FILE IN THAT DIRECTORY
— WILL BE THE NAME OF THE FOXPRO FILE

— P_TNAME IS THE NAME OF THE TABLE TO LOAD FROM

— P_CNAMES IS AN OPTIONAL LIST OF COMMA SEPARATED
— COLUMN NAMES. IF NOT SUPPLIED, THIS PKG
— ASSUMES THE COLUMN NAMES IN THE FOXPRO FILE
— ARE THE SAME AS THE COLUMN NAMES IN THE
— TABLE

— P_SHOW BOOLEAN THAT IF TRUE WILL CAUSE US TO JUST
— PRINT (AND NOT INSERT) WHAT WE FIND IN THE
— FOXPRO FILES (NOT THE DATA, JUST THE INFO
— FROM THE FOXPRO HEADERS….)
PROCEDURE LOAD_TABLE (
P_DIR IN VARCHAR2,
P_FILE IN VARCHAR2,
P_TNAME IN VARCHAR2,
P_CNAMES IN VARCHAR2 DEFAULT NULL,
P_SHOW IN BOOLEAN DEFAULT FALSE
);
END DBF2ORA;
/

Continue reading

Advertisements

Create or Export data from MDB to DBF

To export data that have been query by “SELECT … FROM” in mdb file to dbf file, you can use this sample query :

SELECT * INTO [dBase IV;database=C:\].newdbf FROM bank