Home » Developer & Programmer » Forms » Read and Write File using Oracle Form 6i (Oracle Form 6i)
Read and Write File using Oracle Form 6i [message #531512] Wed, 16 November 2011 06:53 Go to next message
m3nhaq
Messages: 20
Registered: September 2011
Location: Pakistan
Junior Member
Hi,
I have a file studnet.txt in following order
JAMs|1231|PHYSICS
SAM|1232|PHYSICS
ALI|1233|CHEMISTRY

I want to read and write data from a file in | seprated mode. Kindly help me to do so. Please give me any link of Tutorial about file READ and WRITE using Oracle Forms6i.
I have a knowledge of file handling in C++ but not use it in Oracel Form before this.

Please Guide me.

THanks.
Re: Read and Write File using Oracle Form 6i [message #531567 is a reply to message #531512] Wed, 16 November 2011 15:34 Go to previous messageGo to next message
Littlefoot
Messages: 21815
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
SQL*Loader is designed to load such files into an Oracle database, not Forms. Why wouldn't you use that product instead?
Re: Read and Write File using Oracle Form 6i [message #531596 is a reply to message #531567] Wed, 16 November 2011 23:36 Go to previous messageGo to next message
m3nhaq
Messages: 20
Registered: September 2011
Location: Pakistan
Junior Member
Actually I have to import that file in to my system using Oracle Form Interface.

I try to use SQL*Loader but not able to succeed. I found that SQL*Loader is considered as Server Side Utility, so best it to run from server not from Client side.

Please share any tutorial link to study FILE input/output and SQL*Loader.

Please help Sad

[Updated on: Thu, 17 November 2011 01:37]

Report message to a moderator

Re: Read and Write File using Oracle Form 6i [message #531609 is a reply to message #531596] Thu, 17 November 2011 01:29 Go to previous messageGo to next message
Littlefoot
Messages: 21815
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't have any tutorial, but official SQL*Loader documentation is behind that link.

One option would be to create a control file, create an operating system batch file (.BAT on MS Windows) that would call SQLLDR from the command line and use previously created control file. Call that .BAT from a form using HOST (or, alternatively, CLIENT_HOST) built-in.
Re: Read and Write File using Oracle Form 6i [message #531614 is a reply to message #531609] Thu, 17 November 2011 01:52 Go to previous messageGo to next message
m3nhaq
Messages: 20
Registered: September 2011
Location: Pakistan
Junior Member
Here is my data file imdb_top_250.csv
7782|CLARK|MANAGER|7839|2572.50|10
7839|KING|PRESIDENT|5500.00|10
7934|MILLER|CLERK|7782|920.00|10
7566|JONES|MANAGER|7839|3123.75|20
7499|ALLEN|SALESMAN|7698|1600.00|300.00|30
7654|MARTIN|SALESMAN|7698|1312.50|1400.00|30
7658|CHAN|ANALYST|7566|3450.00|20
7654|MARTIN|SALESMAN|7698|1312.50|1400.00|30


Here is my control file imdb_top_250.ctl
load data 
infile "imdb_top_250.csv" badfile "imdb_top_250.bad" discardfile "imdb_top_250.dsc"
insert
into table imdb_top_250
FIELDS TERMINATED BY '|' TRAILING NULLCOLS
(
empno, 
name, 
job, 
mgr, 
sal, 
comm, 
deptno
)


Here is my command file imdb_top_250.bat
sqlldr abl1/abl1@p5 control=imdb_top_250.ctl log=imdb_top_250.log
pause


I am geting following Error
E:\PracticeWork\SQLLoader>imdb_top_250.bat

E:\PracticeWork\SQLLoader>sqlldr abl1/abl1@p5 control=imdb_t
op_250.ctl log=imdb_top_250.log
'sqlldr' is not recognized as an internal or external command,
operable program or batch file.

E:\PracticeWork\SQLLoader>pause
Press any key to continue . . .

E:\PracticeWork\SQLLoader>

Re: Read and Write File using Oracle Form 6i [message #531616 is a reply to message #531614] Thu, 17 November 2011 01:59 Go to previous message
Littlefoot
Messages: 21815
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It appears that you don't have SQL*Loader installed, do you? If you do have it, then the PATH system variable doesn't contain its directory and the system is unable to find the executable, but that most probably means that installation didn't end up correctly.

SQL*Loader can be installed from the Client CD (i.e. Developer Suite installation doesn't contain it), or is installed along with the database installation. If SQL*Loader is all you need, run the universal installer, go to custom installation and choose that utility only. Software can be downloaded, as usually, from the Oracle Technology Network.

[Updated on: Thu, 17 November 2011 01:59]

Report message to a moderator

Previous Topic: Oracle Forms Builder \ Object Navigator \ Reports
Next Topic: Calling a .Net module from Oracle Forms and Control back to Form Again
Goto Forum:
  


Current Time: Thu Aug 01 08:48:55 CDT 2024