Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Setting a bind variable = script variable ??
My problem is I am trying to calculate elapsed time that a script runs.
I have the time calculation worked out, the problem is the only way to
get the calculated time into a script variable is to spool a file and
then read the file.
Here is an example of the code
variable start_time NUMBER;
variable all_time NUMBER;
exec :start_time := DBMS_UTILITY.GET_TIME;
# Script Timing Code
SET SERVEROUTPUT ON
TTITLE OFF
BTITLE OFF
exec :all_time := (DBMS_UTILITY.GET_TIME - :start_time)/6000;
spool $TIMEFILE
print all_time
spool off
TTITLE ON
SET SERVEROUTPUT OFF
sh -x timechecker.sh $TIMEFILE $0 5
The timechecker.sh script reads the file and does a sed to get the time.
The problem if the person wrting the script adds SET commands that effect the $TIMEFILE spool file the timechecker script will fail. Commands like BTITLE CENTER 'Page ' format 999 sql.pno
Is there any way to to get :all_time into a script variable $ALL_TIME??
Joseph P. Condle Jr. condle_at_mars-systems.com Office 412-648-1379 Senior Systems Engineer Fax 412-647-9661 Medical ARchival Systems, Inc. (MARS) Pager 412-572-94903500 Victoria Street Pgh. Pa. 15261 USA Received on Tue May 25 1999 - 13:00:06 CDT
![]() |
![]() |