[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1069
  • Last Modified:

MS DOS Set Time

I'm writing a script set_time.sql
the sets a time variable by hosting to dos.

The variable displays the current time the first time the script is called from SQL>@set_time
but when I executed the script again,
the variable stays the same.

My question is how to refresh (clear) the variable
so each time the script is called it displays the new time?

host Set HHMISS=%TIME%
host echo %hhmiss%
0
revxprts
Asked:
revxprts
  • 8
  • 5
1 Solution
 
jdeclueCommented:
do a

host Set HHMISS=
host Set HHMISS=%TIME%
host echo %hhmiss%

This should clear it each time, first.

J
0
 
revxprtsAuthor Commented:
I tried that already--the time did not change.
0
 
jdeclueCommented:
ok just a sec
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
jdeclueCommented:
THis is odd... it is working flawlessly for me. What kind of machine are you running on NT/2000/2003?

J
0
 
revxprtsAuthor Commented:
I'm on a Windows 2000 machine, partitioned into C: and D: drives.

=========
set_time.sql
=========
host Set HHMISS=
host echo %hhmiss%

host Set HHMISS=%TIME%
host echo %hhmiss%

=========
=========
D:\> dir
set_time.sql

D:\> sqlplus /nolog
D:\> connect system/passwd
D:\> @set_time

-- time stays the same
0
 
jdeclueCommented:
what happens whe you go to a command prompt and do it manually, are they the same time?

set time=
set time=%TIME%
echo %TIME%

set time=
set time=%TIME%
echo %TIME%
0
 
revxprtsAuthor Commented:
It works fine from the command prompt.
0
 
jdeclueCommented:
the sqlplus is not holding the environment between commands. Can you put this in cmd file and call it?

J
0
 
revxprtsAuthor Commented:
I don't understand
0
 
jdeclueCommented:
Create a text file on d:\time.cmd

Put this in the text file:

@Echo off
Set HHMISS=
Set HHMISS=%TIME%
echo %hhmiss%

then call

host time.cmd

0
 
jdeclueCommented:
So, that worked?

J
0
 
revxprtsAuthor Commented:
You ROCK!
0
 
jdeclueCommented:
Thank you sir ;)

J
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 8
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now