Home » Developer & Programmer » Forms » Transfer Control (10g developer suite, 10g ,win xp)
Transfer Control [message #328869] Mon, 23 June 2008 03:11 Go to next message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
Hi,

This is my WHEN_BUTTON_PRESSED trigger code

declare
  file_name varchar2(30) := name_in('FILE_NAME');		
  get varchar2(20); 
begin
  get := blob1(file_name);
  /*This part (below) does not run*/
  message('This is the filename '||file_name); 
  message(' ');
end;


Here is the code of function blob1

create or replace function blob1(file_name varchar)
     return varchar                        
as                                                                                                                                                              
  a blob;                                                                                                                                                      
  loc bfile := bfilename('D1','''||file_name||''');                                                                                                                                                                                                                                           
begin                                                                                                                                                           
  insert into das.pictures values(empty_blob())                                                                                                                
  returning photo into a;                                                                                                             
                          
  /*opening the location to load the file*/                                                                                                 dbms_lob.fileopen(loc);                             
                                                                                                         
  /*loading into the blob variable which inturns 
  loads into the table*/         
                                                                                
  dbms_lob.loadfromfile(a,loc,dbms_lob.getlength(loc));                                                                                                                                                                                                                                                                      
  /*closing the location*/                                                                                                                                      
  dbms_lob.fileclose(loc);                                                                                                            
  return 'TRUE';                                                                                                                                                                                                                                                        
end; 


The problem is that the control gets transfered to the function (at the server) so that last part of the trigger does not run. Any solution to get the control back to the form?
Re: Transfer Control [message #329135 is a reply to message #328869] Tue, 24 June 2008 04:14 Go to previous message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
got it...

loc bfile := bfilename('D1','''||file_name||''');   


loc bfile := bfilename('D1',file_name);   
Shocked

Rest is working fine
Previous Topic: Calling a Excel sheet from Menu Builder
Next Topic: Master/detail tables, restricting adding in detail table
Goto Forum:
  


Current Time: Sat Nov 09 14:38:29 CST 2024