- What is Dynamic PSP?
- What are the differences between Oracle PSP and Dynamic PSP?
- Why not use JSP?
- Why Oracle still supports PL/SQL when they integrated Java into Oracle RDBMS?
- How To Secure Dynamic PSP Development Interface?
- How to enable native PL/SQL compilation in 9i Release 2 on Windows?
- I am unable to login into Unit Commander using default account.
- What is WebDAV?
- How to avoid redirection from index.html to DPSP unit?
- Java class to convert xls to csv or from MS Excel to CSV file into PL/SQL and upload data from .xls file to Oracle
- Java class to convert from DBF (DB2) to CSV file within Oracle PL/SQL
Java class to convert from DBF (DB2) to CSV file within Oracle PL/SQL
* nn$dbf2csv.dbf2csv
*
* Java Utility class for convert DBF file to CSV file
* and upload data from .csv file to Oracle Database
* Copyright(c) 2000-2007 by Andrew Toropov All rights reserved.
* Written by Andrew A. Toropov
*
>loadjava -v -u user/pass@[TNSNAME] -r dbf2csv.jar
>sqlplus user/pass@[TNSNAME] @dbf2csv.sql
>sqlplus user/pass@[TNSNAME]
sql>
set serverout on
declare
Path varchar2(1000) := '/temp/'; -- directory with perms
DFBFile varchar2(1000) := 'DFBFile.dbf';
CSVFile varchar2(1000) := 'CSVFile.csv';
Fine varchar2(1000);
begin
Fine :=
nn$dbf2csv.dbf2csv(Path||DFBFile, Path||CSVFile, ';');
dbms_output.put_line(substr(Fine,1,255));
end;
/
/temp/'CSVFile.csv
> sqlplus "sys/[password]@[TNSNAME] as sysdba"
sql>
begin
dbms_java.grant_permission('USER',
'SYS:java.io.FilePermission',
'/temp/-',
'read,write,delete');
end;
CREATE OR REPLACE DIRECTORY AS '/temp/';
GRANT READ ON DIRECTORY TO user;
GRANT WRITE ON DIRECTORY TO user;
GRANT DELETE ON DIRECTORY TO user;
/
>sqlplus user/pass@[TNSNAME]
sql>
declare
Path varchar2(1000) := '/temp/'; -- directory with perms
DFBFile varchar2(1000) := 'DFBFile.dbf';
CSVFile varchar2(1000) := 'CSVFile.csv';
Fine varchar2(1000);
begin
Fine :=
nn$dbf2csv.dbf2csv(Path||DFBFile, Path||CSVFile, ';');
execute immediate Fine;
end;
>sqlplus user/pass@[TNSNAME]
sql>
select * from NNDBF$DFBFile;
|