Home » Developer & Programmer » Forms » How To Displ Estimate Time (form 6i/dev2000)
How To Displ Estimate Time [message #319456] Sun, 11 May 2008 09:56 Go to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member

hi dears

i have create my progress bar which is working fine now i want to show also estimated time example how much time/bytes left for process completion on my progress bar anybody knows pls tell me sample code shall be apreciated for for me


thanks
owais
Re: How To Displ Estimate Time [message #319491 is a reply to message #319456] Sun, 11 May 2008 22:02 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

this might help. just post what you got from this.
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:8913428904303
Re: How To Displ Estimate Time [message #319578 is a reply to message #319456] Mon, 12 May 2008 05:16 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
thanks for reply wency

but iam using database 10g and form 6i i dont think we can get something from this pls try to find any relevant answer

thanks in advance

owais
Re: How To Displ Estimate Time [message #319598 is a reply to message #319578] Mon, 12 May 2008 06:15 Go to previous messageGo to next message
Littlefoot
Messages: 20892
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
i dont think we can get something from this pls try to find any relevant answer

./fa/1688/0/ Tell me that you are joking. You are, aren't you?

Otherwise, are you not ashamed of saying, even THINKING something like that? If you aren't satisfied with a provided answer, Internet is wide enough and will let you search for the answer by yourself. As far as I'm concerned, you may search for it the rest of your life.
Re: How To Displ Estimate Time [message #319632 is a reply to message #319598] Mon, 12 May 2008 07:04 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
mr littlefoot

dont be over smart i did not meant to critise anyone i just meant to say i cauld not get anything from this try to find sample progress bar coding where estimated time also been used
and stop using these kind of words ok


thanks
owais
Re: How To Displ Estimate Time [message #319634 is a reply to message #319632] Mon, 12 May 2008 07:25 Go to previous messageGo to next message
Littlefoot
Messages: 20892
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
No, it isn't OK.

The easiest way to get a solution is your way: ask a question on (OraFAQ) forum, sit back and wait for answer which will fulfill your needs. As soon as the answer isn't "perfect", you don't accept it and ask someone else to find a better answer. (Right; as if we don't have something else to do but search for answers to your questions)
Re: How To Displ Estimate Time [message #319730 is a reply to message #319634] Mon, 12 May 2008 19:03 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

littlefoot is right, we are also busy persons.
I found these sites in less than 2minutes of searching. I beleive this formula will fit to your problem.
http://www.gplivna.eu/papers/v$session_longops.htm
http://www.codeproject.com/KB/miscctrl/progresstimetocomplete.aspx
http://www.jennessent.com/arcview/progress_meter.htm

here if you need to get time difference.

select (:newdate-:olddate) from dual --in days
select (:newdate-:olddate)*24 from dual --in hours
select (:newdate-:olddate)*60*24 from dual --in minutes
select (:newdate-:olddate)*60*60*24 from dual --in seconds

Do your part, do some programming. It's easy bro.
--wency

[Updated on: Mon, 12 May 2008 22:08]

Report message to a moderator

Re: How To Displ Estimate Time [message #319865 is a reply to message #319634] Tue, 13 May 2008 04:52 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
thanks wency

this one i need thanks



thanks again
owais
Re: How To Displ Estimate Time [message #319940 is a reply to message #319730] Tue, 13 May 2008 07:45 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
hi wency

i think v$session_longops not compatible for FORMS 6i what else shall be the solution


thanks
owais
Re: How To Displ Estimate Time [message #319969 is a reply to message #319865] Tue, 13 May 2008 09:23 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
hi wency whats wrong with this procedure compilation

create or replace procedure Progress_Bar
As
rindex pls_integer := -1;
slno pls_integer;
Begin
dbms_application_info.set_session_longops(
RINDEX => rindex
,SLNO => slno
,OP_NAME => 'PROGRESS_BAR'
,SOFAR => 0
,TOTALWORK => 100
);
For i IN 1..100 loop
DBMS_LOCK.SLEEP(.3);
dbms_application_info.set_session_longops(
RINDEX => rindex
,SLNO => slno
,OP_NAME => 'PROGRESS_BAR'
,SOFAR => i
,TOTALWORK => 100
);
End loop;
End;

Warning: Procedure created with compilation errors.


thanks
owais
Re: How To Displ Estimate Time [message #320028 is a reply to message #319969] Tue, 13 May 2008 14:59 Go to previous messageGo to next message
Littlefoot
Messages: 20892
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Type
SQL> SHOW ERRORS PROCEDURE PROGRESS_BAR
at the SQL*Plus prompt and you'll see what's wrong with the procedure.
Re: How To Displ Estimate Time [message #320031 is a reply to message #320028] Tue, 13 May 2008 15:42 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member

this is a error while creating procedure

14/1 PL/SQL: Statement ignored
14/1 PLS-00201: identifier 'DBMS_LOCK' must be declared


--------------------------

and in forms 6i some internal "error ora-00600 internal error code"

declare
v_percent number:=0;
begin

set_item_property('b.progressbar',width, 0);
v_percent :=0;
pause;
loop
exit when v_percent =100;
SELECT (sofar / totalwork) * 100
INTO v_percent
FROM v$session_longops WHERE opname = 'APEX__JOB_LANG_LAUFEND' AND sofar < totalwork;
-- message(v_percent);pause;
:b.percent:= v_percent||'%';
set_item_property('b.progressbar',width, round( v_percent,2));
synchronize;
dbms_lock.sleep(2);
end loop;

exception
when NO_DATA_FOUND then
v_percent := -1;
set_item_property('b.progressbar',width, 100);
:b.percent:= '100'||'%';
when TOO_MANY_ROWS then
v_percent := -1;
DBMS_SCHEDULER.drop_job (job_name => 'APEX__JOB_LANG_LAUFEND',FORCE=> true) ;

end;


thanks
owais
Re: How To Displ Estimate Time [message #320036 is a reply to message #320031] Tue, 13 May 2008 16:23 Go to previous messageGo to next message
Littlefoot
Messages: 20892
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
14/1 PLS-00201: identifier 'DBMS_LOCK' must be declared

User you are connected to doesn't have the required privileges to use DBMS_LOCK package. In order to make it possible, connect as a privileged user (SYS is such a user) and
SQL> GRANT EXECUTE ON DBMS_LOCK TO user_name_that_is_supposed_to_use_it;

Now try to create a procedure and we'll see what next.
Re: How To Displ Estimate Time [message #320043 is a reply to message #320036] Tue, 13 May 2008 17:50 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

See attach sample form created in forms 6i. it's working.
just merge it with your progress bar.
<<edit spelling>>
  • Attachment: Time.fmb
    (Size: 56.00KB, Downloaded 271 times)

[Updated on: Tue, 13 May 2008 22:33]

Report message to a moderator

Re: How To Displ Estimate Time [message #320181 is a reply to message #320043] Wed, 14 May 2008 04:40 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
hi wency thanks for reply

same error is comming pls download this error.bmp check this error and plssss reply



thanks
owais


Re: How To Displ Estimate Time [message #320187 is a reply to message #320181] Wed, 14 May 2008 04:47 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
hi wency sorry for inconvinience pls
download this error.jpg

thanks
owais
  • Attachment: ERROR.JPG
    (Size: 252.71KB, Downloaded 168 times)
Re: How To Displ Estimate Time [message #320204 is a reply to message #320187] Wed, 14 May 2008 05:26 Go to previous messageGo to next message
Littlefoot
Messages: 20892
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
ORA-00600 usually means bad news ...
Oracle
ORA-00600: internal error code, arguments: [string], [string], [string], [string], [string], [string], [string], [string]


Cause: This is the generic internal error number for Oracle program exceptions. This indicates that a process has encountered an exceptional condition.

Action: Report as a bug - the first argument is the internal error number
Re: How To Displ Estimate Time [message #320375 is a reply to message #320187] Wed, 14 May 2008 21:20 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Try doing a Ctrl-Shft-k (Compile All) before doing the Ctrl-t (Generate).

David
Re: How To Displ Estimate Time [message #320994 is a reply to message #320375] Sat, 17 May 2008 08:40 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
Thanks all

Sseniors/Seniorinas


i have done it

thanks again
owais
Re: How To Displ Estimate Time [message #320998 is a reply to message #320994] Sat, 17 May 2008 09:52 Go to previous messageGo to next message
Littlefoot
Messages: 20892
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Great!

After all this pain, would you mind to share the final solution with the rest of the community?
Re: How To Displ Estimate Time [message #321006 is a reply to message #320994] Sat, 17 May 2008 12:59 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
hi mr littlefoot

its for you

declare					
   v_ctr number:=0;	
   v_pct number :=0;		
   v_resales_disti_cost number:=0;		
   v_all_cnt number:=0;
   v_time_remaining number:=0;
   v_time1	date;
   v_time2	date;
   v_elapse_seconds number:=0;

     ABC1 VARCHAR2(5):=' ';
      ABC2 NUMBER(10,2):=0;
      XYZ VARCHAR2(6);
      Z NUMBER(10);
      ABC3 NUMBER(10);
      var1 varchar2(100);
      AAA VARCHAR2(100);
  CURSOR C1 IS SELECT folio,bonus,HOLD,bonus_Rat FROM sholders,COMPANY ;

begin					
--    Set_item_Property('Progress',Width,0);  
  v_all_cnt := get_all_count2;
  v_time1 := sysdate;

set_item_property('dual.progress',width, 0);

For a IN c1 Loop
     ABC1:=a.folio;
     ABC2:=a.bonus;
      ABC3:=a.HOLD;    
      Z   :=a.bonus_rat; 
      UPDATE sholders SET bonus =ABC3/100*Z WHERE folio=abc1; 
     --delete from sholders;
    --Set_item_Property('Progress',Width,i); 
   
	  		  	if v_pct = 0 Then
		  		 v_time1 := sysdate;
				  	end if;
				  	
			  	v_pct := v_pct + 1;
			  	:dual.pct:= to_char((v_pct/v_all_cnt)*100) || ' %';
--exit when :dual.progress =:dual.pct;
set_item_property('dual.progress',width, round( v_pct/v_all_cnt,2*2)*300);

synchronize;
	
    if v_pct > 0 Then				  	
 	   v_time2 := sysdate;
				  	
 Begin
   select (v_time2-v_time1)*60*60*24 				  	    into v_elapse_seconds				  	    from dual; --in seconds
  end;
v_time_remaining := (v_elapse_seconds * (v_all_cnt-v_pct))/v_pct;
:dual.timerem := to_char(v_time_remaining, '9999') || ' seconds left.';
synchronize;

end if;
 END LOOP;
--end loop;
forms_ddl('commit');
 message('Done');
 message('Done');
exception
when NO_DATA_FOUND then
:dual.progress:= -1;
set_item_property('dual.pct',width, 100);
:dual.progress:= '100'||'%';
when TOO_MANY_ROWS then
:dual.progress := -1;
DBMS_SCHEDULER.drop_job (job_name => 'APEX__JOB_LANG_LAUFEND',FORCE=> true) ;
end;

Thanks again
owais

[EDITED by LF: added [code] tags]



[Updated on: Sat, 17 May 2008 15:38] by Moderator

Report message to a moderator

Re: How To Displ Estimate Time [message #321012 is a reply to message #321006] Sat, 17 May 2008 15:40 Go to previous messageGo to next message
Littlefoot
Messages: 20892
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Thank you!

A question: why do you use Cartesian join in cursor declaration? Is it on purpose, or did you make a mistake?
CURSOR C1 IS SELECT folio,bonus,HOLD,bonus_Rat FROM sholders,COMPANY ;
Re: How To Displ Estimate Time [message #321034 is a reply to message #321012] Sun, 18 May 2008 09:10 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
yes it is on purpose and its working fine 100%

pls why load('imgscan.ocx')failed in winxp sp2
despite set use_shared_socket=true pls tell what's wrong with this



thanks
owais

Re: How To Displ Estimate Time [message #321049 is a reply to message #321034] Sun, 18 May 2008 15:49 Go to previous messageGo to next message
Littlefoot
Messages: 20892
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
yes it is on purpose and its working fine 100%
Right, but how long? How many records are there in these two tables at the moment?

Quote:
pls why load('imgscan.ocx')failed in winxp sp2
despite set use_shared_socket=true pls tell what's wrong with this
Sorry, that's behind my knowledge.
Re: How To Displ Estimate Time [message #321051 is a reply to message #321049] Sun, 18 May 2008 19:00 Go to previous message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
hi mr littlefoot

not that much records aproximately 5000 records in sholders table and in company table just picking percentage


thanks
owais
Previous Topic: How can store and download doc/pdf file in oracle
Next Topic: compile all forms using host command
Goto Forum:
  


Current Time: Mon Dec 05 02:38:23 CST 2016

Total time taken to generate the page: 0.08848 seconds