2

I have oracle database 11g with oracle forms and reports 11g. I created browse button to open CSV File from computer or laptop directory

enter image description here

I am using this code on trigger when-button-press:

declare
 filename varchar2(500);
begin
 filename := GET_FILE_NAME(File_Filter=> ‘CSV Files
 (*.Csv)|*.Csv|’);
:block2.FILE_NAME:= filename;

end;

When I pressed the button then did not open dialog box.

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
Ramiz Tariq
  • 387
  • 10
  • 27

1 Answers1

2

Your code works on Forms 6i provided you have properly attached the .olb and .pll files for webutil, but for Oracle Fusion Middleware 11g the method GET_FILE_NAME should be replaced with CLIENT_GET_FILE_NAME to search in your local file system instead of application server as below :

:block2.FILE_NAME := CLIENT_GET_FILE_NAME(File_Filter=> 'CSV Files (*.Csv)|*.Csv|');

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
  • identifier 'client_get_file_name' must be declared – Ramiz Tariq Mar 14 '19 at 05:50
  • @RamizTariq are you sure that you added `webutil.pll` under `Attached Libraries` node and dragged `webutil.olb` into `Object Groups` node ..? `webutil.pll` has a method called `client_get_file_name`. – Barbaros Özhan Mar 14 '19 at 07:17
  • Not attached. Any other way to attach csv file with browse button without using webutil? – Ramiz Tariq Mar 14 '19 at 07:27
  • @RamizTariq I don't know and I don't think if any other way exists, but I suggest you add and use webutil. – Barbaros Özhan Mar 14 '19 at 07:47
  • I attached webutil.pll and webutil.olb. After attached when I pressed the button then getting error WHEN-BUTTON-PRESSED trigger raised unhandled exception – Ramiz Tariq Mar 14 '19 at 10:17
  • @RamizTariq if you're invoking form from application server, then you need to choose `Yes` option during attaching webutil.pll whenever `Remove path?` question is prompted. – Barbaros Özhan Mar 14 '19 at 10:44
  • I am using oracle forms on laptop. During attaching webutil.pll i selected "No" for path – Ramiz Tariq Mar 14 '19 at 10:50
  • @RamizTariq anyway you need an application server( webutil ) even if located in your local machine, you need to deploy you .fmb file to that app server, since `client_get_file_name` is such a feature which is used by invoking through web based logic instead of client-server logic. – Barbaros Özhan Mar 14 '19 at 10:59
  • I configured webutil from this link http://dbperfection.com/webutil-configuration-steps-for-oracle-fusion-middleware-forms-11g-r2/. Now I am getting this error: frm-40734 internal error pl/sql error occurred after press button – Ramiz Tariq Mar 15 '19 at 06:26
  • @RamizTariq please have a look at this [link](https://stackoverflow.com/questions/53445941/oracle-form-freezes-after-configure-webutil/53907574#53907574) related to **setting %CLASSPATH% and missing jar files** – Barbaros Özhan Mar 15 '19 at 07:03