Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sqlldr with a function

francy77Aug 27 2019 — edited Aug 27 2019

Hi all,

i've googled about it, but wasn't able to find a good example.

i have a file and i need to load in a table using sqlldr, but there is a particular requirement.

this is the file:

CAP;Comune;SiglaProvincia

00010;CASAPE;RM

00010;GALLICANO NEL LAZIO;RM

and i want to load this file in a table like this:

create table cappario(

     id number primary key,

     CAP varchar2(10),

     Comune varchar2(35),

     Sigla_Provincia varchar2(2),

comune_no_acc varchar2(45)

);

where id is a primary key generated by a sequence, CAP;Comune;SiglaProvincia are the field separated by a ";"  and comune_no_acc should be a function

that takes comune as input and apply this query :

SELECT REGEXP_REPLACE(comune, '[^0-9A-Za-z]', '')   FROM CAPPARIO; 

Is there a way I can accomplish this?

thanks

Comments
Post Details
Added on Aug 27 2019
7 comments
1,986 views