Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Oracle Form and a standard window dialogue

545 views
Skip to first unread message

Richard Drive

unread,
Dec 6, 2001, 6:21:57 PM12/6/01
to
Am using Forms 6.0 in a Windows NT environment, I want the use to be
able to bring up a dialogue window, like the standard 'File->Open'.

The user will navigate until they find the file they want, and then
select it.
The full path + name of the file will then be captured and passed as a
parameter and used in the 'DATA= ' portion of a sqlloader command
string.

Is there a built that can be used, or will this have to be built from
scratch?

If the former, which are they?

If the latter, can you give me heads up and the best approach?

Any and all suggestions appreciated.

Thanks.

--
RDII

Simon Redmond

unread,
Dec 7, 2001, 5:36:29 AM12/7/01
to
dota...@excite.com (Richard Drive) wrote in message news:<78586940.01120...@posting.google.com>...


take a look at D2KWUTIL.pll that ships with Oracle, there some useful
procedures in here to do exactly what you want to do (Along with many
others!)

try looking for....

win_api_dialog.open_file


Hope this helps

Simon

gti_matt

unread,
Dec 8, 2001, 12:43:27 AM12/8/01
to
"Richard Drive" <dota...@excite.com> wrote in message
news:78586940.01120...@posting.google.com...

> Am using Forms 6.0 in a Windows NT environment, I want the use to be
> able to bring up a dialogue window, like the standard 'File->Open'.

Make sure that d2kwutil.pll is in your path so Forms can see it and attach
it to your form.


Then, in your PL/SQL where you want to call it, call
WIN_API_DIALOG.OPEN_FILE. This is the package spec for the WIN_API_DIALOG
package so you can see the parameters:


PACKAGE WIN_API_DIALOG IS


/*-------------------------------------------------------------------------*
\
* WIN_API_DIALOG -> This package is concerned with Displaying Common
* dialogs
* Contents:
* Open_File -> Open File Dialog
* Save_File -> Save File Dialog
* Select_Printer -> Printer Selection Dialog
* Dependancies:
* WIN_API_ENVIRONMENT
* WIN_API
\*-------------------------------------------------------------------------*
/


/*-------------------------------------------------------------------------*
\
* Open_File -> Displays the standard Open File dialog
* Arguments:
* Title -> The Title for the Dialog Box
* (Default -> 'Open File')
* StartDirectory -> Where the dialog should start from
* this should be in the format 'C:\TEMP'
* (Default -> Windows Directory)
* FileFilter -> Restrict the list of files. The filter
string
* should be in the format:
* '<Description>|<filename>.<Extension>|'
* typically this would be something like
* 'All files(*.*)|*.*|' or 'Text
files(*.txt)|*.txt|'
* All Files is the Default
* Modal -> Should the dialog be modal with respect to
the
* application?
* default -> TRUE
* AdvancedFlags -> (See list in WIN_API header) This option
allows
* you to change the attributes of the Open
File
* dialog. Here are some of the Flags that
might
* be of interest:
* OFN_HIDEREADONLY Hides the Read Only
check box.
* OFN_NONETWORKBUTTON Hides the Network
Button
* OFN_EXPLORER Display an Explorer
style
* Dialog rather than
the
* conventional one.
* See your Microsoft docmentation for details
on
* each flag.
* To Set the Advanced_Flags varaible, just add
the
* required flags together. The default is:
* WIN_API.OFN_PATHMUSTEXIST +
WIN_API.OFN_FILEMUSTEXIST +
* WIN_API.OFN_HIDEREADONLY +
WIN_API.OFN_NOCHANGEDIR
* RaiseExceptions -> TRUE of FALSE(Default) If set to true, then
if the
* command is not successful (e.g no filename
is
* returned) then the explicit exception
* NO_DATA_FOUND will be raised.
*
* Returns:
* Path and name of the selected file
\*-------------------------------------------------------------------------*
/

FUNCTION Open_File ( Title IN VARCHAR2 DEFAULT
'Open File',
StartDirectory IN VARCHAR2 DEFAULT
'$WINDIR$',
FileFilter IN VARCHAR2 DEFAULT 'All
files(*.*)|*.*|',
Modal IN BOOLEAN DEFAULT
TRUE,
AdvancedFlags IN PLS_INTEGER DEFAULT
WIN_API.OFN_FLAG_DEFAULT,
RaiseExceptions IN BOOLEAN DEFAULT
FALSE
) RETURN VARCHAR2;


/*-------------------------------------------------------------------------*
\
* Save_File -> Displays the standard Save File dialog
* Arguments:
* SampleName -> The Example name for the file to display in
* the Save Window
* Title -> The Title for the Dialog Box
* (Default -> 'Save File As')
* StartDirectory -> Where the dialog should start from
* this should be in the format 'C:\TEMP'
* (Default -> Windows Directory)
* You can specify the Windows and Temp
directories by
* using the Shorthand $WINDIR$ and $TEMP$
respectively
* The function will then Ask the O/S for the
relevant
* locations
* FileFilter -> Restrict the list of files. The filter
string
* should be in the format:
* '<Description>|<filename>.<Extension>|'
* typically this would be something like
* 'All files(*.*)|*.*|' or 'Text
files(*.txt)|*.txt|'
* All Files is the Default
* Modal -> Should the dialog be modal with respect to
the
* application?
* default -> TRUE
* AdvancedFlags -> (See list in WIN_API header) This option
allows
* you to change the attributes of the Open
File
* dialog. Here are some of the Flags that
might
* be of interest:
* OFN_HIDEREADONLY Hides the Read Only
check box.
* OFN_NONETWORKBUTTON Hides the Network
Button
* OFN_EXPLORER Display an Explorer
style
* Dialog rather than
the
* conventional one.
* See your Microsoft docmentation for details
on
* each flag.
* To Set the Advanced_Flags varaible, just add
the
* required flags together. The default is:
* WIN_API.OFN_PATHMUSTEXIST +
WIN_API.OFN_FILEMUSTEXIST +
* WIN_API.OFN_HIDEREADONLY +
WIN_API.OFN_NOCHANGEDIR
* RaiseExceptions -> TRUE of FALSE(Default) If set to true, then
if the
* command is not successful (e.g no filename
is
* returned) then the explicit exception
* NO_DATA_FOUND will be raised.
*
* Returns:
* Path and name of the selected file
\*-------------------------------------------------------------------------*
/

FUNCTION Save_File ( SampleName IN VARCHAR2,
Title IN VARCHAR2 DEFAULT
'Save File As',
StartDirectory IN VARCHAR2 DEFAULT
'$WINDIR$',
FileFilter IN VARCHAR2 DEFAULT 'All
files(*.*)|*.*|',
Modal IN BOOLEAN DEFAULT
TRUE,
AdvancedFlags IN PLS_INTEGER DEFAULT
WIN_API.OFN_FLAG_DEFAULT,
RaiseExceptions IN BOOLEAN DEFAULT
FALSE
) RETURN VARCHAR2;

/*-------------------------------------------------------------------------*
\
* Select_Printer -> Displays the standard Printer Selection
* dialog.
* Arguments:
* PrinterName -> The Name of the Printer the user Chooses
* Port -> The Port for the above printer
* RaiseExceptions -> TRUE of FALSE(Default) If set to true, then
if the
* command is not successful (e.g no Printer is


selected) then the explicit exception
* NO_DATA_FOUND will be raised.
* Returns:
* Path and name of the selected file
\*-------------------------------------------------------------------------*
/

PROCEDURE Select_Printer ( PrinterName OUT VARCHAR2,
Port OUT VARCHAR2,
RaiseExceptions in BOOLEAN DEFAULT FALSE);


END WIN_API_DIALOG;


Joost Bataille

unread,
Dec 11, 2001, 11:10:09 AM12/11/01
to
You can also use the Forms built_in 'GET_FILE_NAME'. You don't have to
bother about the d2kwutil.pll anymore. It does the same thing.

Regards, Joost

--
Joost Bataille
University of Amsterdam
"gti_matt" <gti...@home.com> wrote in message
news:3MhQ7.50886$Sx.14...@news1.elcjn1.sdca.home.com...

0 new messages