My Oracle Support Banner

Delay escript execution using sleep() function in Windows and Unix (Doc ID 541719.1)

Last updated on AUGUST 02, 2018

Applies to:

Siebel Tools - Version 7.0.4.10 [14072] and later
Oracle Solaris on SPARC (64-bit)
Product Release: V7 (Enterprise)
Version: 7.0.4.10 [14072]
Database: Oracle 8.1.7.0
Application Server OS: Sun Solaris 8
Database Server OS: HP-UX 11.0

This document was previously published as Siebel SR 38-1042896367.

Checked for relevance on 3-Aug-2018

Symptoms

SBL-GEN-09401

How do you implement a sleep function in escript - we have a need to code a polling loop in eScript as follows:

 

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
 There is no eScript Sleep function or equivalent, but there are several ways for achieving the same functionality:

1. If the process is driven from Browser script (JavaScript), there is a SetTimer() function that allows repeating a process every few seconds. This could call a Business Service to do server client-side processing.

2. On Windows platforms only, it is possible to call the Windows API Sleep function directly. More information on Microsoft’s Knowledge Base (Article 231298: "HOWTO: Use SetWaitableTimer With Visual Basic")

3. Writing a dynamic linked library (DLL for Windows or so for Unix). This dynamic object can be written in any language. The VB language offers the delay function and/or timer functions, but it is only available on Windows platform. For Unix platform, the most common language is C.
 Solution implemented DLL on Window platform / on Unix platform:
 
For compiling the so file on Solaris, the customer has used the
Doc ID 476274.1: Calling a shared library from eScript available on SupportWeb, but has added the following flags:
-static-libgcc

Full line for the link step was:

gcc libtest.o -static-libgcc -shared -o libtest.so

Generic eScript code for using on both platforms (Windows and Unix):

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.