Ramiz Tariq
Ramiz Tariq

Reputation: 387

How to insert CSV Column values into block and Table using Oracle Forms?

I am using Oracle Database 11gR2 with Oracle Forms and Reports 11gR2.

I created "Browse" Button with "TEXTFIELD". When button press then open dialog box and select "csv" file and "csv" path file will be appear in "TEXTFILED". For this purpose I used "AWTFileDialog.jar" File.

Now I want "CSV" Column values shown into Block and also data save into table when "SAVE" Button pressed.

My Form:

enter image description here

How to achieve this target?

Thanks

Upvotes: 0

Views: 603

Answers (1)

Littlefoot
Littlefoot

Reputation: 142705

I don't know how to do that using Forms. I'm also not sure I'd do it using Forms.

But, I have two other options:

  • SQL*Loader
  • external table (which, in the background, also uses SQL*Loader)

The first option, SQL*Loader, requires you to create a control file (see the documentation, here: https://docs.oracle.com/cd/B28359_01/server.111/b28319/ldr_concepts.htm#g1013706). As it is invoked from command prompt (on a client computer), you'd use HOST (if you're on Forms 6i) or CLIENT_HOST (Webutil) if you're on higher versions to call a batch script which contains the SQLLDR.EXE call.

Another option, external table, works on the database server, as you have to have access to the directory (Oracle object) (i.e. granted read/write privileges on it). As external table represents the input (CSV) file just as if it was an "ordinary" Oracle table, you can write SELECT against it and load data into the target table quite easily.

See if any of those options help, or wait for someone else's opinion.

Upvotes: 1

Related Questions