Home » Developer & Programmer » Forms » document is not open [merged 2 by jd] (oracle,oracle 6i,windows Xp)
document is not open [merged 2 by jd] [message #625844] Wed, 15 October 2014 00:52 Go to next message
shankar2689
Messages: 4
Registered: June 2014
Location: chennai
Junior Member

hi pls help

i am using when_button_pressed trigger for open the particular document but while click the button there is no response pls some one help me..

using query..
DECLARE
  in_file 	TEXT_IO.FILE_TYPE ;
  linebuf 	VARCHAR2(80); 
  file_path 	varchar2(300) ;
  fpath varchar2(15);
  a number;

	begin
				BEGIN
					SELECT PATH_DESC INTO FILE_PATH FROM IMAGE_PATH WHERE IMAGE_TYPE = 'SCANNED' ;
				EXCEPTION WHEN NO_DATA_FOUND THEN
					RAISE FORM_TRIGGER_FAILURE ;
				END ;

					select path into fpath from image_folder where scan_year =substr(:b010.job_no,1,4) and from_no<=substr(:b010.job_no,6,9) 
					and to_no>=substr(:b010.job_no,6,9);
					file_path:=file_path||substr(:b010.job_no,1,4)||'\'||fpath||'\'||:b010.job_no||'\'||:b010.job_no||'.tif';
		
					BEGIN 
					in_file := TEXT_IO.FOPEN(FILE_PATH, 'r'); 
				
					EXCEPTION WHEN OTHERS THEN 
  					IF SQLCODE = -302000 then 
    					a:=show_alert('scanned');
 			  	  END IF; 
				end;
			end;
			
		declare 
				OS_name  VARCHAR2(40); 
				file_path	varchar2(100) ;
				v_server_app varchar2(40);
				v_server_tag varchar2(600);
				v_command varchar2(2000);
				v_arg_pos pls_integer;
				fpath varchar2(100) ;
				thefile text_io.file_type;
		begin
			thefile:= text_io.fopen('c:\JOB.BAT', 'w');
					Begin
						v_server_tag := 'HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE' ;
				
						v_command    := win_api_environment.read_registry(v_server_tag,'ORACLE_HOME',true);
						
						v_arg_pos := instr(upper(v_command),'95');
							if v_arg_pos > 0 then
			  				OS_NAME := '95' ;
      				else
	      				OS_NAME := 'NT' ;
      				end if ;
					 Exception when Others then null ;
					End ;

					BEGIN
							SELECT PATH_DESC INTO FILE_PATH FROM IMAGE_PATH WHERE IMAGE_TYPE = 'SCANNED' ;
					EXCEPTION WHEN NO_DATA_FOUND THEN
					RAISE FORM_TRIGGER_FAILURE ;
					END ;

							select path into fpath from image_folder where scan_year =substr(:b010.job_no,1,4) and from_no<=substr(:b010.job_no,6,9) 
							and to_no>=substr(:b010.job_no,6,9);
							file_path:=file_path||substr(:b010.job_no,1,4)||'\'||fpath;
										if os_name = 'NT' then
											file_path :=  FILE_PATH ||'\'|| :B010.JOB_NO||'\'||:B010.JOB_NO||'.tif' ;
										else
											file_path := '..\KODAKPRV  ' || FILE_PATH ||'\'|| :B010.JOB_NO||'\'||:B010.JOB_NO||'.tif' ;
					          end if;
											text_io.put_line(thefile, '@Echo OFF');
											text_io.put_line(thefile,file_path);
											text_io.fclose(theFile);
											host('c:\JOB.BAT');
		EXCEPTION WHEN FORM_TRIGGER_FAILURE THEN
		:CNT_BLK.MSGFLD := 'MISSING PATH .. CANNOT RETRIEVE PATH ' ;
 		when no_Data_found then pause;
	end ;



Edited by Lalit : Added code tags to preserve code formatting

[Updated on: Wed, 15 October 2014 01:01] by Moderator

Report message to a moderator

Re: document is not open [message #625849 is a reply to message #625844] Wed, 15 October 2014 01:00 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Welcome to the forum!

Please read and follow the OraFAQ Forum Guide and How to use [code] tags, to enable us to help you.
Re: document is not open [message #625850 is a reply to message #625844] Wed, 15 October 2014 01:11 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi,

This is related to the Oracle Forms , so by the Next time please post at the Forms Forum for Forms Question!
Add MESSAGE() built-in displays the specified message in the status bar(add in the code)

and check which one is missing
oracle 6i forms file not open very urgent [message #625895 is a reply to message #625844] Wed, 15 October 2014 10:50 Go to previous message
shankar2689
Messages: 4
Registered: June 2014
Location: chennai
Junior Member

Hi

please i am using oracle 6i forms and i want to open following format file like pdf or tif or jpeg.

i am using when-button-pressed trigger but while clicking the button there is no response pls help me very urgent.

below the query i am using the when-button-pressed-trigger

DECLARE
in_file TEXT_IO.FILE_TYPE ;
linebuf VARCHAR2(80);
file_path varchar2(300) ;
fpath varchar2(15);
a number;

begin
BEGIN
SELECT PATH_DESC INTO FILE_PATH FROM IMAGE_PATH WHERE IMAGE_TYPE = 'SCANNED' ;
EXCEPTION WHEN NO_DATA_FOUND THEN
RAISE FORM_TRIGGER_FAILURE ;
END ;

select path into fpath from image_folder where scan_year =substr(:b010.job_no,1,4) and from_no<=substr(:b010.job_no,6,9)
and to_no>=substr(:b010.job_no,6,9);
file_path:=file_path||substr(:b010.job_no,1,4)||'\'||fpath||'\'||:b010.job_no||'\'||:b010.job_no||'.tif';

BEGIN
in_file := TEXT_IO.FOPEN(FILE_PATH, 'r');

EXCEPTION WHEN OTHERS THEN
IF SQLCODE = -302000 then
a:=show_alert('scanned');
END IF;
end;
end;

declare
OS_name VARCHAR2(40);
file_path varchar2(100) ;
v_server_app varchar2(40);
v_server_tag varchar2(600);
v_command varchar2(2000);
v_arg_pos pls_integer;
fpath varchar2(100) ;
thefile text_io.file_type;
begin
thefile:= text_io.fopen('c:\JOB.BAT', 'w');
Begin
v_server_tag := 'HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE' ;

v_command := win_api_environment.read_registry(v_server_tag,'ORACLE_HOME',true);

v_arg_pos := instr(upper(v_command),'95');
if v_arg_pos > 0 then
OS_NAME := '95' ;
else
OS_NAME := 'NT' ;
end if ;
Exception when Others then null ;
End ;

BEGIN
SELECT PATH_DESC INTO FILE_PATH FROM IMAGE_PATH WHERE IMAGE_TYPE = 'SCANNED' ;
EXCEPTION WHEN NO_DATA_FOUND THEN
RAISE FORM_TRIGGER_FAILURE ;
END ;

select path into fpath from image_folder where scan_year =substr(:b010.job_no,1,4) and from_no<=substr(:b010.job_no,6,9)
and to_no>=substr(:b010.job_no,6,9);
file_path:=file_path||substr(:b010.job_no,1,4)||'\'||fpath;
if os_name = 'NT' then
file_path := FILE_PATH ||'\'|| :B010.JOB_NO||'\'||:B010.JOB_NO||'.tif' ;
else
file_path := '..\KODAKPRV ' || FILE_PATH ||'\'|| :B010.JOB_NO||'\'||:B010.JOB_NO||'.tif' ;
end if;
text_io.put_line(thefile, '@Echo OFF');
text_io.put_line(thefile,file_path);
text_io.fclose(theFile);
host('c:\JOB.BAT');
EXCEPTION WHEN FORM_TRIGGER_FAILURE THEN
:CNT_BLK.MSGFLD := 'MISSING PATH .. CANNOT RETRIEVE PATH ' ;
when no_Data_found then pause;
end ;
Previous Topic: send sms in oracle via mobile modem
Next Topic: Converted Stand Alone Oracle Forms executable
Goto Forum:
  


Current Time: Tue Apr 23 02:02:55 CDT 2024