I have been asked to write code in Oracle Forms that reads data from a file in the “middleware” (application server) rather than on the client side. The purpose is to hold an encryption key in a place where people won’t stumble upon it.
I know I can use TEXT_IO package to read a file on the client side, but is there something similar to read files on the other side?
Version details:
Forms [32 Bit] Version 10.1.2.3.0 (Production) Oracle Toolkit Version
10.1.2.0.2 (Production) PL/SQL Version 10.1.0.5.0 (Production) Oracle Procedure Builder V10.1.2.3.0 – Production PL/SQL Editor (c) WinMain
Software (www.winmain.com), v1.0 (Production) Oracle Query Builder
10.1.2.3.0 – Production Oracle Virtual Graphics System Version 10.1.2.0.2 (Production) Oracle Tools GUI Utilities Version 10.1.2.0.2 (Production) Oracle Multimedia Version 10.1.2.0.2 (Production) Oracle
Tools Integration Version 10.1.2.0.2 (Production) Oracle Tools Common
Area Version 10.1.2.0.2 Oracle CORE 10.1.0.5.0
Production SQL*Plus: Release 10.2.0.3.0 – Production on Thu Nov 22
19:44:05 2012 Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to: Oracle Database 11g Enterprise Edition Release
11.2.0.2.0 – 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real
Application Testing options
TEXT_IO reads files from directories local to the Forms runtime. In client/server mode that would be our desktop PC but in web-delivered Forms that is the app server.
So TEXT_IO is actually the function you need to use in the scenario you describe.
What TEXT_IO can’t do is read or write to files on the desktop PC. That’s the reason why Oracle added the Webutils library, to provide the client-side functionality which no longer works in n-tier architectures.