How To Displ Estimate Time [message #319456] |
Sun, 11 May 2008 09:56  |
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 #319632 is a reply to message #319598] |
Mon, 12 May 2008 07:04   |
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 #319969 is a reply to message #319865] |
Tue, 13 May 2008 09:23   |
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 #320031 is a reply to message #320028] |
Tue, 13 May 2008 15:42   |
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 #320204 is a reply to message #320187] |
Wed, 14 May 2008 05:26   |
 |
Littlefoot
Messages: 21826 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 #321006 is a reply to message #320994] |
Sat, 17 May 2008 12:59   |
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 #321034 is a reply to message #321012] |
Sun, 18 May 2008 09:10   |
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
|
|
|
|
|